<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>
sorry for asking a very basic question but I'm having trouble: how do we apply a transform to a vtkImageData*?<BR>
<BR>
I have a 4x4 transformation matrix that I feed to a vtkMatrix4x4. I assumed the next step was to create a transform using vtkGeneralTransform and applying this to an vtkImageData but I cannot find the way to do it. Do I have to use vtkImageReslice?<BR>
<BR>
Thanks for your help!<BR>
Pascale<BR>
<BR>
PS: here is the code if it helps to understand my problem:<BR>
<BR><FONT color=#008000 size=2><FONT size=2>
<FONT color=#000000>vtkDICOMImageReader *Reader = vtkDICOMImageReader::New();</FONT><BR>
<FONT color=#000000>Reader->SetDirectoryName(mDicomFile.getString());</FONT><BR>
<FONT color=#000000>Reader->Modified();</FONT><BR>
<FONT color=#000000>Reader->Update();</FONT><BR>
<FONT color=#000000></FONT> <BR><FONT size=2>
<FONT color=#000000>vtkImageData * Volume = Reader->GetOutput();</FONT><BR>
<FONT color=#000000> </FONT><BR>
</FONT><FONT size=2><FONT color=#000000>// apply previously known transforms </FONT><BR></FONT><FONT size=2>
<FONT color=#000000>vtkGeneralTransform * PreviousTransfo = vtkGeneralTransform::New();</FONT></FONT><FONT size=2><BR>
<FONT color=#000000>vtkTransform * TranslOne = vtkTransform::New();</FONT><BR>
<FONT color=#000000>vtkMatrix4x4 * Matrix = vtkMatrix4x4::New();</FONT><BR>
</FONT><FONT color=#000000 size=2>for</FONT><FONT size=2><FONT color=#000000>( i=0; i<4; i++ )</FONT><BR>
</FONT><FONT color=#000000 size=2>for</FONT><FONT size=2><FONT color=#000000>( j=0; j<4; j++ )</FONT><BR>
<FONT color=#000000> Matrix->SetElement(i,j,(</FONT></FONT><FONT color=#000000 size=2>double</FONT><FONT size=2><FONT color=#000000>)mTranslateMR[i][j]);</FONT><BR>
<FONT color=#000000>PCATranslOne->SetMatrix(Matrix);</FONT><BR>
<FONT color=#000000>PreviousTransfo->SetInput(TranslOne);</FONT><BR>
<FONT color=#000000></FONT> <BR>
<FONT color=#000000>// How do I apply this transformation to the Volume variable?</FONT><BR></FONT></FONT></FONT><br /><hr /> <a href='' target='_new'></a></body>
</html>