GUI (work in progress..)
[master-thesis.git] / Parasitemia / Parasitemia / Config.fs
1 module Config
2
3 open System
4
5 open Const
6
7 type Debug =
8 | DebugOff
9 | DebugOn of string // Output directory.
10
11 type Parameters = {
12 initialAreaOpen: int
13
14 minRbcRadius: float32
15 maxRbcRadius: float32
16
17 preFilterSigma: float
18
19 // Ellipse.
20 factorNbPick: float
21
22 // Parasites detection.
23 darkStainLevel: float // Lower -> more sensitive. Careful about illumination on the borders.
24 maxDarkStainRatio: float
25
26 stainArea: float32 // Factor of a RBC area. 0.5 means the half of RBC area.
27 stainLevel: float // > 1
28 maxStainRatio: float // [0, 1]
29
30 infectionArea: float32 // Factor of a RBC area. 0.5 means the half of RBC area.
31 infectionLevel: float // > 1
32
33 standardDeviationMaxRatio: float // The standard deviation of the pixel values of a cell can't be greater than standardDeviationMaxRatio * global standard deviation
34 minimumCellArea: float32 // Factor of the nominal RBC area.
35 }
36
37 type Config (param: Parameters) =
38 member this.Parameters = param
39 member val Debug = DebugOff with get, set
40 member val RBCRadius = 30.f with get, set
41
42 member this.RBCMinRadius = this.RBCRadius + param.minRbcRadius * this.RBCRadius
43 member this.RBCMaxRadius = this.RBCRadius + param.maxRbcRadius * this.RBCRadius
44
45 member this.RBCArea = PI * this.RBCRadius ** 2.f
46 member this.RBCMinArea = param.minimumCellArea * this.RBCArea
47
48 member this.InfectionArea = param.infectionArea * this.RBCArea
49 member this.StainArea = param.stainArea * this.RBCArea
50
51 member this.Copy () =
52 this.MemberwiseClone() :?> Config