[vtkusers] Extract a VOI from volume

David Doria daviddoria at gmail.com
Wed Oct 20 09:34:27 EDT 2010


On Wed, Oct 20, 2010 at 9:19 AM, Denis Martin <dm at wicam.com> wrote:
> Hello David,
>
> i cannot use the vtkboxwidget2 it was not implemented in my VTK Version,
>
> but i tried the setVOI, seems that the input Value is the pixels value from
> my slice
>  exemple my Dicom Volume is 512 x 512 x 113.
>
>  If I set my setVOI(0,512,0,512,0,113) I have full representation of my
> volume.
>
> Dimensions for Volume is different I have x 249.5 ,y 249.5 , and z 77.39.
> This is value from my bounds.
>
> I set my boxwidget a center of my bounds, now I need formula to get the
> Good value for set my setVOI parameter.
>
> If you have some idea ?
>
> Denis

Hi Denis,

Please keep the conversation on the list so that everyone can
help/benefit from the discussion.

It looks like the only difference is that in vtkBoxWidget you don't
have to get a Representation before you get the PolyData ( I believe
this was a major idea in the change to the vtk*Widget2 series).

I think another way to state your problem is that you need to convert
from world coordinates (the box corners) to grid/image coordinates.
For this you can use vtkImageData::FindPoint -
http://www.vtk.org/doc/nightly/html/classvtkImageData.html#af5bb66af44074412b64b3058b09a2f87.

This function returns a linear index. You can get the grid index from
the linear index, but I forget how at the moment.

The ComputePointIdForExtent goes from grid index -> linear index:
http://www.vtk.org/doc/nightly/html/classvtkStructuredData.html#a6f3b628bdb2984bbcc8ec90dcc937c97

and I'm pretty sure there is a function that goes the other way but I
can't find it at the moment. Can anyone chime in with the name of this
function?

Thanks,

David



More information about the vtkusers mailing list