[vtkusers] Problem in VTKImageReslicer

David Gobbi dgobbi at imaging.robarts.ca
Mon Nov 25 00:48:32 EST 2002


See the 'oops' below....

On Mon, 25 Nov 2002, David Gobbi wrote:

> Hi Sateesh,
>
> To extract just a slice, you should set the OutputExtent to a
> single slice & appropriately set the OutputOrigin and OutputSpacing
>
> reslice->SetOutputExtent(0,xMax,0,yMax,0,0)
> reslice->SetOutputSpacing(1,1,1)
> reslice->SetOutputOrigin(-0.5*xMax,-0.5*yMax,zSlice)

This specifies that your output slice is a cut plane
at z=zSlice and with its center at x=0,y=0 and with sides
   <is what I meant so say instead of the lines below>

> This specifies that your output slice is a cut plane
> at z=0 and with its center at (0,0,0) and with sides
> of length xMax and yMax.  Of course, a transformation
> is applied to this slice before it is used to 'cut' the
> input volume.
>
> Borrowing a bit from a private email from Dan Blezek, here is
> an explanation of transforms & axes & direction cosines in
> vtkImageReslice:
>
> If the ResliceTransform is set to T and the ResliceAxes are set to A,
> the values of the output image I' are computed from the input image I
> like this (given the correct interpolation mode):
>
>  foreach pixel in I':
>    I'[pixel] = I[ A * T * pixel ]
>
> where pixel is the (x,y,z) pixel/voxel location in data coordinates.
> (note that the 'data coordinates' are not the same thing as the
> 'structured coordinates' (i,j,k) unless the origin is (0,0,0) and
> the spacing is (1,1,1) for both the input & the output).
>
> So it is fine to use either the ResliceAxes A or the
> ResliceTransform T to specify the orientation of the slice, or a
> combination of the two can be used since they are simply multiplied
> together.
>
> The ResliceAxesDirectionCosines are the 9 elements of the
> upper-left 3x3 submatrix of the 4x4 ResliceAxes matrix A.
> They are just a rotation matrix that is applied after the
> ResliceTransform.
>
> I hope this helps more than it confuses...
>
>  - David
>
>




More information about the vtkusers mailing list