[vtk-developers] StencilData changes

David Gobbi david.gobbi at gmail.com
Wed Feb 20 16:29:01 EST 2008


Hi Everyone,

Last week I checked in a fix for the way that vtkImageStencilData
handles its Origin and Spacing attributes.  In VTK 4, the
vtkImageStencilSource used to get the Origin and Spacing values from
its consumer via an ugly hack that doesn't even work in VTK 5.  From
VTK 5 onward, it was necessary to do
StencilSource->GetOutput()->SetSpacing()/Origin() which wasn't very
pretty.

I have added SetOutputSpacing() and SetOutputOrigin() methods to
vtkImplicitFunctionToImageStencil and vtkPolyDataToImageStencil, so
directly setting the output's values is no longer necessary.  For
vtkImageToImageStencil, this information is now properly copied over
from the input.

I also added a SetInformationInput() method to
vtkImplicitFunctionToImageStencil and vtkPolyDataToImageStencil, so
that you can set a vtkImageData from which the Spacing, Origin, and
WholeExtent will be copied.  This is done in VTK 4 style, because I
was not sure how to propagate only the RequestInformation and not the
RequestData calls to this input if done in VTK 5 style, since in VTK 5
it is the responsibility of the executive, rather than the filters, to
propagate requests.

Comments welcome.

   David



More information about the vtk-developers mailing list