[vtkusers] Apply a transform to an image

P B chose29 at hotmail.com
Thu Jul 24 16:58:56 EDT 2008


Hi,
 
   I am new to vtk and struggling with conversions of images. I need to transform a volume (MRI dataset) using the thin plate spline algorithm. 
 
The volume is read from vtkDICOMImageReader and I have access to a vtkImageData structure. I want to apply the transformation with vtkTransformPolyDataFilter, unfortunatly, I get a message specifying I need to give a PolyData structure instead of an image. Does anyone have a solution? Is there a conversion available in vtk? or I am using the transforms in a wrong way?
 
Thanks in advance for your help!
 
 
 
here is the code, if it might be usefull to understand my problem:
 
____________________________________________________________________________
vtkTransformPolyDataFilter *f11 = vtkTransformPolyDataFilter::New ();
vtkGeneralTransform *t1 = vtkGeneralTransform::New ();
 
t1->SetInput (TPSTransfo); // TPSTransfo is of type vtkThinPlateSplineTransform
 
// reading a dicom series
vtkDICOMImageReader *Reader = vtkDICOMImageReader::New();
Reader->SetDirectoryName(mDicomFile.getString());
Reader->Update();
const char * Name = Reader->GetPatientName();
SoDebugError::post( __FILE__, "Patient name is : %s", Name );


 
f11->SetInput ((vtkDataObject*)Reader->GetOutput()); // <- error comes from here. "GetOutput" gives a structure of type vtkImageData 
f11->SetTransform (t1);
f11->Update ();
 
 
 
 
_________________________________________________________________

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080724/22d43a09/attachment.htm>


More information about the vtkusers mailing list