X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;f=Parasitemia%2FParasitemiaUI%2FTypes.fs;h=3a3cf564558273c79c04bd1c6afe92a79cff3f3f;hb=f4e3404aaa28beedc9040c0b924c3a8162472b43;hp=7d8029487095efe6ffc2f0e6d22ccf749fcc7e4f;hpb=4bfa3cbdc6145e6944f02e24829ab2ef3a851ac1;p=master-thesis.git diff --git a/Parasitemia/ParasitemiaUI/Types.fs b/Parasitemia/ParasitemiaUI/Types.fs index 7d80294..3a3cf56 100644 --- a/Parasitemia/ParasitemiaUI/Types.fs +++ b/Parasitemia/ParasitemiaUI/Types.fs @@ -2,23 +2,65 @@ open System open System.Windows +open System.Windows.Media open Emgu.CV open Emgu.CV.Structure -type RBC = { - num: int +open Newtonsoft.Json - mutable infected: bool - mutable setManually: bool +open ParasitemiaCore.UnitsOfMeasure + +type RBC = + { + num : int + + [] + mutable infected : bool + + [] + mutable setManually : bool + + center : Point + size : Size + infectedArea : int + } + +type PredefinedPPI = + { + ppi : int + label : string + } + with + override this.ToString () = + sprintf "%s: %d" this.label this.ppi + +type SensorSize = + { + w : float + h : float + label : string + } + with + override this.ToString () = + sprintf "%g mm × %g mm%s" this.w this.h (if this.label = "" then "" else " (" + this.label + ")") + +let defaultPredefinedPPI = + [ + { ppi = 230000; label = "50×" } + { ppi = 460000; label = "100×" } + ] + +let defaultSensorSizes = + [ + { w = 3.2; h = 2.4; label = "1/4″" } + { w = 4.8; h = 3.6; label = "1/3″" } + { w = 5.76; h = 4.29; label = "1/2.5″" } + { w = 6.4; h = 4.8; label = "1/2″" } + { w = 7.18; h = 5.32; label = "1/1.8″" } + { w = 7.6; h = 5.7; label = "1/1.7″" } + { w = 8.8; h = 6.6; label = "2/3″" } + { w = 13.2; h = 8.8; label = "1″" } + ] - center: Point - size: Size - infectedArea: int } -type SourceImage = { - mutable num: int - mutable config: ParasitemiaCore.Config.Config - mutable dateLastAnalysis: DateTime // UTC. - img: Image - mutable rbcs: RBC list } \ No newline at end of file