22 print(
'Usage: ' + sys.argv[0] +
' <InputFileName>')
24 imageFileName = sys.argv[1]
27 PixelComponentType = itk.UC
29 ImageType =
itk.Image[PixelType, Dimension]
31 reader = vtk.vtkPNGReader()
32 reader.SetFileName(imageFileName)
33 reader.SetDataScalarTypeToUnsignedChar()
36 vtkToItkFilter.SetInput(reader.GetOutput())
39 vtkToItkFilter.Update()
40 myitkImage = vtkToItkFilter.GetOutput()