Hi, <br>I wrote a class that should do what you want: vtkExtractVOIFromBoundingBox. It derives from vtkExtractVOI and overload the RequestInformation method, where the SetVOI parameters -that are set by the user in the parent- are automatically computed.<br>
I added an input port to put your dataset from a pipeline (&quot;SourceConnection&quot;). I use it intensively in ParaView to crop medical images.<br><br>The caveat concerns essentially the Request.... overloading, that I may use not correctly. You have to change the margin parameter in order to update effectively. The pipeline seems... well, not broken, but at least &#39;sleepy&#39;.<br>
<br>HTH<br><br>Jerome<br><br><br><div class="gmail_quote">2009/12/8 David Gobbi <span dir="ltr">&lt;<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Tue, Dec 8, 2009 at 1:42 PM, David Gobbi &lt;<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>&gt; wrote:<br>
<br>
&gt; The Bounds of an image are<br>
&gt;<br>
&gt; bounds = { i_min*Spacing[0] + Origin[0], i_max*Spacing[1] + Origin[1], etc. };<br>
<br>
</div>Typo.  I should have typed this:<br>
<br>
int extent[6] = { i_min, i_max, j_min, j_max, k_min, k_max };<br>
<br>
double bounds[6] = { i_min*Spacing[0] + Origin[0], i_max*Spacing[0] + Origin[0],<br>
  j_min*Spacing[1] + Origin[1], j_max*Spacing[1] + Origin[1],<br>
  k_min*Spacing[2] + Origin[2], k_max*Spacing[2] + Origin[2] };<br>
<div><div></div><div class="h5"><br>
  David<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>
</div></div></blockquote></div><br>