[vtkusers] Problem rotating vtkImageSlice

David Gobbi david.gobbi at gmail.com
Thu Apr 20 11:16:48 EDT 2017


Hi Ang,

The PokeMatrix() method is an internal method that VTK uses for picking.
If you use it for rendering, it might corrupt the state of the VTK pipeline.

Use SetUserMatrix() instead.

 - David


On Tue, Apr 18, 2017 at 1:50 AM, Ang <ysa0829 at gmail.com> wrote:

> Hi David,
>
> I would like to flip around X axis for vtkImageSlice (not original pixel
> data ,just flip actor),below is my code.
>
> //***********************************************//
> double *tranlate = imageSlice->GetCenter();
>
> vtkTransform *trans = vtkTransform::New();
> trans->PostMultiply();
>
> trans->Translate(-tranlate[0], -tranlate[1], -tranlate[2]);
> trans->RotateY(180);
> trans->Translate(tranlate[0], tranlate[1], tranlate[2]);
>
> imageSlice->PokeMatrix(trans->GetMatrix());
> //***********************************************//
>
> As your mentioned in the thread, I cant rotate the vtkImageSlice by using
> vtkMatrix so I got wrong result.
>
> Would you have some suggestion to  flip around X axis for vtkImageSlice?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170420/e5c3ff14/attachment.html>


More information about the vtkusers mailing list