using System;
namespace itk.simple.examples {
m_ProcessObject = po;
}
public override void Execute() {
Console.WriteLine("{0} Progress: {1:0.00}", m_ProcessObject.GetName(), m_ProcessObject.GetProgress() );
}
}
class FilterProgressReporting {
static void Main(string[] args) {
try {
if (args.Length < 3) {
Console.WriteLine("Usage: {0} <input> <variance> <output>", args[0]);
return;
}
ImageFileReader reader = new ImageFileReader();
reader.SetFileName(args[0]);
Image image = reader.Execute();
DiscreteGaussianImageFilter filter = new DiscreteGaussianImageFilter();
filter.SetVariance(Double.Parse(args[1]));
MyCommand cmd = new MyCommand(filter);
filter.AddCommand(
EventEnum.sitkProgressEvent, cmd);
image = filter.Execute(image);
ImageFileWriter writer = new ImageFileWriter();
writer.SetFileName(args[2]);
writer.Execute(image);
} catch (Exception ex) {
Console.WriteLine(ex);
}
}
}
}