- let data = Pia.load this.FilePath
- this.PatientID <- data.patientID
\ No newline at end of file
+ let data = PiaZ.load this.FilePath
+ this.PatientID <- data.patientID
+ sourceImages.Clear()
+ sourceImages.InsertRange(0, data.sources)
+
+ member this.AddSourceImage (filePath: string) : SourceImage =
+ let srcImg = { num = sourceImages.Count + 1; rbcs = []; img = new Image<Bgr, byte>(filePath) }
+ sourceImages.Add(srcImg)
+ srcImg
+
+ member this.SetResult (num: int) (cells: Cell list) =
+ let sourceImage = sourceImages.Find(fun srcImg -> srcImg.num = num)
+ sourceImage.rbcs <- cells
+ |> List.filter (fun cell -> match cell.cellClass with HealthyRBC | InfectedRBC -> true | _ -> false )
+ |> List.mapi (fun i cell ->
+ { num = i
+ infected = cell.cellClass = InfectedRBC
+ setManually = false
+ center = Point(float cell.center.X, float cell.center.Y)
+ size = Size(float cell.elements.Width, float cell.elements.Height)
+ stainArea = cell.stainArea })
+
+ member this.SourceImages : SourceImage seq =
+ sourceImages :> SourceImage seq
+
+ member this.Reset () =
+ this.PatientID <- ""
+ sourceImages.Clear()
\ No newline at end of file