[vtk-developers] A couple new classes
David Gobbi
dgobbi at irus.rri.ca
Tue Jul 3 11:45:36 EDT 2001
I've committed a new vtkImageStencil class for doing cookie-cutter type
operations on vtkImageData. Most of the stencil functionality is
actually provided by a support class, vtkImageClippingExtents, because
I also want to allow support for stencil operations inside vtkImageReslice
but want to avoid code duplication.
The 'helper' class vtkImageClippingExtents describes an image mask in
the form of a sparse array (sparse only in the x-dimension). Right now
this class is derived directly from vtkObject, but I plan to make it
a descendant of vtkDataObject and add a 'Source' type for it. In the
end this will mean a fairly large number of classes just to support
just a single function (a stencil). And all just so that I can do
stenciling in vtkImageReslice instead of just inside vtkImageStencil!
So I'd better provide some justification. The reason I want to stencil
with vtkImageReslice is to make nonlinear image registration more
efficient: I want to precisely stencil out the portion of the anatomy to
which the (rather expensive) warp transformations are applied. Using a
sparse array to describe the stencil is more space & time efficient than
using a pixel mask, and also minimizes the changes that have to be made
to vtkImageReslice.cxx (which is already quite bloated).
As a final note, The new class contrib/vtkImagePolyDataClippingExtents
provides the means to use a closed, non-self-intersecting vtkPolyData
surface as a stencil. Its name will probably be changed in the future.
- David
--
David Gobbi, MSc dgobbi at irus.rri.ca
Advanced Imaging Research Group
Robarts Research Institute, University of Western Ontario
More information about the vtk-developers
mailing list