Add the panel to display image source previews.
[master-thesis.git] / Parasitemia / Parasitemia / GUI / State.fs
index a4a1773..b5136c2 100644 (file)
@@ -2,8 +2,15 @@
 
 open System.Collections.Generic
 
+open Emgu.CV
+open Emgu.CV.Structure
+
+type ImageSource = {
+    cells: List<Types.Cell>
+    img: Image<Bgr, byte> }
+
 type State () =
-    let cells = List<Types.Cell>()
+    let imagesSource = List<ImageSource>()
 
     member val FilePath: string = "" with get, set
     member val PatientID: string = "" with get, set
@@ -14,4 +21,14 @@ 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) =
+        imagesSource.Add({ cells = List<Types.Cell>(); img = new Image<Bgr, byte>(filePath) })
+
+    member x.ImagesSource : ImageSource seq =
+        imagesSource :> ImageSource seq
+
+    member this.Reset () =
+        this.PatientID <- ""
+        imagesSource.Clear()
\ No newline at end of file