[vtkusers] Apply transform to image

P B chose29 at hotmail.com
Wed Jul 30 18:23:56 EDT 2008


Hi,
 
   sorry for asking a very basic question but I'm having trouble: how do we apply a transform to a vtkImageData*?
 
   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?
 
Thanks for your help!
Pascale
 
PS: here is the code if it helps to understand my problem:
 
vtkDICOMImageReader *Reader = vtkDICOMImageReader::New();
Reader->SetDirectoryName(mDicomFile.getString());
Reader->Modified();
Reader->Update();
 
vtkImageData * Volume = Reader->GetOutput();
 
// apply previously known transforms 
vtkGeneralTransform * PreviousTransfo = vtkGeneralTransform::New();
vtkTransform * TranslOne = vtkTransform::New();
vtkMatrix4x4 * Matrix = vtkMatrix4x4::New();
for( i=0; i<4; i++ )
for( j=0; j<4; j++ )
   Matrix->SetElement(i,j,(double)mTranslateMR[i][j]);
PCATranslOne->SetMatrix(Matrix);
PreviousTransfo->SetInput(TranslOne);
 
// How do I apply this transformation to the Volume variable?
_________________________________________________________________
Try Chicktionary, a game that tests how many words you can form from the letters given. Find this and more puzzles at Live Search Games!
http://g.msn.ca/ca55/207
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080730/16c7de70/attachment.htm>


More information about the vtkusers mailing list