21 """ Apply SimpleITK's SmoothGaussianImageFilter to an image. """
25 import SimpleITK
as sitk
29 """ Apply SimpleITK's SmoothGaussianImageFilter to an image. """
31 print(
"Usage: SimpleGaussian <input> <sigma> <output>")
35 reader.SetFileName(args[1])
36 input_image = reader.Execute()
38 pixelID = input_image.GetPixelID()
41 gaussian.SetSigma(float(args[2]))
42 blur_image = gaussian.Execute(input_image)
45 caster.SetOutputPixelType(pixelID)
46 blur_image = caster.Execute(blur_image)
49 writer.SetFileName(args[3])
50 writer.Execute(blur_image)
52 return_dict = {
"input_image": input_image,
"blur_image": blur_image}
57 if __name__ ==
"__main__":
58 in_image, out_image = main(sys.argv)
59 if "SITK_NOSHOW" not in os.environ: