[vtkusers] vtkImageSlice using UserTransform

David Gobbi david.gobbi at gmail.com
Tue Nov 26 16:25:18 EST 2013


Hi Miro,

Let me see if I understand... you have a vtkImageSlice, and you have a
vtkActor, and you have a matrix.  You call SetUserMatrix(matrix) on
the vtkImageSlice, and you call SetUserMatrix(matrix) on the vtkActor.
 Finally, you use the vtkRenderWindowInteractor to interact with the
vtkActor.

Why not call a DeepCopy on the original matrix, so that the
vtkImageSlice and the vtkActor each has its own matrix?

matrix2 = vtkMatrix4x4::New();
matrix2->DeepCopy(matrix);
imageSlice->SetUserMatrix(matrix2);
actor->SetUserMatrix(matrix);

  David



On Mon, Nov 25, 2013 at 6:31 PM, Miro Drahos <mdrahos at robodoc.com> wrote:
> Hi David,
> I was hoping you could advise on an issue I am experiencing with
> vtkImageSlice.
> Together with the sliced image I am rendering a surface model in the scene,
> that the user needs to be able to pick and interact with. When the surface
> (~ 20000 vertices) is picked, I call SetUserMatrix() on its actor to render
> the translation or rotation that user is performing in real-time.
> This, however has a side-effect that vtkImageSlice uses the matrix and so
> the displayed slice is modified during the interaction.
> Is there a way to tell vtkImageSlice not to use the UserMatrix? Or perhaps
> is there a better way to set the transformation matrix on the surface/its
> actor to render the interaction?
> I turned SliceAtFocalPointOff() and SliceFacesCameraOff() but that doesn't
> change this behavior.
> Thank you!
> Miro
>


More information about the vtkusers mailing list