open Config
open Types
+let warningRatioDifferenceRBCDiameter = 1.2
+
/// <summary>
/// Analyze the given image and detect reb blood cell (RBC) in it.
/// </summary>
let! cells = logTimeWithName "Classifier" (fun () -> reportWithVal 100 (Classifier.findCells prunedEllipses parasites img.Width img.Height config))
+ do
+ if config.RBCRadiusByResolution.μm / config.RBCRadius.μm > warningRatioDifferenceRBCDiameter then
+ logWithName (sprintf "Warning: erythrocyte diameter found is too low compared to the nominal erythrocyte diameter, maybe the PPI image resolution is lesser than %.0f ppi" config.Parameters.resolution)
+ elif config.RBCRadius.μm / config.RBCRadiusByResolution.μm > warningRatioDifferenceRBCDiameter then
+ logWithName (sprintf "Warning: erythrocyte diameter found is too high compared to the nominal erythrocyte diameter, maybe the PPI image resolution is higher than %.0f" config.Parameters.resolution)
+
logWithName "Analysis finished"
do
IO.saveImg img_float.[0] (buildFileName " - source - blue.png")
| _ -> ()
- return
+ return
{
Cells = cells
RBCSize_μm = config.RBCRadius.μm
win.stackSourceImagesSelection.IsEnabled <- false
analysisPerformed <- false
win.butStart.IsEnabled <- false
+ win.textLog.Text <- ""
win.butClose.Content <- "Abort"
async {