[vtkusers] Simple Reslicer Question
Stiving, Scott O.
stiving at mayo.edu
Thu Nov 14 09:44:15 EST 2002
I am trying to take one MR volume that is an axial series and reslice it to correspond to an oblique series but I cannot get the volumes to line up correctly. I have stepped back to the basics and still cannot figure out the results from reslicer. In the snippet of code below all I am trying to do is translate the volume by a positive X and then "reslice" it using it's own information as output information. Everything seems to work but the image is shifted to the left, (I was expecting it to be shifted to the right). When I look at the transformation matrix everything looks right:
1 0 0 100
0 1 0 0
0 0 1 0
0 0 0 1
Here are the results of other simple transformations:
positive X translate ==> the image shifts right ???
positive Y translate ==> the image shifts down ???
positive Z translate ==> the volume shifts towards the viewer. (acts like a right handed coordinate system).
translate to origin -> positive Z Rotation -> translate back ==> the image rotates clockwise (does not act like a right handed coordinate system).
Could someone please tell me if these actions are correct, and if so why?
// VTK Class to set transformation matrix
vtkTransform *AxisTransform = vtkTransform::New();
AxisTransform->PostMultiply();
AxisTransform->Translate( 100.0, 0.0, 0.0 );
vtkImageReslice *reslice = vtkImageReslice::New();
reslice->SetInterpolationModeToLinear(); // For Linear
reslice->SetInput(reader->GetOutput());
reslice->SetResliceTransform(AxisTransform); // Applying transformation to volume
reslice->SetOutputSpacing( reader->GetDataSpacing() );
reslice->SetOutputOrigin( reader->GetDataOrigin() );
reslice->SetOutputExtent( reader->GetDataExtent() );
// Print out the matrixes
vtkIndent indent;
AxisTransform->PrintSelf( std::cout, indent );
reslice->PrintSelf( std::cout, indent );
**************************
Scott O. Stiving M.S.
Mayo Clinic
MR Programming Support
Mayo Image Studio Team
(507) 266-0808
Stiving at Mayo.edu <mailto:Stiving at Mayo.edu>
***************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20021114/48ace616/attachment.htm>
More information about the vtkusers
mailing list