X-Git-Url: http://git.euphorik.ch/?p=master-thesis.git;a=blobdiff_plain;f=Parasitemia%2FParasitemia%2FConfig.fs;h=55e142cd200efccfd8c402a67d784454a01d6b0d;hp=48a6334ceb76f0e2d5a03111f0f9087fe7c466f7;hb=84fdf7404133803fdf0dc867a4da68a144975191;hpb=5ac2dedf8ead5275ac216e0b41829ab39c843800 diff --git a/Parasitemia/Parasitemia/Config.fs b/Parasitemia/Parasitemia/Config.fs index 48a6334..55e142c 100644 --- a/Parasitemia/Parasitemia/Config.fs +++ b/Parasitemia/Parasitemia/Config.fs @@ -1,16 +1,16 @@ module Config +open System + type Debug = | DebugOff | DebugOn of string // Output directory. -type Config = { - debug: Debug - +type Parameters = { scale: float - minRBCSize: float - maxRBCSize: float + minRbcRadius: float + maxRbcRadius: float preFilterSigma: float @@ -21,18 +21,27 @@ type Config = { // Parasites detection. darkStainLevel: float - stainSigma: float - stainLevel: float - stainSpreadRequired: float + stainArea: float // Factor of a RBC area. 0.5 means the half of RBC area. + stainLevel: float // [0, 1] - infectionSigma: float - infectionLevel: float + infectionArea: float // Factor of a RBC area. 0.5 means the half of RBC area. + infectionLevel: float // [0, 1] infectionPixelsRequired: int - percentageOfFgValidCell: float + 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 - MaxDarkStainRatio: float + member this.RBCMinArea = param.minimumCellArea * Math.PI * this.RBCSize ** 2.0 - minimumCellArea: int - maxOffcenter: float -} \ No newline at end of file + member this.ParasiteArea = param.infectionArea * Math.PI * this.RBCSize ** 2.0 + member this.StainArea = param.stainArea * Math.PI * this.RBCSize ** 2.0