Example #1
0
def main(opts, args):
  appender = vtk.vtkAppendPolyData()
  for f in args:
    o = nu.readVTK(f)
    appender.AddInput(o)
  appender.Update()
  nu.writeVTK(opts.output, appender.GetOutput())
Example #2
0
def main(opts, args):
    appender = vtk.vtkAppendPolyData()
    for f in args:
        o = nu.readVTK(f)
        appender.AddInput(o)
    appender.Update()
    nu.writeVTK(opts.output, appender.GetOutput())
Example #3
0
def main(opts, args):
  inputTransform = np.array(opts.transform.split(","), dtype='double').reshape((4,4))
  transformMatrix = vtk.vtkMatrix4x4()
  for i in range(0,4):
    for j in range(0,4):
      transformMatrix.SetElement(i,j,inputTransform[i,j])

  print "InputTransform\n", inputTransform, "vtkMatrix\n", transformMatrix
  transform = vtk.vtkTransform()
  transform.SetMatrix(transformMatrix)
  transformFilter = vtk.vtkTransformPolyDataFilter()
  transformFilter.SetTransform(transform)
  for (inputId, input) in enumerate(args):
    obj = nu.readVTK(input)
    transformFilter.SetInput(obj)
    transformFilter.Update()
    objOut = transformFilter.GetOutput()
    if (opts.output.find("%") > 0):
      nu.writeVTK(opts.output % (inputId), objOut)
    else:
      nu.writeVTK(opts.output, objOut)
Example #4
0
#!/biomed-resimg/crews_rodent/devel/linux/ParaView3/ParaView-3.10.0-Linux-x86_64/bin/pvpython
import niral
import sys

p = niral.readVTK(sys.argv[1])
niral.writeVTK(sys.argv[2], p)