module ParasitemiaUI.PiaZ
open System
-open System.Windows
open System.IO
open System.IO.Compression
open Emgu.CV.Structure
open Newtonsoft.Json
-open Newtonsoft.Json.Converters
open Types
/// <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)
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 ())