To .NET 5 (lot of refactoring)
[master-thesis.git] / Parasitemia / ParasitemiaUI / PiaZ.fs
index 2220953..18e9d6a 100644 (file)
@@ -2,7 +2,6 @@
 module ParasitemiaUI.PiaZ
 
 open System
-open System.Windows
 open System.IO
 open System.IO.Compression
 
@@ -10,7 +9,6 @@ open Emgu.CV
 open Emgu.CV.Structure
 
 open Newtonsoft.Json
-open Newtonsoft.Json.Converters
 
 open Types
 
@@ -100,7 +98,8 @@ let updateDocumentData (fromVersion : int) (toVersion : int) (data : DocumentDat
 /// <summary>
 /// Load document from a give file path.
 /// </summary>
-/// <param name="filePath"></param>
+/// <param name="filePath">Path to the PiaZ file</param>
+/// <param name="defaultConfig"></param>
 /// <exception cref="System.IOException">If the file cannot be read</exception>
 let load (filePath : string) (defaultConfig : ParasitemiaCore.Config.Config) : DocumentData =
     use file = ZipFile.Open (filePath, ZipArchiveMode.Read)
@@ -118,7 +117,7 @@ let load (filePath : string) (defaultConfig : ParasitemiaCore.Config.Config) : D
                     for imgEntry in file.Entries do
                         if imgEntry.Name.EndsWith (imageExtension) then
                             use bitmap = new System.Drawing.Bitmap (imgEntry.Open (), false)
-                            let img = new Image<Bgr, byte> (bitmap)
+                            let img = bitmap.ToImage<Bgr, byte> ()
                             imgNum <- imgNum + 1
                             let imgJSONEntry = file.GetEntry (imgEntry.Name + ".json")
                             use imgJSONFileReader = new StreamReader (imgJSONEntry.Open ())