X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=Parasitemia%2FParasitemia%2FConfig.fs;h=a1b06e2b588adc35079d5f0809001d43d75fd68d;hb=6d99ab0dadc57e91cd846844b620fc90b52a2f96;hp=48a6334ceb76f0e2d5a03111f0f9087fe7c466f7;hpb=5ac2dedf8ead5275ac216e0b41829ab39c843800;p=master-thesis.git diff --git a/Parasitemia/Parasitemia/Config.fs b/Parasitemia/Parasitemia/Config.fs index 48a6334..a1b06e2 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] + + infectionArea: float // Factor of a RBC area. 0.5 means the half of RBC area. + infectionLevel: float // [0, 1] + parasitePixelsRequired: int + + maxDarkStainRatio: float + + minimumCellArea: float // Factor of RBC area. +} - infectionSigma: float - infectionLevel: float - infectionPixelsRequired: int +type Config (param: Parameters) = + member this.Parameters = param + member val Debug = DebugOff with get, set + member val RBCRadius = 30. with get, set - percentageOfFgValidCell: float + member this.RBCMinRadius = this.RBCRadius + param.minRbcRadius * this.RBCRadius + member this.RBCMaxRadius = this.RBCRadius + param.maxRbcRadius * this.RBCRadius - MaxDarkStainRatio: float + member this.RBCMinArea = param.minimumCellArea * Math.PI * this.RBCRadius ** 2.0 - minimumCellArea: int - maxOffcenter: float -} \ No newline at end of file + member this.InfectionArea = param.infectionArea * Math.PI * this.RBCRadius ** 2.0 + member this.StainArea = param.stainArea * Math.PI * this.RBCRadius ** 2.0