<div class="gmail_quote"><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">
<br>
</div>Jerome,<br>
<br>
Have you put this anywhere? It seems like a reasonable thing to add to VTK, no?<br>
<br></blockquote><div><br>Mmmmm yes... Attached, with my previous mail ;)<br>I think I will put it in my soon-very-soon-ready-for-diffusion Chiron module (<a href="http://github.com/jeromevelut/Chiron">http://github.com/jeromevelut/Chiron</a>). I will advertise this medical imaging ParaView plugin... soon.<br>
 <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Another thing - how do you get the coordinates of the center of a cell<br>
in an ImageData? The<br>
vtkCell* GetCell(vtkIdType cellId)<br>
 </blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
seems to be linearly indexed, why does<br>
<br>
vtkCell* GetCell(int i, int j, int k)<br>
<br>
not exist?<br>
<br></blockquote><div><br>I don&#39;t use the vtkCell object. I use the scalar pointer for data traversal. The point Idx is linear, but you can easily compute the image coordinate from the id (and vice-versa) if you know the number of scalar components and the extent. In the same way, David G -too much David here... I will name you all Jerome in the futur- gave you the function that computes image_id[i,j,k] from world_coord[x,y,z]. It is also reversible. <br>
<br>I think that some helper functions exist in vtkImageData for these translations, but I cannot remember which. <br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Thanks,<br></blockquote><div><br>You are welcome, Jerome <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div class="h5"><br>
David<br></div></div></blockquote><div> </div><div>Jerome <br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div class="h5">

_______________________________________________<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><br></div>2009/12/8 David Doria <span dir="ltr">&lt;<a href="mailto:daviddoria%2Bvtk@gmail.com">daviddoria+vtk@gmail.com</a>&gt;</span><br>On Tue, Dec 8, 2009 at 4:20 PM, Jérôme &lt;<a href="mailto:jerome.velut@gmail.com">jerome.velut@gmail.com</a>&gt; wrote:<br>

&gt; Hi,<br>
&gt; I wrote a class that should do what you want: vtkExtractVOIFromBoundingBox.<br>
&gt; It derives from vtkExtractVOI and overload the RequestInformation method,<br>
&gt; where the SetVOI parameters -that are set by the user in the parent- are<br>
&gt; automatically computed.<br>
&gt; I added an input port to put your dataset from a pipeline<br>
&gt; (&quot;SourceConnection&quot;). I use it intensively in ParaView to crop medical<br>
&gt; images.<br>
&gt;<br>
&gt; The caveat concerns essentially the Request.... overloading, that I may use<br>
&gt; not correctly. You have to change the margin parameter in order to update<br>
&gt; effectively. The pipeline seems... well, not broken, but at least &#39;sleepy&#39;.<br>
&gt;<br>
&gt; HTH<br>
&gt;<br>
&gt; Jerome