import org.itk.simple.*;
super();
m_ProcessObject=po;
}
public void execute() {
double progress = m_ProcessObject.getProgress();
System.out.format("%s Progress: %f\n", m_ProcessObject.getName(), progress);
}
}
class FilterProgressReporting {
public static void main(String argv[]) {
if ( argv.length < 3 ) {
System.out.format("Usage: java %s <input> <variance> <output>", "FilterProgressReporting" );
System.exit(-1);
}
org.itk.simple.ImageFileReader reader = new org.itk.simple.ImageFileReader();
reader.setFileName(argv[0]);
Image img = reader.execute();
DiscreteGaussianImageFilter filter = new DiscreteGaussianImageFilter();
filter.setVariance(Double.valueOf( argv[1] ).doubleValue());
MyCommand cmd = new MyCommand(filter);
filter.addCommand(
EventEnum.sitkProgressEvent, cmd);
Image blurredImg = filter.execute(img);
CastImageFilter caster = new CastImageFilter();
caster.setOutputPixelType(img.getPixelID());
Image castImg = caster.execute(blurredImg);
ImageFileWriter writer = new ImageFileWriter();
writer.setFileName(argv[2]);
writer.execute(castImg);
}
}