21 def main(filenameIn,filenameOut,origin,spacing):
22 r = vtk.vtkDataSetReader()
23 r.SetFileName(filenameIn)
25 data = vtk.vtkImageData()
26 data.ShallowCopy(r.GetOutput())
27 data.SetOrigin(origin)
28 data.SetSpacing(spacing)
29 w = vtk.vtkStructuredPointsWriter()
30 if vtk.VTK_MAJOR_VERSION <= 5:
31 w.SetInputConnection(data.GetProducerPort())
34 w.SetFileName(filenameOut)
def main(filenameIn, filenameOut, origin, spacing)
Main function for the conversion.