X-Git-Url: http://git.euphorik.ch/?p=master-thesis.git;a=blobdiff_plain;f=Parasitemia%2FParasitemiaUI%2FSourceImage.fs;fp=Parasitemia%2FParasitemiaUI%2FSourceImage.fs;h=7b3de18ed1f15f7d238993daed6f104fa6eecdee;hp=2330227295a005c82a54f83d991d6a793c8ecc3c;hb=2f335ec0c462159ed9f424e3793b7af290404062;hpb=c3f9ff71e0f80120b1f5b3e84e028b02b8cb1541 diff --git a/Parasitemia/ParasitemiaUI/SourceImage.fs b/Parasitemia/ParasitemiaUI/SourceImage.fs index 2330227..7b3de18 100644 --- a/Parasitemia/ParasitemiaUI/SourceImage.fs +++ b/Parasitemia/ParasitemiaUI/SourceImage.fs @@ -25,16 +25,19 @@ type SourceImage (num : int, name : string, config : ParasitemiaCore.Config.Conf let infectedRBColor = Color.FromRgb (255uy, 0uy, 40uy) // Red with a bit of blue. let updateAverageRBCSize () = - averageRBCSize <- - rbcs - |> List.collect (fun rbc -> [ rbc.size.Width; rbc.size.Height ]) - |> List.average + if List.isEmpty rbcs |> not then + averageRBCSize <- + rbcs + |> List.collect (fun rbc -> [ rbc.size.Width; rbc.size.Height ]) + |> List.average do updateAverageRBCSize () member this.Num with get () = num and set value = num <- value + member this.RomanNum = Utils.toRomanNumber this.Num + member this.Name with get () = name and set value = name <- value member this.Config = config @@ -45,7 +48,9 @@ type SourceImage (num : int, name : string, config : ParasitemiaCore.Config.Conf member this.RBCs with get () = rbcs - and set value = rbcs <- value + and set value = + rbcs <- value + updateAverageRBCSize () member this.ImageParasitemia : int * int = List.length rbcs,