[vtk-developers] vtkImageReslice with the problem of slice original

David Gobbi david.gobbi at gmail.com
Thu Apr 30 10:02:11 EDT 2015


On Thu, Apr 30, 2015 at 5:20 AM, Jason <2130220212 at email.szu.edu.cn> wrote:

> I have read David Gobbi's tips in
>
> http://vtk.1045678.n5.nabble.com/vtkImageReslice-class-td1233015.html#a1233022
>
> it use  x = T*M*x'    where "T" is ResliceTransform and "M" is
> ResliceMatrix
> to calculate the position in 3D volume(x) by the point position in 2D
> slice(x')
>
> but I'm still wondering that the slice we need cut through and how to use
> the ResliceTransform(vtkAbstractTransform)  to calculate the point position
> in 3D coordinate.
>
> Does just make the x'=(x0,y0,0,1) , M=ResliceAxes ? what about T ? I cannot
> get its matirx.
>

Yes, M is ResliceAxes. And T is identity unless you call
SetResliceTransform.

The slice is defined with SetOutputOrigin(x0,y0,z0),
SetOutputSpacing(dx,dy,dz),
and SetOutputExtent(0,xn-1,0,yn-1,0,0) where:

(x0,y0,z0) is the corner of the slice (in x' coords, not x coords, usually
z0=0)
dx, dy, dz is the voxel spacing (in x' coords, usually dz=dy=dx)
xn * yn are the dimensions of the slice (number of columns and rows)

So imagine a for loop over the rows and columns of the slice:

for i = 0 to xn-1
    for j = 0 to yn-1
        x' =  (x0 + i*dx, y0 + j*dy, z0, 1)
        x = T*M*x'

The x values generated by this loop are the sample points for the slice.

 - David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20150430/7a97dd04/attachment-0001.html>


More information about the vtk-developers mailing list