GUI (work in progress..)
[master-thesis.git] / Parasitemia / Parasitemia / GUI / State.fs
index a4a1773..b35b331 100644 (file)
@@ -1,9 +1,15 @@
-module State
+module Parasitemia.GUI.State
 
 open System.Collections.Generic
 
+open Emgu.CV
+open Emgu.CV.Structure
+
+open Types
+
 type State () =
-    let cells = List<Types.Cell>()
+    let sourceImages = List<SourceImage>()
+    let mutable currentImage = -1
 
     member val FilePath: string = "" with get, set
     member val PatientID: string = "" with get, set
@@ -14,4 +20,19 @@ type State () =
 
     member this.Load () =
         let data = Pia.load this.FilePath
-        this.PatientID <- data.patientID
\ No newline at end of file
+        this.PatientID <- data.patientID
+
+    member this.AddSourceImage (filePath: string) : SourceImage =
+        let srcImg = { num = sourceImages.Count + 1; rbcs = []; img = new Image<Bgr, byte>(filePath) }
+        sourceImages.Add(srcImg)
+        if sourceImages.Count = 1
+        then
+            currentImage <- 1
+        srcImg
+
+    member x.SourceImages : SourceImage seq =
+        sourceImages :> SourceImage seq
+
+    member this.Reset () =
+        this.PatientID <- ""
+        sourceImages.Clear()
\ No newline at end of file