module ParasitemiaUI.Types
-open System
open System.Windows
-open System.Windows.Media
-
-open Emgu.CV
-open Emgu.CV.Structure
open Newtonsoft.Json
open ParasitemiaCore.UnitsOfMeasure
-let healthyRBColor = Color.FromRgb (255uy, 255uy, 0uy) // Yellow-green.
-let infectedRBColor = Color.FromRgb (255uy, 0uy, 40uy) // Red with a bit of blue.
-
type RBC =
{
num : int
infectedArea : int
}
-type SourceImage =
- {
- mutable num : int
- mutable name : string
-
- mutable config : ParasitemiaCore.Config.Config
- mutable dateLastAnalysis : DateTime // UTC.
- img : Image<Bgr, byte>
- mutable rbcs : RBC list
-
- mutable healthyRBCBrightness : float32
- mutable infectedRBCBrightness : float32
- }
- with
- member this.HealthyRBCColor : SolidColorBrush =
- let mutable color = healthyRBColor * this.healthyRBCBrightness
- color.A <- 255uy
- SolidColorBrush (color)
-
- member this.InfectedRBCColor : SolidColorBrush =
- let mutable color = infectedRBColor * this.infectedRBCBrightness
- color.A <- 255uy
- SolidColorBrush (color)
-
type PredefinedPPI =
{
ppi : int<ppi>
label : string
}
- with
- override this.ToString () =
- sprintf "%s: %d" this.label this.ppi
+ override this.ToString () =
+ sprintf "%s: %d" this.label this.ppi
type SensorSize =
{
h : float<mm>
label : string
}
- with
- override this.ToString () =
- sprintf "%g mm × %g mm%s" this.w this.h (if this.label = "" then "" else " (" + this.label + ")")
+ override this.ToString () =
+ sprintf "%g mm × %g mm%s" this.w this.h (if this.label = "" then "" else " (" + this.label + ")")
let defaultPredefinedPPI =
[
{ w = 8.8<mm>; h = 6.6<mm>; label = "2/3″" }
{ w = 13.2<mm>; h = 8.8<mm>; label = "1″" }
]
-
-