X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=Parasitemia%2FParasitemiaCore%2FAnalysis.fs;fp=Parasitemia%2FParasitemiaCore%2FAnalysis.fs;h=ed908e27157ff257afa72db8ca5585b2db0d07b5;hb=f4e3404aaa28beedc9040c0b924c3a8162472b43;hp=19a92fef82e58ab72a1ad2449044c64986b3a861;hpb=d3f9cd7b16d25f49bd8d06394b0f1d4040809fbd;p=master-thesis.git diff --git a/Parasitemia/ParasitemiaCore/Analysis.fs b/Parasitemia/ParasitemiaCore/Analysis.fs index 19a92fe..ed908e2 100644 --- a/Parasitemia/ParasitemiaCore/Analysis.fs +++ b/Parasitemia/ParasitemiaCore/Analysis.fs @@ -17,6 +17,8 @@ open ImgTools open Config open Types +let warningRatioDifferenceRBCDiameter = 1.2 + /// /// Analyze the given image and detect reb blood cell (RBC) in it. /// @@ -104,6 +106,12 @@ let doAnalysis (img : Image) (name : string) (config : Config) (repor 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 @@ -153,7 +161,7 @@ let doAnalysis (img : Image) (name : string) (config : Config) (repor IO.saveImg img_float.[0] (buildFileName " - source - blue.png") | _ -> () - return + return { Cells = cells RBCSize_μm = config.RBCRadius.μm