projects
/
master-thesis.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a status bar.
[master-thesis.git]
/
Parasitemia
/
ParasitemiaUI
/
State.fs
diff --git
a/Parasitemia/ParasitemiaUI/State.fs
b/Parasitemia/ParasitemiaUI/State.fs
index
5b89810
..
f133640
100644
(file)
--- a/
Parasitemia/ParasitemiaUI/State.fs
+++ b/
Parasitemia/ParasitemiaUI/State.fs
@@
-30,6
+30,10
@@
type State () =
List.length srcImg.rbcs,
srcImg.rbcs |> List.fold (fun nbInfected rbc -> if rbc.infected then nbInfected + 1 else nbInfected) 0
List.length srcImg.rbcs,
srcImg.rbcs |> List.fold (fun nbInfected rbc -> if rbc.infected then nbInfected + 1 else nbInfected) 0
+ member this.ImageNbAltered (srcImg: SourceImage) : int * int =
+ List.length srcImg.rbcs,
+ srcImg.rbcs |> List.fold (fun nbAltered rbc -> if rbc.setManually then nbAltered + 1 else nbAltered) 0
+
member this.GlobalParasitemia : int * int =
sourceImages
|> Seq.fold (fun (nbTotal, nbTotalInfected) srcImg ->
member this.GlobalParasitemia : int * int =
sourceImages
|> Seq.fold (fun (nbTotal, nbTotalInfected) srcImg ->
@@
-56,16
+60,18
@@
type State () =
/// <summary>
/// Load the current state. 'FilePath' must have been defined.
/// </summary>
/// <summary>
/// Load the current state. 'FilePath' must have been defined.
/// </summary>
- /// <exception cref="System.IOException">If the file cannot be l
ao
ded</exception>
+ /// <exception cref="System.IOException">If the file cannot be l
oa
ded</exception>
member this.Load () =
let data = PiaZ.load this.FilePath
this.PatientID <- data.patientID
sourceImages.Clear()
sourceImages.InsertRange(0, data.images)
member this.Load () =
let data = PiaZ.load this.FilePath
this.PatientID <- data.patientID
sourceImages.Clear()
sourceImages.InsertRange(0, data.images)
- if sourceImages.Count > 0
- then this.CurrentImage <- Some sourceImages.[0]
+ this.CurrentImage <- if sourceImages.Count > 0 then Some sourceImages.[0] else None
alteredSinceLastSave <- false
alteredSinceLastSave <- false
+ /// <summary>
+ /// </summary>
+ /// <exception cref="System.IOException">If the image cannot be read</exception>
member this.AddSourceImage (filePath: string) (defaultConfig: ParasitemiaCore.Config.Config) : SourceImage =
let srcImg = { num = sourceImages.Count + 1; config = defaultConfig.Copy(); dateLastAnalysis = DateTime(0L); rbcs = []; img = new Image<Bgr, byte>(filePath) }
sourceImages.Add(srcImg)
member this.AddSourceImage (filePath: string) (defaultConfig: ParasitemiaCore.Config.Config) : SourceImage =
let srcImg = { num = sourceImages.Count + 1; config = defaultConfig.Copy(); dateLastAnalysis = DateTime(0L); rbcs = []; img = new Image<Bgr, byte>(filePath) }
sourceImages.Add(srcImg)