GUI (work in progress..)
[master-thesis.git] / Parasitemia / Parasitemia / GUI / Pia.fs
index 9ddd063..432bad9 100644 (file)
@@ -1,5 +1,5 @@
 // ParasitemIA file format.
-module Pia
+module Parasitemia.GUI.Pia
 
 open System.Drawing
 open System.IO
@@ -10,31 +10,30 @@ open FSharp.Data
 open Emgu.CV
 open Emgu.CV.Structure
 
+open Types
+
 let extension = ".pia"
 let filter = "PIA|*.pia"
 
-type RBC = {
-    infected: bool
-    addedManually: bool
-    removed: bool
-
-    center: Point
-    size: Size
-    stainArea: int }
-
-type ImageSource = {
-    img: Image<Bgr, byte>
-    rbcs: RBC list }
-
 type FileData = {
-    sources: ImageSource list
+    sources: SourceImage list
     patientID: string }
 
 // The json type associated to a source image.
 type JSONSourceImage = JsonProvider<"""
     {
         "rbcs": [
-            { "infected": true, "addedManually": false, "removed": false, "posX" : 42, "posY" : 42, "width" : 10, "height" : 10, "stainArea" : 10 }
+            {
+                "num": 1,
+                "infected": true,
+                "addedManually": false,
+                "removed": false,
+                "posX" : 42,
+                "posY" : 42,
+                "width" : 10,
+                "height" : 10,
+                "stainArea" : 10
+            }
         ]
     }
 """>