21 parser = argparse.ArgumentParser(
22 description=
"Convert RBG vtk Image Data To An itk Image."
24 parser.add_argument(
"input_image")
25 args = parser.parse_args()
28 PixelComponentType = itk.UC
30 ImageType =
itk.Image[PixelType, Dimension]
32 reader = vtk.vtkPNGReader()
33 reader.SetFileName(args.input_image)
34 reader.SetDataScalarTypeToUnsignedChar()
37 vtkToItkFilter.SetInput(reader.GetOutput())
40 vtkToItkFilter.Update()
41 myitkImage = vtkToItkFilter.GetOutput()