<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>Hi,<BR>
<BR>
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?<BR>
<BR>
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?<BR>
<BR>
<BR>
<BR>
For example, this is what I have tried for the rotation, without success:<BR>
<BR><FONT color=#008000 size=2>
// Matrix containing the rotation<BR></FONT><FONT size=2>
vtkMatrix4x4 * TheMatrix2 = vtkMatrix4x4 ::New();<BR>
</FONT><FONT color=#0000ff size=2>for</FONT><FONT size=2>(ii = 0; ii<4; ii++)<BR>
</FONT><FONT color=#0000ff size=2>for</FONT><FONT size=2>(jj = 0; jj<4; jj++)<BR>
{<BR>
TheMatrix2->SetElement(ii,jj,(</FONT><FONT color=#0000ff size=2>double</FONT><FONT size=2>)mRotateMRCT[ii][jj]);<BR>
}<BR>
<BR>
vtkMatrixToLinearTransform * MatLin2 = vtkMatrixToLinearTransform::New();<BR>
MatLin2->SetInput(TheMatrix2);<BR>
<BR>
<BR>
vtkImageReslice *reslice = vtkImageReslice::New();<BR>
reslice->SetInput( TempIm );<BR>
reslice->SetOutputExtent( TempIm->GetExtent() );<BR>
reslice->SetOutputOrigin( TempIm->GetOrigin() );<BR>
reslice->SetOutputSpacing( TempIm->GetSpacing() );<BR>
reslice->SetResliceTransform( MatLin2 );<BR>
reslice->SetInterpolationModeToCubic();<BR>
reslice->Update();<BR>
TempIm2 = reslice->GetOutput();<BR>
<BR>
Anyone could explain the exact way that reslice works for simple transformations? <BR>
<BR>
Thanks for your help,<BR>
Pascale<BR></FONT>
<BR>
<BR><br /><hr />Use Windows Live Messenger to send messages to your buddies on their mobile phones <a href='http://www.pc2mobile.ca' target='_new'>Find out more on our PC to Mobile website</a></body>
</html>