7f841c4402140cca42737b4512ef34aabda5438a
[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 initialAreaOpen: int
13
14 minRbcRadius: float
15 maxRbcRadius: float
16
17 preFilterSigma: float
18
19 // Ellipse.
20 factorNbPick: float
21 factorWindowSize: float // factor of 'maxRBCSize'.
22
23 // Parasites detection.
24 darkStainLevel: float
25 maxDarkStainRatio: float
26
27 stainArea: float // Factor of a RBC area. 0.5 means the half of RBC area.
28 stainLevel: float // > 1
29 maxStainRatio: float // [0, 1]
30
31 infectionArea: float // Factor of a RBC area. 0.5 means the half of RBC area.
32 infectionLevel: float // > 1
33
34 standardDeviationMaxRatio: float // The standard deviation of the pixel values of a cell can't be greater than standardDeviationMaxRatio * global standard deviation
35 minimumCellArea: float // Factor of the nominal RBC area.
36 }
37
38 type Config (param: Parameters) =
39 member this.Parameters = param
40 member val Debug = DebugOff with get, set
41 member val RBCRadius = 30. with get, set
42
43 member this.RBCMinRadius = this.RBCRadius + param.minRbcRadius * this.RBCRadius
44 member this.RBCMaxRadius = this.RBCRadius + param.maxRbcRadius * this.RBCRadius
45
46 member this.RBCArea = Math.PI * this.RBCRadius ** 2.0
47 member this.RBCMinArea = param.minimumCellArea * this.RBCArea
48
49 member this.InfectionArea = param.infectionArea * this.RBCArea
50 member this.StainArea = param.stainArea * this.RBCArea