26 print(
'Usage: ' + sys.argv[0] +
' <InputFileName>')
28 imageFileName = sys.argv[1]
31 PixelComponentType = itk.UC
33 ImageType =
itk.Image[PixelType, Dimension]
35 reader = vtk.vtkPNGReader()
36 reader.SetFileName(imageFileName)
37 reader.SetDataScalarTypeToUnsignedChar()
40 vtkToItkFilter.SetInput(reader.GetOutput())
43 vtkToItkFilter.Update()
44 myitkImage = vtkToItkFilter.GetOutput()