19 from InsightToolkit
import *
20 from numarray
import *
23 reader = itkImageFileReaderUC2_New()
25 connector = itkPyBufferUC2_New()
27 reader.SetFileName(argv[1])
31 print(
"ready to convert image into array")
33 buffer = connector.GetArrayFromImage(reader.GetOutput())
35 writer = itkImageFileWriterUC2_New()
37 writer.SetFileName(argv[2])
39 print(
"ready to convert array into image")
41 writer.SetInput(connector.GetImageFromArray(buffer))