26 print(
'Usage: ' + sys.argv[0] +
' <InputFileName>')
28 imageFileName = sys.argv[1]
32 ImageType =
itk.Image[PixelType, Dimension]
34 reader = vtk.vtkPNGReader()
35 reader.SetFileName(imageFileName)
36 reader.SetDataScalarTypeToUnsignedChar()
38 magnitude = vtk.vtkImageMagnitude()
39 magnitude.SetInputConnection(reader.GetOutputPort())
43 vtkToItkFilter.SetInput(magnitude.GetOutput())
45 vtkToItkFilter.Update()
46 myitkImage = vtkToItkFilter.GetOutput()