[vtkusers] Question regarding vtkImageReslice

David Gobbi david.gobbi at gmail.com
Tue Jan 29 18:36:08 EST 2013


SetResliceAxesDirectionCosines just sets the first three columns of
the ResliceAxes matrix.  It leaves the fourth column of the matrix
untouched.  So it is only useful if you want to set the rotation part
of the matrix while leaving the translation part unchanged.

SetOutputDimensionality(2) means that the output will always have
Origin[2] = 0.0 and Extent[4]=Extent[5]=0.  In other words, the Z
coordinate for every point in the output will be zero.  That is all
that this method does.  When you call this method, your output will
always be two dimensional even if your input is three dimensional.

So if you use SetOutputDimensionality(2), then the ResliceAxes matrix
defines a coordinate transformation that will be applied to the plane
Z=0 in order to generate an oblique plane that slices through your
input data.  A good way to think about it is that the 1st and 2nd
columns of the matrix are the basis vectors of the oblique plane, the
3rd column is the normal of the oblique plane, and the 4th column is
the "origin" of the oblique plane.  If you call SetOutputOrigin(0,0,0)
then the 4th column of the reslice matrix will precisely define the 3D
point at the corner of your oblique plane.

 - David


On Tue, Jan 29, 2013 at 2:02 PM, Willi Huber
<surfersparadise85-vtk at yahoo.com> wrote:
> Hello,
>
> I would like to know the relationship of the ResliceAxes and
> ResliceAxesDirectionCosines.
> For my understanding the upper left 3x3 matrix of ResliceAxes consists of
> the entries of ResliceAxesDirectionCosines which is true for example in
> vtkImagePlaneWidget whereas the top 3x1 entries in the upper right determine
> a kind of translation.
> But for Examples/ImageProcessing/Python/ImageSlicing.py this ain't true.
> Here the OutputDimensionality is set to 2 in contrast to 3 in
> ImagePlaneWidget. I know this is done to extract the slice. Can someone
> explain me how OutputDimensionality, ResliceAxes and
> ResliceAxesDirectionCosines are related to each other?
>
> Best,
> Willi
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



More information about the vtkusers mailing list