From: Greg Burri Date: Tue, 26 Jan 2016 23:28:56 +0000 (+0100) Subject: * Modify a bit the parasite nucleus detection sensibility. X-Git-Tag: 1.0.11~29 X-Git-Url: http://git.euphorik.ch/?a=commitdiff_plain;h=e588f9c954a54cb259b2c1f6f9e8d9dbd4639269;p=master-thesis.git * Modify a bit the parasite nucleus detection sensibility. * Add a setup. --- diff --git a/Parasitemia/ParasitemiaCore/Config.fs b/Parasitemia/ParasitemiaCore/Config.fs index 4b38483..9724d9c 100644 --- a/Parasitemia/ParasitemiaCore/Config.fs +++ b/Parasitemia/ParasitemiaCore/Config.fs @@ -66,9 +66,9 @@ let defaultParameters = { cytoplasmSensitivity = 0.96 nucleusAreaRatio = 0.01f // 1.0 % - infectionSensitivity = 0.9 + infectionSensitivity = 0.92 - standardDeviationMaxRatio = 0.5 + standardDeviationMaxRatio = 0.6 minimumCellAreaFactor = 0.4f } type RBCRadius (radius: float32, parameters: Parameters) = diff --git a/Parasitemia/ParasitemiaCore/MainAnalysis.fs b/Parasitemia/ParasitemiaCore/MainAnalysis.fs index 1d2ced3..926aeac 100644 --- a/Parasitemia/ParasitemiaCore/MainAnalysis.fs +++ b/Parasitemia/ParasitemiaCore/MainAnalysis.fs @@ -59,7 +59,7 @@ let doAnalysis (img: Image) (name: string) (config: Config) (reportPr use img_parasites = img_float.[2] // mergeChannelsWithProjection img_float config.Parameters.averageColor_Parasite config.Parameters.averageColor_RBC 255. use img_parasites_filtered = gaussianFilter img_parasites config.LPFStandardDeviationParasite - logWithName (sprintf "Nominal erytrocyte diameter: %A" config.RBCRadiusByResolution) + logWithName (sprintf "Nominal erythrocyte diameter: %A" config.RBCRadiusByResolution) let initialAreaOpening = int <| config.RBCRadiusByResolution.Area * config.Parameters.ratioAreaPaleCenter * 1.1f // We do an area opening a little larger to avoid to do a second one in the case the radius found is near the initial one. do! logTimeWithName "First area opening" (fun () -> areaOpenF img_RBC_filtered initialAreaOpening; report 10) @@ -70,7 +70,7 @@ let doAnalysis (img: Image) (name: string) (config: Config) (reportPr let! radius = logTimeWithName "Granulometry (area)" (fun() -> reportWithVal 10 (Granulometry.findRadiusByAreaClosing img_RBC_filtered range |> float32)) config.SetRBCRadius <| radius - logWithName (sprintf "Found erytrocyte diameter: %A" config.RBCRadius) + logWithName (sprintf "Found erythrocyte diameter: %A" config.RBCRadius) do! report 20 diff --git a/Parasitemia/ParasitemiaCore/MatchingEllipses.fs b/Parasitemia/ParasitemiaCore/MatchingEllipses.fs index 3ed8ad6..bfa042b 100644 --- a/Parasitemia/ParasitemiaCore/MatchingEllipses.fs +++ b/Parasitemia/ParasitemiaCore/MatchingEllipses.fs @@ -10,10 +10,10 @@ open Types open Utils // All ellipses with a score below this are removed. -let matchingScoreThreshold = 0.4f +let matchingScoreThresholdPerRadiusUnit = 0.02f // For a radius of 1. let matchingScorePower = 20.f let windowSizeRadiusFactor = 1.f / 2.f -let minimumDistanceFromCenterRadiusFactor = 1.f / 3.f +let minimumDistanceFromCenterRadiusFactor = 1.f / 3.f // 1.f / 3.f type private EllipseScoreFlaggedKd (matchingScore: float32, e: Ellipse) = let mutable matchingScore = matchingScore @@ -72,6 +72,7 @@ type MatchingEllipses (radius: float32) = | _ -> () // 3) Remove ellipses whose center is near the center of another ellipse with a better score. + let matchingScoreThreshold = matchingScoreThresholdPerRadiusUnit * radius for e in ellipses do if e.MatchingScore < matchingScoreThreshold then diff --git a/Parasitemia/ParasitemiaUI/About.fs b/Parasitemia/ParasitemiaUI/About.fs index 5f1be66..44dd881 100644 --- a/Parasitemia/ParasitemiaUI/About.fs +++ b/Parasitemia/ParasitemiaUI/About.fs @@ -19,10 +19,22 @@ let showWindow (parent: Window) = let butClose: Button = ctrl "butClose" let txtAbout: TextBlock = ctrl "txtAbout" + let linkHESSO: Documents.Hyperlink = ctrl "linkHESSO" + let linkCHUV: Documents.Hyperlink = ctrl "linkCHUV" + let linkGBurri: Documents.Hyperlink = ctrl "linkGBurri" + let version = System.Reflection.Assembly.GetEntryAssembly().GetName().Version let txtVersion = sprintf " %d.%d.%d" version.Major version.Minor version.Revision txtAbout.Inlines.FirstInline.ElementEnd.InsertTextInRun(txtVersion) + let navigateTo = Navigation.RequestNavigateEventHandler(fun obj args -> + Process.Start(ProcessStartInfo(args.Uri.AbsoluteUri)) |> ignore + args.Handled <- true) + + linkHESSO.RequestNavigate.AddHandler(navigateTo); + linkCHUV.RequestNavigate.AddHandler(navigateTo); + linkGBurri.RequestNavigate.AddHandler(navigateTo); + #if DEBUG txtAbout.Inlines.FirstInline.ElementEnd.InsertTextInRun(" - DEBUG") #endif diff --git a/Parasitemia/ParasitemiaUI/GUI.fs b/Parasitemia/ParasitemiaUI/GUI.fs index f67c613..3746461 100644 --- a/Parasitemia/ParasitemiaUI/GUI.fs +++ b/Parasitemia/ParasitemiaUI/GUI.fs @@ -165,7 +165,7 @@ let run (defaultConfig: Config) (fileToOpen: string option) = then txtGlobalParasitemia.Inlines.Add( Documents.Run( - sprintf " Warning: the number of erytrocytes should be above %d" warningBelowNumberOfRBC, + sprintf " Warning: the number of erythrocytes should be above %d" warningBelowNumberOfRBC, FontWeight = FontWeights.Bold, Foreground = Brushes.Red)) diff --git a/Parasitemia/ParasitemiaUI/XAML/AboutWindow.xaml b/Parasitemia/ParasitemiaUI/XAML/AboutWindow.xaml index e35d234..d08f4c4 100644 --- a/Parasitemia/ParasitemiaUI/XAML/AboutWindow.xaml +++ b/Parasitemia/ParasitemiaUI/XAML/AboutWindow.xaml @@ -4,20 +4,20 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Name="AboutWindow" Height="220" Width="280" MinHeight="220" MinWidth="280" Title="About" Icon="pack://application:,,,/Resources/icon.ico" ResizeMode="NoResize"> - + - - Parasitemia + + Parasitemia - HES-SO / - CHUV + HES-SO / + CHUV - Grégory Burri + Grégory Burri