Hello,
I want to append vtkImageData files to a single file, I could easily do that with vtk. But from paraview I can apply transform filters to place them as needed and append them. I tried two techniques to do that,
-
Write a Programable Filter
from paraview import vtk
A = self.GetInputDataObject(0, 0)
B = self.GetInputDataObject(0, 1)
vtkAppend = vtk.vtkImageAppend()
vtkAppend.SetInputData(A)
vtkAppend.SetInputData(B)
vtkAppend.Update()
output = self.GetOutput()
output.ShallowCopy(vtkAppend.GetOutput())
When i do this the output gets clipped to bounding box of smallest dataset between the two, in short it doesn’t append correct.
- Write a python script
from paraview import * from paraview import servermanager as sm sources = GetSources() sources = sources.values() source1 = sources[1] source2 = sources[2] imgData1 = sm.Fetch(source1) imgData2 = sm.Fetch(source2) vtkAppend = vtk.vtkImageAppend() vtkAppend.SetInputData(imgData1) vtkAppend.SetInputData(imgData2) vtkAppend.Update() dataMerged = vtkAppend.GetOutput() writer = vtk.vtkStructuredPointsWriter() writer.SetInputData(dataMerged) writer.SetFileName("vtkmerged.vtk") writer.Write()
With this I get error as
AttributeError: 'module' object has no attribute 'vtkStructuredPointsWriter'
Any insights on this problem would help a lot.
Thanks
Vishnu C