X-Git-Url: http://git.euphorik.ch/?p=master-thesis.git;a=blobdiff_plain;f=Parasitemia%2FParasitemia%2FConfig.fs;h=55e142cd200efccfd8c402a67d784454a01d6b0d;hp=b22a4fdd6feb3847902aa55a32f83625005adf13;hb=84fdf7404133803fdf0dc867a4da68a144975191;hpb=ba64921fb9a0c36cd8cf802cbf1b2c0f79bc25f6 diff --git a/Parasitemia/Parasitemia/Config.fs b/Parasitemia/Parasitemia/Config.fs index b22a4fd..55e142c 100644 --- a/Parasitemia/Parasitemia/Config.fs +++ b/Parasitemia/Parasitemia/Config.fs @@ -1,9 +1,47 @@ 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 + + stainArea: float // Factor of a RBC area. 0.5 means the half of RBC area. + stainLevel: float // [0, 1] + + infectionArea: float // Factor of a RBC area. 0.5 means the half of RBC area. + infectionLevel: float // [0, 1] + infectionPixelsRequired: int + + maxDarkStainRatio: float + + minimumCellArea: float // Factor of RBC area. +} + +type Config (param: Parameters) = + member this.Parameters = param + member val Debug = DebugOff with get, set + member val RBCSize = 30. with get, set + + member this.RBCMin = this.RBCSize + param.minRbcRadius * this.RBCSize + member this.RBCMax = this.RBCSize + param.maxRbcRadius * this.RBCSize + + member this.RBCMinArea = param.minimumCellArea * Math.PI * this.RBCSize ** 2.0 + + member this.ParasiteArea = param.infectionArea * Math.PI * this.RBCSize ** 2.0 + member this.StainArea = param.stainArea * Math.PI * this.RBCSize ** 2.0