Add a way to detect the membrane of a parasite in the ring stage.
[master-thesis.git] / Parasitemia / ParasitemiaUI / PiaZ.fs
index 92397be..bdd6d07 100644 (file)
@@ -95,7 +95,7 @@ let updateDocumentData (fromVersion: int) (toVersion: int) (data: DocumentData)
 /// </summary>
 /// <param name="filePath"></param>
 /// <exception cref="System.IOException">If the file cannot be read</exception>
-let load (filePath: string) : DocumentData =
+let load (filePath: string) (defaultConfig: ParasitemiaCore.Config.Config) : DocumentData =
     use file = ZipFile.Open(filePath, ZipArchiveMode.Read)
 
     let mainEntry = file.GetEntry(mainEntryName)
@@ -114,7 +114,12 @@ let load (filePath: string) : DocumentData =
                             let imgJSONEntry = file.GetEntry(imgEntry.Name + ".json")
                             use imgJSONFileReader = new StreamReader(imgJSONEntry.Open())
                             let imgInfo = JsonConvert.DeserializeObject<JSONSourceImage>(imgJSONFileReader.ReadToEnd())
-                            let config = ParasitemiaCore.Config.Config(imgInfo.parameters)
+
+                            let config = defaultConfig.Copy()
+                            config.Parameters <-
+                                { ParasitemiaCore.Config.defaultParameters with
+                                    resolution = imgInfo.parameters.resolution }
+
                             config.SetRBCRadius imgInfo.RBCRadius
                             yield { num = imgNum
                                     name = imgInfo.name