X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=Parasitemia%2FParasitemia%2FConfig.fs;h=5740e8b98efa3e8b721282b54bf8151d9b6b62dc;hb=bef2e9f0bf1bba21d4c988fdf654c2dc303ec34a;hp=b22a4fdd6feb3847902aa55a32f83625005adf13;hpb=ba64921fb9a0c36cd8cf802cbf1b2c0f79bc25f6;p=master-thesis.git diff --git a/Parasitemia/Parasitemia/Config.fs b/Parasitemia/Parasitemia/Config.fs index b22a4fd..5740e8b 100644 --- a/Parasitemia/Parasitemia/Config.fs +++ b/Parasitemia/Parasitemia/Config.fs @@ -1,9 +1,48 @@ module Config -type Config = { - doGSigma1: float - doGSigma2: float - doGLowFreqPercentageReduction: float +open System +type Debug = + | DebugOff + | DebugOn of string // Output directory. + +type Parameters = { scale: float -} \ No newline at end of file + + minRbcRadius: float + maxRbcRadius: float + + preFilterSigma: float + + // Ellipse. + factorNbPick: float + factorWindowSize: float // factor of 'maxRBCSize'. + + // Parasites detection. + darkStainLevel: float + maxDarkStainRatio: float + + stainArea: float // 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 // > 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 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 this.RBCMinRadius = this.RBCRadius + param.minRbcRadius * this.RBCRadius + member this.RBCMaxRadius = this.RBCRadius + param.maxRbcRadius * this.RBCRadius + + member this.RBCArea = Math.PI * this.RBCRadius ** 2.0 + member this.RBCMinArea = param.minimumCellArea * this.RBCArea + + member this.InfectionArea = param.infectionArea * this.RBCArea + member this.StainArea = param.stainArea * this.RBCArea