* Add a setup.
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) =
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)
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
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
| _ -> ()
// 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
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
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))
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">
- <Grid>
+ <Grid Margin="3">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Image HorizontalAlignment="Left" Height="64" VerticalAlignment="Top" Width="64" Margin="6" Source="pack://application:,,,/Resources/icon.ico"/>
- <TextBlock x:Name="txtAbout" HorizontalAlignment="Left" Margin="6" Grid.Row="1" TextWrapping="Wrap">
- <Bold>Parasitemia </Bold>
+ <TextBlock x:Name="txtAbout" HorizontalAlignment="Left" Margin="20,6" Grid.Row="1" TextWrapping="Wrap">
+ <Bold FontSize="14.667">Parasitemia </Bold>
<LineBreak />
- <Hyperlink NavigateUri="http://www.hes-so.ch">HES-SO</Hyperlink> /
- <Hyperlink NavigateUri="http://www.chuv.ch/">CHUV</Hyperlink>
+ <Hyperlink x:Name="linkHESSO" NavigateUri="http://www.hes-so.ch" >HES-SO</Hyperlink> /
+ <Hyperlink x:Name="linkCHUV" NavigateUri="http://www.chuv.ch/" >CHUV</Hyperlink>
<LineBreak />
- Grégory Burri
+ <Hyperlink x:Name="linkGBurri" NavigateUri="mailto:greg.burri@gmail.com"> Grégory Burri</Hyperlink>
</TextBlock>
<Button x:Name="butClose" Content="Close" HorizontalAlignment="Right" Margin="3" VerticalAlignment="Bottom" Width="75" Grid.Row="2" Height="20"/>
</Grid>
<MenuItem x:Name="menuStartAnalysis" Header="_Show Analysis Window" />
</MenuItem>
<MenuItem x:Name="menuView" Header="_View">
- <MenuItem x:Name="menuHightlightRBC" Header="_Highlight All Erytrocytes" IsCheckable="True" />
+ <MenuItem x:Name="menuHightlightRBC" Header="_Highlight All Erythrocytes" IsCheckable="True" />
</MenuItem>
<MenuItem x:Name="menuHelp" Header="_Help">
<MenuItem x:Name="menuAbout" Header="_About" />
--- /dev/null
+[code]
+#define ApplicationDir ".."
+
+#define AppName "Parasitemia"
+#define ExePath ApplicationDir + "/ParasitemiaUI/bin/Release/ParasitemiaUI.exe"
+#define Version GetStringFileInfo(ExePath, 'ProductVersion')
+#define BuildTime GetStringFileInfo(ExePath, 'BuildTime')
+
+[Setup]
+AppName={#AppName}
+AppVersion={#Version}
+SetupIconFile={#ApplicationDir}/ParasitemiaUI/Resources/icon.ico
+DefaultDirName={pf}/{#AppName}
+DefaultGroupName={#AppName}
+UninstallDisplayIcon={app}/ParasitemiaUI.exe
+Compression=lzma2
+SolidCompression=yes
+OutputBaseFilename={#AppName}-{#Version}-Setup
+ChangesAssociations=yes
+
+[Files]
+Source: "{#ApplicationDir}/ParasitemiaUI/bin/Release/ParasitemiaUI.exe"; DestDir: "{app}"; Flags: comparetimestamp
+Source: "{#ApplicationDir}/ParasitemiaUI/bin/Release/Emgu.CV.dll"; DestDir: "{app}"; Flags: comparetimestamp
+Source: "{#ApplicationDir}/ParasitemiaUI/bin/Release/Emgu.Util.dll"; DestDir: "{app}"; Flags: comparetimestamp
+Source: "{#ApplicationDir}/ParasitemiaUI/bin/Release/FSharp.Collections.ParallelSeq.dll"; DestDir: "{app}"; Flags: comparetimestamp
+Source: "{#ApplicationDir}/ParasitemiaUI/bin/Release/FSharp.Core.dll"; DestDir: "{app}"; Flags: comparetimestamp
+Source: "{#ApplicationDir}/ParasitemiaUI/bin/Release/FSharp.ViewModule.dll"; DestDir: "{app}"; Flags: comparetimestamp
+Source: "{#ApplicationDir}/ParasitemiaUI/bin/Release/FsXaml.Wpf.dll"; DestDir: "{app}"; Flags: comparetimestamp
+Source: "{#ApplicationDir}/ParasitemiaUI/bin/Release/FsXaml.Wpf.TypeProvider.dll"; DestDir: "{app}"; Flags: comparetimestamp
+Source: "{#ApplicationDir}/ParasitemiaUI/bin/Release/Logger.dll"; DestDir: "{app}"; Flags: comparetimestamp
+Source: "{#ApplicationDir}/ParasitemiaUI/bin/Release/MathNet.Numerics.dll"; DestDir: "{app}"; Flags: comparetimestamp
+Source: "{#ApplicationDir}/ParasitemiaUI/bin/Release/Newtonsoft.Json.dll"; DestDir: "{app}"; Flags: comparetimestamp
+Source: "{#ApplicationDir}/ParasitemiaUI/bin/Release/ParasitemiaCore.dll"; DestDir: "{app}"; Flags: comparetimestamp
+Source: "{#ApplicationDir}/ParasitemiaUI/bin/Release/System.Windows.Interactivity.dll"; DestDir: "{app}"; Flags: comparetimestamp
+Source: "{#ApplicationDir}/ParasitemiaUI/bin/Release/WPF.dll"; DestDir: "{app}"; Flags: comparetimestamp
+Source: "{#ApplicationDir}/ParasitemiaUI/bin/Release/ParasitemiaUI.exe.config"; DestDir: "{app}"; Flags: comparetimestamp
+
+Source: "{#ApplicationDir}/ParasitemiaUI/bin/Release/x64/*"; DestDir: "{app}/x64"; Flags: comparetimestamp recursesubdirs
+
+[Icons]
+Name: "{group}\Parasitemia"; Filename: "{app}/ParasitemiaUI.exe"; WorkingDir: "{app}"
+
+[Tasks]
+Name: ParasitemiaFileAssociation; Description: "Use Parasitemia to open ""piaz"" files"; GroupDescription: File extensions:
+
+[Registry]
+Root: HKCR; Subkey: ".piaz"; ValueType: string; ValueName: ""; ValueData: "Parasitemia"; Flags: uninsdeletevalue; Tasks: ParasitemiaFileAssociation
+Root: HKCR; Subkey: "Parasitemia"; ValueType: string; ValueName: ""; ValueData: "Parasitemia Prog"; Flags: uninsdeletekey
+Root: HKCR; Subkey: "OptInvest\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\ParasitemiaUI.exe,0"
+
+[Run]
+Filename: "{app}/ParasitemiaUI.exe"; Flags: nowait postinstall runasoriginaluser; Description: "Launch Parasitemia"
\ No newline at end of file