X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=Parasitemia%2FParasitemia%2FConfig.fs;h=5bb993694f72a71d7e3f4df7e644ade1937a4393;hb=999a48b8eb25c92e4403c9280fd4fe68f9bc4b7b;hp=261d87bb7fb67cd419c47857eeecdb2c33d265b8;hpb=21ce317bce2e1b58803bbb1be439161251478568;p=master-thesis.git diff --git a/Parasitemia/Parasitemia/Config.fs b/Parasitemia/Parasitemia/Config.fs index 261d87b..5bb9936 100644 --- a/Parasitemia/Parasitemia/Config.fs +++ b/Parasitemia/Parasitemia/Config.fs @@ -2,47 +2,51 @@ open System +open Const + type Debug = | DebugOff | DebugOn of string // Output directory. type Parameters = { - scale: float + initialAreaOpen: int - minRbcRadius: float - maxRbcRadius: float + minRbcRadius: float32 + maxRbcRadius: float32 preFilterSigma: float // Ellipse. factorNbPick: float - factorWindowSize: float // factor of 'maxRBCSize'. // Parasites detection. - darkStainLevel: float + darkStainLevel: float // Lower -> more sensitive. Careful about illumination on the borders. + maxDarkStainRatio: float - stainArea: float // Factor of a RBC area. 0.5 means the half of RBC area. - stainLevel: float // [0, 1] + stainArea: float32 // Factor of a RBC area. 0.5 means the half of RBC area. + stainLevel: float // > 1 + maxStainRatio: float // [0, 1] - infectionArea: float // Factor of a RBC area. 0.5 means the half of RBC area. - infectionLevel: float // [0, 1] - parasitePixelsRequired: int - - maxDarkStainRatio: float + infectionArea: float32 // Factor of a RBC area. 0.5 means the half of RBC area. + infectionLevel: float // > 1 standardDeviationMaxRatio: float // The standard deviation of the pixel values of a cell can't be greater than standardDeviationMaxRatio * global standard deviation - minimumCellArea: float // Factor of RBC area. + minimumCellArea: float32 // Factor of the nominal RBC area. } type Config (param: Parameters) = member this.Parameters = param member val Debug = DebugOff with get, set - member val RBCRadius = 30. with get, set + member val RBCRadius = 30.f with get, set member this.RBCMinRadius = this.RBCRadius + param.minRbcRadius * this.RBCRadius member this.RBCMaxRadius = this.RBCRadius + param.maxRbcRadius * this.RBCRadius - member this.RBCMinArea = param.minimumCellArea * Math.PI * this.RBCRadius ** 2.0 + member this.RBCArea = PI * this.RBCRadius ** 2.f + member this.RBCMinArea = param.minimumCellArea * this.RBCArea + + member this.InfectionArea = param.infectionArea * this.RBCArea + member this.StainArea = param.stainArea * this.RBCArea - member this.InfectionArea = param.infectionArea * Math.PI * this.RBCRadius ** 2.0 - member this.StainArea = param.stainArea * Math.PI * this.RBCRadius ** 2.0 + member this.Copy () = + this.MemberwiseClone() :?> Config