22 print(
'Usage: ' + sys.argv[0] +
' <InputFileName>')
24 imageFileName = sys.argv[1]
28 ImageType =
itk.Image[PixelType, Dimension]
30 reader = vtk.vtkPNGReader()
31 reader.SetFileName(imageFileName)
32 reader.SetDataScalarTypeToUnsignedChar()
34 magnitude = vtk.vtkImageMagnitude()
35 magnitude.SetInputConnection(reader.GetOutputPort())
39 vtkToItkFilter.SetInput(magnitude.GetOutput())
41 vtkToItkFilter.Update()
42 myitkImage = vtkToItkFilter.GetOutput()