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 " --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 "Interactive mode:"
printfn " %s [<document-file>] [--debug]" System.AppDomain.CurrentDomain.FriendlyName
printfn "Interactive mode:"
printfn " %s [<document-file>] [--debug]" System.AppDomain.CurrentDomain.FriendlyName
// To redirect stdout to the attached console.
AttachConsole(-1) |> ignore // -1 to attach to the parent process.
// To redirect stdout to the attached console.
AttachConsole(-1) |> ignore // -1 to attach to the parent process.
config.Debug <- DebugOn output
Directory.CreateDirectory output |> ignore
use logFile = new StreamWriter(new FileStream(Path.Combine(output, "log.txt"), FileMode.Append, FileAccess.Write))
config.Debug <- DebugOn output
Directory.CreateDirectory output |> ignore
use logFile = new StreamWriter(new FileStream(Path.Combine(output, "log.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) ]
match ParasitemiaCore.Analysis.doMultipleAnalysis images None with
| Some results ->
for id, cells in results do
let config, img = images |> List.pick (fun (id', config', img') -> if id' = id then Some (config', img') else None)
img.Dispose()
let total, infected = countCells cells
match ParasitemiaCore.Analysis.doMultipleAnalysis images None with
| Some results ->
for id, cells in results do
let config, img = images |> List.pick (fun (id', config', img') -> if id' = id then Some (config', img') else None)
img.Dispose()
let total, infected = countCells cells