[Paraview] Extract Block from MultiBlock into vtkImageData
Favre Jean
jfavre at cscs.ch
Fri Apr 30 04:04:52 EDT 2010
________________________________________
From: paraview-bounces at paraview.org [paraview-bounces at paraview.org] On Behalf Of Eric E. Monson [emonson at cs.duke.edu]
Sent: Thursday, April 29, 2010 5:40 PM
To: Michael Jackson
Cc: ParaView list
Subject: Re: [Paraview] Extract Block from MultiBlock into vtkImageData
Hey Mike,
Hopefully someone else has a "real" filter that will do this, but in the meantime I think you can do what you want with a Python Programmable Filter. Set the output to the type you want, and put something like this in the script:
pdi = self.GetInputDataObject(0,0)
block0 = pdi.GetBlock(0)
pdo = self.GetOutputDataObject(0)
pdo.ShallowCopy(block0)
--------------------------------------------------------------------
Hello Eric
The python code above is correct, but an important piece is missing, i.e. setting up the WholeExtent.
The RequestInformation Script should also contain:
pdi = self.GetInputDataObject(0,0)
exts = pdi.GetBlock(0).GetExtent()
pdo = self.GetOutputDataObject(0)
pdo.SetWholeExtent(exts)
-----------------
Jean M. Favre
Swiss National Supercomputing Center
More information about the ParaView
mailing list