Add some information in the GUI to see the possible command arguments.
<Private>True</Private>
</Reference>
<Reference Include="FSharp.Core">
- <HintPath>..\packages\FSharp.Core.4.2.1\lib\net45\FSharp.Core.dll</HintPath>
+ <HintPath>..\packages\FSharp.Core.4.2.3\lib\net45\FSharp.Core.dll</HintPath>
</Reference>
<Reference Include="MathNet.Numerics">
- <HintPath>..\packages\MathNet.Numerics.3.19.0\lib\net40\MathNet.Numerics.dll</HintPath>
+ <HintPath>..\packages\MathNet.Numerics.3.20.0\lib\net40\MathNet.Numerics.dll</HintPath>
</Reference>
<Reference Include="MathNet.Numerics.FSharp">
- <HintPath>..\packages\MathNet.Numerics.FSharp.3.19.0\lib\net40\MathNet.Numerics.FSharp.dll</HintPath>
+ <HintPath>..\packages\MathNet.Numerics.FSharp.3.20.0\lib\net40\MathNet.Numerics.FSharp.dll</HintPath>
</Reference>
<Reference Include="mscorlib" />
<Reference Include="OpenTK">
<Reference Include="System.Drawing" />
<Reference Include="System.Numerics" />
<Reference Include="System.ValueTuple">
- <HintPath>..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
+ <HintPath>..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<packages>
<package id="EmguCV" version="3.1.0.1" targetFramework="net452" />
<package id="FSharp.Collections.ParallelSeq" version="1.0.2" targetFramework="net452" />
- <package id="FSharp.Core" version="4.2.1" targetFramework="net452" />
- <package id="MathNet.Numerics" version="3.19.0" targetFramework="net452" />
- <package id="MathNet.Numerics.FSharp" version="3.19.0" targetFramework="net452" />
+ <package id="FSharp.Core" version="4.2.3" targetFramework="net452" />
+ <package id="MathNet.Numerics" version="3.20.0" targetFramework="net452" />
+ <package id="MathNet.Numerics.FSharp" version="3.20.0" targetFramework="net452" />
<package id="OpenTK" version="2.0.0" targetFramework="net452" />
<package id="OpenTK.GLControl" version="1.1.2349.61993" targetFramework="net452" />
- <package id="System.ValueTuple" version="4.3.1" targetFramework="net452" />
+ <package id="System.ValueTuple" version="4.4.0" targetFramework="net452" />
<package id="ZedGraph" version="5.1.7" targetFramework="net452" />
</packages>
\ No newline at end of file
--- /dev/null
+module ParasitemiaUI.CommandLineArguments
+
+open System
+open System.Windows
+open System.Windows.Controls
+open System.Diagnostics
+
+let showWindow (parent : Window) =
+ let win = Views.CommandLineArgumentsWindow ()
+ win.Owner <- parent
+
+ win.Left <- (if parent.WindowState = WindowState.Maximized then 0. else parent.Left) + parent.ActualWidth / 2. - win.Width / 2.
+ win.Top <- (if parent.WindowState = WindowState.Maximized then 0. else parent.Top) + parent.ActualHeight / 2. - win.Height / 2.
+
+ win.txtCommandLineArguments.Text <- Utils.argsHelp
+
+ win.butClose.Click.AddHandler (fun obj args -> win.Close ())
+
+ win.ShowDialog () |> ignore
+
win.menuAbout.Click.AddHandler (fun obj args -> About.showWindow win)
+ win.menuCommandLineArguments.Click.AddHandler (fun obj args -> CommandLineArguments.showWindow win)
+
win.Closing.AddHandler (fun obj args -> askSaveCurrent ())
// Zoom on the current image.
<Compile Include="XAML\PPICalculatorWindow.xaml.fs" />
<Resource Include="XAML\AnalysisWindow.xaml" />
<Compile Include="XAML\AnalysisWindow.xaml.fs" />
+ <Resource Include="XAML\CommandLineArgumentsWindow.xaml" />
+ <Compile Include="XAML\CommandLineArgumentsWindow.xaml.fs" />
<Resource Include="XAML\AboutWindow.xaml" />
<Compile Include="XAML\AboutWindow.xaml.fs" />
<Resource Include="XAML\MainWindow.xaml" />
<Compile Include="Export.fs" />
<Compile Include="DPICalculator.fs" />
<Compile Include="Analysis.fs" />
+ <Compile Include="CommandLineArguments.fs" />
<Compile Include="About.fs" />
<Compile Include="GUI.fs" />
<None Include="App.config" />
<HintPath>..\packages\EmguCV.3.1.0.1\lib\net30\Emgu.CV.World.dll</HintPath>
</Reference>
<Reference Include="FSharp.Core">
- <HintPath>..\packages\FSharp.Core.4.2.1\lib\net45\FSharp.Core.dll</HintPath>
+ <HintPath>..\packages\FSharp.Core.4.2.3\lib\net45\FSharp.Core.dll</HintPath>
</Reference>
<Reference Include="FSharp.ViewModule">
<HintPath>..\packages\FSharp.ViewModule.Core.1.0.7.0\lib\portable-net45+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1\FSharp.ViewModule.dll</HintPath>
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.Numerics" />
<Reference Include="System.ValueTuple">
- <HintPath>..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
+ <HintPath>..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Windows.Interactivity">
| CmdLine of Input * string // A file or a directory to process and the output directory.
| Window of string option // An optional path to a file to open can be given in window mode.
-type Arguments = RunningMode * bool
+type Arguments = RunningMode * bool // bool : true if in debug mode.
let parseArgs (args : string[]) : Arguments =
runningMode, Array.exists ((=) "--debug") args
let showArgsHelp () =
- printfn "Usage of Parasitemia :"
- printfn "Non-interactive mode:"
- printfn " %s (--folder <folder>|--file <file>) --output <folder> [--debug]" System.AppDomain.CurrentDomain.FriendlyName
- printfn " --folder <folder> : an input folder containing images to analyze"
- printfn " --file <file> : an image file to be analyzed"
- printfn " --output <folder> : a folder to put the results"
- printfn " --debug : output more information like intermediate images if set"
-
- printfn "Interactive mode:"
- printfn " %s [<document-file>] [--debug]" System.AppDomain.CurrentDomain.FriendlyName
- printfn " <document-file> : a PIAZ file to automatically open at startup"
- printfn " --debug : output information like intermediate images if set in the current directory"
+ Console.WriteLine Utils.argsHelp
[<System.Runtime.InteropServices.DllImport "kernel32.dll">]
extern bool AttachConsole (int dwProcessId)
use resultFile = new StreamWriter (new FileStream (Path.Combine (output, "results.txt"), FileMode.Append, FileAccess.Write))
- let images = [ for file in files -> Path.GetFileNameWithoutExtension (FileInfo(file).Name), config.Copy(), new Image<Bgr, byte> (file) ]
+ let images = [ for file in files -> Path.GetFileNameWithoutExtension (FileInfo(file).Name), config.Copy (), new Image<Bgr, byte> (file) ]
Log.LogWithTime Severity.INFO (
fun () ->
Some ()
) "Whole analyze" |> ignore
- Log.RmListener (listener)
+ Log.RmListener listener
0
| Window fileToOpen ->
| _ex ->
saveSensorSizesToFile defaultSensorSizes
defaultSensorSizes
+
+let argsHelp =
+ let programName = System.AppDomain.CurrentDomain.FriendlyName
+ "Usage of Parasitemia:\n" +
+ "Non-interactive mode:\n" +
+ (sprintf " %s (--folder <folder>|--file <file>) --output <folder> [--debug]\n" programName) +
+ " --folder <folder> : an input folder containing images to analyze\n" +
+ " --file <file> : an image file to be analyzed\n" +
+ " --output <folder> : a folder to put the results\n" +
+ " --debug : output more information like intermediate images (it takes more CPU and memory)\n" +
+
+ "Interactive mode:\n" +
+ (sprintf " %s [<document-file>] [--debug]\n" programName) +
+ " <document-file> : a PIAZ file to automatically open at startup\n" +
+ " --debug : output information like intermediate images in the current directory (it takes more CPU and memory)"
\ No newline at end of file
--- /dev/null
+<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ mc:Ignorable="d"
+ x:Name="CommandLineArgumentsWindow" Height="420" Width="620" Title="Command Line Arguments" Icon="pack://application:,,,/Resources/icon.ico" ResizeMode="CanResizeWithGrip">
+ <Grid Margin="3">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="*"/>
+ <RowDefinition Height="Auto"/>
+ </Grid.RowDefinitions>
+ <TextBlock Margin="3">Parasitemia can be launched via a command line, here are the possible arguments</TextBlock>
+ <TextBox x:Name="txtCommandLineArguments" Margin="6" Grid.Row="1" TextWrapping="Wrap" FontFamily="Courier New" FontSize="11" IsReadOnly="True" />
+ <Button x:Name="butClose" Content="Close" HorizontalAlignment="Right" Margin="3" VerticalAlignment="Bottom" Width="75" Grid.Row="2" Height="20"/>
+ </Grid>
+</Window>
\ No newline at end of file
--- /dev/null
+namespace ParasitemiaUI.Views
+
+open FsXaml
+
+type CommandLineArgumentsWindow = XAML<"XAML/CommandLineArgumentsWindow.xaml">
+
<MenuItem x:Name="menuHightlightRBC" Header="_Highlight All Erythrocytes" IsCheckable="True" InputGestureText="Ctrl+H" />
</MenuItem>
<MenuItem x:Name="menuHelp" Header="_Help">
+ <MenuItem x:Name="menuCommandLineArguments" Header="_Command Line Arguments" />
<MenuItem x:Name="menuAbout" Header="_About" />
</MenuItem>
</Menu>
<packages>
<package id="EmguCV" version="3.1.0.1" targetFramework="net452" />
<package id="Expression.Blend.Sdk" version="1.0.2" targetFramework="net46" />
- <package id="FSharp.Core" version="4.2.1" targetFramework="net452" />
+ <package id="FSharp.Core" version="4.2.3" targetFramework="net452" />
<package id="FSharp.ViewModule.Core" version="1.0.7.0" targetFramework="net462" />
<package id="FsXaml.Wpf" version="3.1.6" targetFramework="net462" />
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net452" />
<package id="OpenTK" version="2.0.0" targetFramework="net452" />
<package id="OpenTK.GLControl" version="1.1.2349.61993" targetFramework="net452" />
- <package id="System.ValueTuple" version="4.3.1" targetFramework="net452" />
+ <package id="System.ValueTuple" version="4.4.0" targetFramework="net452" />
<package id="ZedGraph" version="5.1.7" targetFramework="net452" />
</packages>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="..\..\packages\xunit.runner.visualstudio.2.2.0\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\..\packages\xunit.runner.visualstudio.2.2.0\build\net20\xunit.runner.visualstudio.props')" />
+ <Import Project="..\..\packages\xunit.runner.visualstudio.2.3.0\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\..\packages\xunit.runner.visualstudio.2.3.0\build\net20\xunit.runner.visualstudio.props')" />
+ <Import Project="..\..\packages\xunit.core.2.3.0\build\xunit.core.props" Condition="Exists('..\..\packages\xunit.core.2.3.0\build\xunit.core.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
</ItemGroup>
<ItemGroup>
<Reference Include="FSharp.Core">
- <HintPath>..\..\packages\FSharp.Core.4.2.1\lib\net45\FSharp.Core.dll</HintPath>
+ <HintPath>..\..\packages\FSharp.Core.4.2.3\lib\net45\FSharp.Core.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.ValueTuple">
- <HintPath>..\..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
+ <HintPath>..\..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="xunit.abstractions">
<HintPath>..\..\packages\xunit.abstractions.2.0.1\lib\net35\xunit.abstractions.dll</HintPath>
</Reference>
<Reference Include="xunit.assert">
- <HintPath>..\..\packages\xunit.assert.2.2.0\lib\netstandard1.1\xunit.assert.dll</HintPath>
+ <HintPath>..\..\packages\xunit.assert.2.3.0\lib\netstandard1.1\xunit.assert.dll</HintPath>
</Reference>
<Reference Include="xunit.core">
- <HintPath>..\..\packages\xunit.extensibility.core.2.2.0\lib\netstandard1.1\xunit.core.dll</HintPath>
+ <HintPath>..\..\packages\xunit.extensibility.core.2.3.0\lib\netstandard1.1\xunit.core.dll</HintPath>
</Reference>
<Reference Include="xunit.execution.desktop">
- <HintPath>..\..\packages\xunit.extensibility.execution.2.2.0\lib\net452\xunit.execution.desktop.dll</HintPath>
+ <HintPath>..\..\packages\xunit.extensibility.execution.2.3.0\lib\net452\xunit.execution.desktop.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
- <Error Condition="!Exists('..\..\packages\xunit.runner.visualstudio.2.2.0\build\net20\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\xunit.runner.visualstudio.2.2.0\build\net20\xunit.runner.visualstudio.props'))" />
+ <Error Condition="!Exists('..\..\packages\xunit.core.2.3.0\build\xunit.core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\xunit.core.2.3.0\build\xunit.core.props'))" />
+ <Error Condition="!Exists('..\..\packages\xunit.core.2.3.0\build\xunit.core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\xunit.core.2.3.0\build\xunit.core.targets'))" />
+ <Error Condition="!Exists('..\..\packages\xunit.runner.visualstudio.2.3.0\build\net20\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\xunit.runner.visualstudio.2.3.0\build\net20\xunit.runner.visualstudio.props'))" />
</Target>
+ <Import Project="..\..\packages\xunit.core.2.3.0\build\xunit.core.targets" Condition="Exists('..\..\packages\xunit.core.2.3.0\build\xunit.core.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="FSharp.Core" version="4.2.1" targetFramework="net452" />
- <package id="System.ValueTuple" version="4.3.1" targetFramework="net452" />
- <package id="xunit" version="2.2.0" targetFramework="net452" />
+ <package id="FSharp.Core" version="4.2.3" targetFramework="net452" />
+ <package id="System.ValueTuple" version="4.4.0" targetFramework="net452" />
+ <package id="xunit" version="2.3.0" targetFramework="net452" />
<package id="xunit.abstractions" version="2.0.1" targetFramework="net452" />
- <package id="xunit.assert" version="2.2.0" targetFramework="net452" />
- <package id="xunit.core" version="2.2.0" targetFramework="net452" />
- <package id="xunit.extensibility.core" version="2.2.0" targetFramework="net452" />
- <package id="xunit.extensibility.execution" version="2.2.0" targetFramework="net452" />
- <package id="xunit.runner.visualstudio" version="2.2.0" targetFramework="net452" developmentDependency="true" />
+ <package id="xunit.analyzers" version="0.7.0" targetFramework="net452" />
+ <package id="xunit.assert" version="2.3.0" targetFramework="net452" />
+ <package id="xunit.core" version="2.3.0" targetFramework="net452" />
+ <package id="xunit.extensibility.core" version="2.3.0" targetFramework="net452" />
+ <package id="xunit.extensibility.execution" version="2.3.0" targetFramework="net452" />
+ <package id="xunit.runner.visualstudio" version="2.3.0" targetFramework="net452" developmentDependency="true" />
</packages>
\ No newline at end of file