[vtkusers] Keeping a vtkImageResliceMapper slice plane in sync with the vtkImageSlice

David Gobbi david.gobbi at gmail.com
Wed Nov 7 12:28:21 EST 2012


Hi Giuseppe,

The main reason that the SlicePlane is in world coordinates is that the
ClippingPlanes (which are settable for all VTK mappers) are in world
coordinates.  I didn't want one set of mapper planes to be defined in
data coords, while another set of mapper planes was defined in world.

A transform is probably the best way of syncing, I don't think that
there is a better way.

Perhaps in VTK 6, a SetDataSlicePlane() method could be added,
so that a slice plane can be specified in data coords.

 - David


On Wed, Nov 7, 2012 at 9:48 AM, Giuseppe D'Angelo
<giuseppe.dangelo at kdab.com> wrote:
> Hello,
>
> the slice plane set into a vtkImageResliceMapper is documented to be in
> world coordinates, not data coordinates. This means that changing the
> transformation on the prop used to show it (in my case, a vtkImageSlice)
> will break the shown slice if the plane is not updated.
>
> I worked around this issue by installing a vtkTransform on the vtkPlane used
> for slicing, and the keeping this transformation in sync with the prop's
> one.
>
> I was wondering: is there a convenience method to do this that I overlooked?
> It seemed "natural" to me that scaling or translating the prop shouldn't
> affect the piece of data that it's being sliced.
>
> Thank you,
> --
> ** Qt Developer Conference: http://qtconference.kdab.com/ **
> Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Software Engineer
> KDAB (UK) Ltd., a KDAB Group company
> Tel. UK +44-1738-450410, Sweden (HQ) +46-563-540090
> KDAB - Qt Experts - Platform-independent software solutions



More information about the vtkusers mailing list