[vtkusers] How does vtkImageReslice work?

P B chose29 at hotmail.com
Fri Oct 17 13:28:46 EDT 2008


Hi,
 
   could someone give me precisions on the vtkImageReslice? I want to apply a simple rotation to that volume, I need to center the image, then apply the rotation. What I don't understand is how should I specify an output origin to vtkImageReslice when I don't actually know where it will be after the translation/rotation?
 
The volume origin is not (0,0,0), I set it up with SetOrigin for vtkImageData and put the same value into SetOutputOrigin for vtkImageReslice, it that what I should do?
 
 
 
For example, this is what I have tried for the rotation, without success:
 
// Matrix containing the rotation
vtkMatrix4x4 * TheMatrix2 = vtkMatrix4x4 ::New();
for(ii = 0; ii<4; ii++)
for(jj = 0; jj<4; jj++)
{
   TheMatrix2->SetElement(ii,jj,(double)mRotateMRCT[ii][jj]);
}
 
vtkMatrixToLinearTransform * MatLin2 = vtkMatrixToLinearTransform::New();
MatLin2->SetInput(TheMatrix2);
 

vtkImageReslice *reslice = vtkImageReslice::New();
reslice->SetInput( TempIm );
reslice->SetOutputExtent( TempIm->GetExtent() );
reslice->SetOutputOrigin( TempIm->GetOrigin() );
reslice->SetOutputSpacing( TempIm->GetSpacing() );
reslice->SetResliceTransform( MatLin2 );
reslice->SetInterpolationModeToCubic();
reslice->Update();
TempIm2 = reslice->GetOutput();
 
Anyone could explain the exact way that reslice works for simple transformations? 
 
Thanks for your help,
Pascale
 
 
_________________________________________________________________

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081017/97842d20/attachment.htm>


More information about the vtkusers mailing list