Hi Maarten,<div><br></div><div>Can you send the exact text of the error that VTK gives you?</div><div><br></div><div>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.</div>

<div><br></div><div>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.<br>

<br></div><div>  David</div><div><br></div><div><br><div class="gmail_quote">On Wed, Dec 15, 2010 at 12:08 PM, Maarten Beek <span dir="ltr">&lt;<a href="mailto:beekmaarten@yahoo.com">beekmaarten@yahoo.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div>Hi group,<br>
    <br>
    I seem to be able to use stencils to mask images and get i.e., some
    stats data using the vtkImageAccumulate filter.<br>
    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).<br>
    <br>
    Therefore I am using the<font color="#000000"> <a href="http://www.vtk.org/doc/release/5.4/html/a01275.html#a3bfd0cbcd9ad3f4f2292a0f00428536" target="_blank">SetOutputWholeExtent</a>()
      f</font>unction in the <a href="http://www.vtk.org/doc/release/5.4/html/a01275.html" title="use polydata to mask an image" target="_blank">vtkPolyDataToImageStencil</a>
    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.<br>
    <br>
    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?<br>
    <br>
    Thanks - Maarten</div>
</div><br>

      </div><br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>