From: Greg Burri Date: Fri, 3 Nov 2017 20:22:26 +0000 (+0100) Subject: Merge branch 'master' of gburri.org:master-thesis X-Git-Tag: 1.0.13~17 X-Git-Url: http://git.euphorik.ch/index.cgi?a=commitdiff_plain;h=42d4db26f30bccbcc2e1b6d1f82a5b04a1f3dcd2;hp=-c;p=master-thesis.git Merge branch 'master' of gburri.org:master-thesis --- 42d4db26f30bccbcc2e1b6d1f82a5b04a1f3dcd2 diff --combined Parasitemia/ParasitemiaUI/Utils.fs index 7a30174,810494e..e7c9784 --- a/Parasitemia/ParasitemiaUI/Utils.fs +++ b/Parasitemia/ParasitemiaUI/Utils.fs @@@ -3,6 -3,7 +3,6 @@@ open System.IO open Newtonsoft.Json -open Newtonsoft.Json.Converters open Types @@@ -27,6 -28,7 +27,7 @@@ let sensorSizesFilepath = Path.Combine let private savePredefinedPPIToFile (predefinedPPI : PredefinedPPI list) = try + Directory.CreateDirectory roamingDir |> ignore use file = new StreamWriter (predefinedPPIFilepath) file.Write (JsonConvert.SerializeObject (predefinedPPI, JsonSerializerSettings (Formatting = Formatting.Indented))) with @@@ -35,6 -37,7 +36,7 @@@ let private saveSensorSizesToFile (sensorSizes : SensorSize list) = try + Directory.CreateDirectory roamingDir |> ignore use file = new StreamWriter (sensorSizesFilepath) file.Write (JsonConvert.SerializeObject (sensorSizes, JsonSerializerSettings (Formatting = Formatting.Indented))) with @@@ -46,7 -49,7 +48,7 @@@ let predefinedPPI : PredefinedPPI list use file = new StreamReader (predefinedPPIFilepath) JsonConvert.DeserializeObject (file.ReadToEnd ()) with - | ex -> + | _ex -> savePredefinedPPIToFile defaultPredefinedPPI defaultPredefinedPPI @@@ -55,6 -58,21 +57,21 @@@ let sensorSizes : SensorSize list use file = new StreamReader (sensorSizesFilepath) JsonConvert.DeserializeObject (file.ReadToEnd ()) with - | ex -> + | _ex -> saveSensorSizesToFile defaultSensorSizes defaultSensorSizes + + let argsHelp = + let programName = System.AppDomain.CurrentDomain.FriendlyName + "Usage of Parasitemia:\n" + + "Non-interactive mode:\n" + + (sprintf " %s (--folder |--file ) --output [--debug]\n" programName) + + " --folder : an input folder containing images to analyze\n" + + " --file : an image file to be analyzed\n" + + " --output : 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 [] [--debug]\n" programName) + + " : 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)"