5cf392c85b7e65c684c19a3c91071bf8857d3d43
[master-thesis.git] / Parasitemia / Parasitemia / Config.fs
1 module Config
2
3 open System
4
5 type Debug =
6 | DebugOff
7 | DebugOn of string // Output directory.
8
9 type Parameters = {
10 scale: float
11
12 minRbcRadius: float
13 maxRbcRadius: float
14
15 preFilterSigma: float
16
17 // Ellipse.
18 factorNbPick: float
19 factorWindowSize: float // factor of 'maxRBCSize'.
20
21 // Parasites detection.
22 darkStainLevel: float
23 maxDarkStainRatio: float
24
25 stainArea: float // Factor of a RBC area. 0.5 means the half of RBC area.
26 stainLevel: float // [0, 2]
27 maxStainRatio: float // [0, 1]
28
29 infectionArea: float // Factor of a RBC area. 0.5 means the half of RBC area.
30 infectionLevel: float // [0, 2]
31 parasitePixelsRequired: int
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: float // Factor of 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. 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 = Math.PI * this.RBCRadius ** 2.0
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