MoDeNa  1.0
Software framework facilitating sequential multi-scale modelling
vtkconv.py
Go to the documentation of this file.
1 
10 import vtk
11 
21 def main(filenameIn,filenameOut,origin,spacing):
22  r = vtk.vtkDataSetReader()
23  r.SetFileName(filenameIn)
24  r.Update()
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())
32  else:
33  w.SetInputData(data)
34  w.SetFileName(filenameOut)
35  w.Write()
def main(filenameIn, filenameOut, origin, spacing)
Main function for the conversion.
Definition: vtkconv.py:21