[vtkusers] Creating an ImageData from the bounds of a PolyData

Jérôme jerome.velut at gmail.com
Tue Dec 8 16:53:45 EST 2009


>
>
> Jerome,
>
> Have you put this anywhere? It seems like a reasonable thing to add to VTK,
> no?
>
>
Mmmmm yes... Attached, with my previous mail ;)
I think I will put it in my soon-very-soon-ready-for-diffusion Chiron module
(http://github.com/jeromevelut/Chiron). I will advertise this medical
imaging ParaView plugin... soon.


> Another thing - how do you get the coordinates of the center of a cell
> in an ImageData? The
> vtkCell* GetCell(vtkIdType cellId)
>

seems to be linearly indexed, why does
>
> vtkCell* GetCell(int i, int j, int k)
>
> not exist?
>
>
I don'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.

I think that some helper functions exist in vtkImageData for these
translations, but I cannot remember which.


> Thanks,
>

You are welcome, Jerome

>
> David
>

Jerome

_______________________________________________
> 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
>

2009/12/8 David Doria <daviddoria+vtk at gmail.com <daviddoria%2Bvtk at gmail.com>
>
On Tue, Dec 8, 2009 at 4:20 PM, Jérôme <jerome.velut at gmail.com> wrote:
> Hi,
> 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.
> I added an input port to put your dataset from a pipeline
> ("SourceConnection"). I use it intensively in ParaView to crop medical
> images.
>
> 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
'sleepy'.
>
> HTH
>
> Jerome
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091208/fef2df56/attachment.htm>


More information about the vtkusers mailing list