* Add the analysis window.
[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 // Area of the first initial opening to remove the central illumination of RBC.
13 ratioSecondAreaOpen: float32 // The area of the second opening is 'ratioSecondAreaOpen' * mean RBC area. It's applied only if greater than 'initialAreaOpen'.
14
15 minRbcRadius: float32 // Factor of the mean RBC radius.
16 maxRbcRadius: float32 // Factor of the mean RBC radius.
17
18 preFilterSigma: float // To remove the high frequency noise.
19
20 // Ellipse.
21 factorNbPick: float // The number of computed ellipse per edge pixel.
22
23 // Parasites detection.
24 darkStainLevel: float // Lower -> more sensitive. Careful about illumination on the borders.
25 maxDarkStainRatio: float // When a cell must own less than this ratio to be a RBC.
26
27 stainArea: float32 // Factor of a RBC area. 0.5 means the half of RBC area.
28 stainLevel: float // > 1
29 maxStainRatio: float // When a cell must own less than this ratio to be a RBC.
30
31 infectionArea: float32 // 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 minimumCellAreaFactor: float32 // Factor of the mean RBC area.
36 }
37
38 type Config (param: Parameters) =
39 member this.Parameters = param
40 member val Debug = DebugOff with get, set
41
42 // Mean RBC radius.
43 member val RBCRadius = 30.f with get, set
44
45 member this.RBCMinRadius = this.RBCRadius + param.minRbcRadius * this.RBCRadius
46 member this.RBCMaxRadius = this.RBCRadius + param.maxRbcRadius * this.RBCRadius
47
48 member this.RBCArea = PI * this.RBCRadius ** 2.f
49 member this.RBCMinArea = param.minimumCellAreaFactor * this.RBCArea
50
51 member this.InfectionArea = param.infectionArea * this.RBCArea
52 member this.StainArea = param.stainArea * this.RBCArea
53
54 member this.Copy () =
55 this.MemberwiseClone() :?> Config