[vtkusers] SetCutPlane not working in vtkImageResliceMapper

David Gobbi david.gobbi at gmail.com
Thu Mar 28 13:00:54 EDT 2013


On Thu, Mar 28, 2013 at 10:35 AM, Debjit Ghosh <dghosh at chla.usc.edu> wrote:
> Hi David,
>
> I had been trying to do that where in I got the orientation from the
> vtkImageSlice (I wish it returned the orientation as a rotation matrix but I
> wrote the wiki convert Euler-Rotation matrix code) but now that you are
> speaking of the same solution, I think I would look into what I was doing
> again and perhaps there was something slightly off.
>
> Thank you for your advice! I would take every word of it! :)

Just a quick note: there is a reason that vtkImageSlice does not return
an orientation matrix: a slice is described as a plane.  So here is how
I approach the slicing problem:

We start with 6 degrees of freedom (three position, three orientation).

The plane is a constraint.  It fixes 3 of the 6 degrees of freedom.
(I know that vtkPlane is described by 6 variables, but that is beside
the point.  A mathematical plane requires 2 angles to describe the
orientation of the normal, and 1 position along the normal to describe
the position of the plane).

So, after specifying the plane, there are 3 degrees of freedom left.
In order to define our coordinate transformation (i.e our matrix) we
must apply additional constraints: 1 rotation constraint, and 2 position
constraints.

Inside vtkImageSlice, the way that I handle these constraints depends
on whether I need a transformation that maps the image to a texture,
or whether I need a transformation that maps the image directly to the
screen.  So actually there is no single matrix that vtkImageSlice would
return: it builds its internal matrix differently according to the various
vtkImageSlice settings.  The way it builds the matrix is very specific
to how it does the rendering.

 - David



More information about the vtkusers mailing list