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

David Doria daviddoria+vtk at gmail.com
Tue Dec 8 16:39:48 EST 2009


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

Jerome,

Have you put this anywhere? It seems like a reasonable thing to add to VTK, no?

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?

Thanks,

David



More information about the vtkusers mailing list