<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>
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. <BR>
<BR>
The volume is read from vtkDICOMImageReader and I have access to a vtkImageData structure. I want to apply the transformation with <FONT size=2>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?</FONT><BR>
<BR>
Thanks in advance for your help!<BR>
<BR>
<BR>
<BR>
here is the code, if it might be usefull to understand my problem:<BR>
<BR>
____________________________________________________________________________<BR><FONT size=2>
vtkTransformPolyDataFilter *f11 = vtkTransformPolyDataFilter::New ();<BR>
vtkGeneralTransform *t1 = vtkGeneralTransform::New ();<BR>
<BR>
t1->SetInput (TPSTransfo); <FONT color=#99cc00><FONT color=#008000>// TPSTransfo is of type <FONT size=2>vtkThinPlateSplineTransform</FONT></FONT></FONT><BR>
<FONT color=#99cc00><FONT color=#008000><FONT size=2> <BR></FONT></FONT></FONT>
</FONT><FONT color=#008000 size=2>// reading a dicom series<BR></FONT><FONT size=2>
vtkDICOMImageReader *Reader = vtkDICOMImageReader::New();<BR>
Reader->SetDirectoryName(mDicomFile.getString());<BR>
Reader->Update();<BR>
</FONT><FONT color=#0000ff size=2>const</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>char</FONT><FONT size=2> * Name = Reader->GetPatientName();<BR>
SoDebugError::post( __FILE__, </FONT><FONT color=#800000 size=2>"Patient name is : %s"</FONT><FONT size=2>, Name );<BR>
<BR>
<BR>
<BR>
f11->SetInput ((vtkDataObject*)Reader->GetOutput()); <FONT color=#008000>// <- error comes from here. "GetOutput" gives a structure of type vtkImageData </FONT><BR>
f11->SetTransform (t1);<BR>
f11->Update ();<BR>
<BR>
<BR>
<BR>
<BR></FONT><br /><hr /> <a href='' target='_new'></a></body>
</html>