[vtkusers] vtkImageStencilData question

David Gobbi david.gobbi at gmail.com
Wed Dec 15 14:34:10 EST 2010


Hi Maarten,

Can you send the exact text of the error that VTK gives you?

In general, the extent of the stencil must be exactly the same as the extent
of the image.  This might change in some future release of VTK, but for VTK
5.6 and the upcoming VTK 5.8 it is definitely the case.

Here is something that you can try: before you put the data into
vtkImageAccumulate, use vtkImageClip to clip it down to the size of the
stencil.  The default behaviour of vtkImageClip is to only change the
information, while passing the data itself unchanged, so it should not slow
things down at all.  Changing the UpdateExtent like you suggested
unfortunately will not work, because vtkImageAccumulate always forces its
UpdateExtent to be the WholeExtent of whatever filter precedes it.

  David


On Wed, Dec 15, 2010 at 12:08 PM, Maarten Beek <beekmaarten at yahoo.com>wrote:

> Hi group,
>
> I seem to be able to use stencils to mask images and get i.e., some stats
> data using the vtkImageAccumulate filter.
> However since the region of the image mask is very small I would like to
> use a small stencil to get those stats (thus improving efficiency).
>
> Therefore I am using the SetOutputWholeExtent<http://www.vtk.org/doc/release/5.4/html/a01275.html#a3bfd0cbcd9ad3f4f2292a0f00428536>()
> function in the vtkPolyDataToImageStencil<http://www.vtk.org/doc/release/5.4/html/a01275.html>to give the stencil a sub-extent (say: 250 260 150 160 10 15) and apply it
> on an image with a full extent (say: 0 511 0 511 0 50) in i.e.
> vtkImageAccumulate. However I get an error regarding one extent being
> outside another extent.
>
> Is it possible to apply a stencil with a sub-extent to a full image and if
> so I would I do this? Do I have to (temporarily) set the update extent of
> the image to the sub-extent of the stencil?
>
> Thanks - Maarten
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101215/4e0ef7dd/attachment.htm>


More information about the vtkusers mailing list