20 parser = argparse.ArgumentParser(description=
"Set Pixel Value In One Image.")
21 parser.add_argument(
"output_image")
22 args = parser.parse_args()
28 ImageType =
itk.Image[PixelType, Dimension]
35 region.SetIndex(start)
43 image = ImageType.New()
44 image.SetRegions(region)
54 image.SetPixel(pixelIndex, 128)
57 pixelIndex[1] = 200 - 4 * r
59 image.SetPixel(pixelIndex, 255)
63 pixelIndex[1] = 200 + 4 * r
65 image.SetPixel(pixelIndex, 128)
70 image.SetPixel(pixelIndex, 180)
75 image.SetPixel(pixelIndex, 200)
80 image.SetPixel(pixelIndex, 200)
85 image.SetPixel(pixelIndex, 200)
90 image.SetPixel(pixelIndex, 200)
95 image.SetPixel(pixelIndex, 200)
97 itk.imwrite(image, args.output_image)