[vtkusers] vtkImageReslice config problem
Dean Inglis
dean.inglis at sympatico.ca
Mon Mar 3 14:22:37 EST 2008
Hi
I am developing a MPR application and am having some difficulty
getting vtkImageReslice configured properly. I have a set of
"layout lines" interactively defined on a slice through the original
image data set. The user can set the number of slices, spacing (output slice
thickness ) and length of the lines (in-plane FOV of the slices) as well
as the in-plane pixel dimensions (see attached jpeg). When I set
the vtkImageReslice, I use the following settings:
// r, s and t define the the output axes unit vectors
this->Reslice->SetResliceAxesDirectionCosines(
r[0],r[1],r[2],s[0],s[1],s[2],t[0],t[1],t[2]);
// turn off transformation of the input spacing origin and extent
// so we can use our own
this->Reslice->TransformInputSamplingOff();
// p0 corresponds to the origin of the output axes unit vectors
// and would correspond to one of the corners of the preview
// plane shown in the figure when that plane was on the first
// of the layout lines
this->Reslice->SetResliceAxesOrigin(p0[0], p0[1], p0[2]);
// neither of the following choices work!
// this->Reslice->SetOutputOrigin( p0[0], p0[1], p0[2] );
this->Reslice->SetOutputOrigin( 0.5*r_sp, 0.5*s_sp, 0.5*t_sp );
// r_sp, s_sp and t_sp are user specified spacings
this->Reslice->SetOutputSpacing( r_sp, s_sp, t_sp );
// w_ext is calculated from the specified spacings, the length of
// the layout lines, the distance they span, and the necessary height
// of the output slices so that none of the input data is truncated.
// w_ext[0], w_ext[2], w_ext[4] are all 0.
this->Reslice->SetOutputExtent(w_ext);
When I update the reslice, the output slices do not appear positioned
with respect to the requested origin. Is there some transform I have to
apply to get the correct origin? Would I have to transform the extent?
Dean
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080303/73a0d45c/attachment.htm>
More information about the vtkusers
mailing list