X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=Parasitemia%2FParasitemia%2FConfig.fs;h=701a3fd984555de7b7efeb525065027e5cda5d77;hb=6b550c3faf4dea77738fa5c27cd9af277f45549c;hp=48a6334ceb76f0e2d5a03111f0f9087fe7c466f7;hpb=5ac2dedf8ead5275ac216e0b41829ab39c843800;p=master-thesis.git diff --git a/Parasitemia/Parasitemia/Config.fs b/Parasitemia/Parasitemia/Config.fs index 48a6334..701a3fd 100644 --- a/Parasitemia/Parasitemia/Config.fs +++ b/Parasitemia/Parasitemia/Config.fs @@ -1,38 +1,52 @@ module Config +open System + +open Const + type Debug = | DebugOff | DebugOn of string // Output directory. -type Config = { - debug: Debug - - scale: float +type Parameters = { + initialAreaOpen: int - minRBCSize: float - maxRBCSize: float + minRbcRadius: float32 + maxRbcRadius: float32 preFilterSigma: float // Ellipse. factorNbPick: float - factorWindowSize: float // factor of 'maxRBCSize'. // Parasites detection. darkStainLevel: float + maxDarkStainRatio: float + + stainArea: float32 // Factor of a RBC area. 0.5 means the half of RBC area. + stainLevel: float // > 1 + maxStainRatio: float // [0, 1] + + 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: float32 // Factor of the nominal RBC area. +} - stainSigma: float - stainLevel: float - stainSpreadRequired: float +type Config (param: Parameters) = + member this.Parameters = param + member val Debug = DebugOff with get, set + member val RBCRadius = 30.f with get, set - infectionSigma: float - infectionLevel: float - infectionPixelsRequired: int + member this.RBCMinRadius = this.RBCRadius + param.minRbcRadius * this.RBCRadius + member this.RBCMaxRadius = this.RBCRadius + param.maxRbcRadius * this.RBCRadius - percentageOfFgValidCell: float + member this.RBCArea = PI * this.RBCRadius ** 2.f + member this.RBCMinArea = param.minimumCellArea * this.RBCArea - MaxDarkStainRatio: float + member this.InfectionArea = param.infectionArea * this.RBCArea + member this.StainArea = param.stainArea * this.RBCArea - minimumCellArea: int - maxOffcenter: float -} \ No newline at end of file + member this.Copy () = + this.MemberwiseClone() :?> Config