Hi Abayiz,<br><br>Did you set the final parameters in the &quot;finalTransform&quot; ?<br><br>Please look at any of the examples:<br><br>ITK/Examples/Registration/<br>ImageRegistration2.cxx<br>ImageRegistration3.cxx<br>ImageRegistration4.cxx<br>
ImageRegistration5.cxx<br>ImageRegistration6.cxx<br>ImageRegistration7.cxx<br>ImageRegistration8.cxx<br>ImageRegistration9.cxx<br><br><br>and the lines:<br><br>  ParametersType finalParameters = registration-&gt;GetLastTransformParameters();<br>
<br>  TransformType::Pointer finalTransform = TransformType::New();<br><br>  finalTransform-&gt;SetParameters( finalParameters );<br>  finalTransform-&gt;SetFixedParameters( transform-&gt;GetFixedParameters() );<br><br>  ResampleFilterType::Pointer resample = ResampleFilterType::New();<br>
<br>  resample-&gt;SetTransform( finalTransform );<br><br><br>       Luis<br><br><br>-----------------------------------------<br><div class="gmail_quote">On Mon, May 21, 2012 at 8:44 AM, Abayiz <span dir="ltr">&lt;<a href="mailto:abayiz@yahoo.com" target="_blank">abayiz@yahoo.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-size:12pt;font-family:times new roman,new york,times,serif"><div>Hello,</div><div><br></div><div>
I am going to perform a transformation based on parameters from rigid registration, and my partial code for transformation is as follows: <br></div><div><br></div><div>****************************************************************</div>
<div>  resampler-&gt;SetTransform( finalTransform );<br>  resampler-&gt;SetInput( reader-&gt;GetOutput() );<br><br>  resampler-&gt;SetSize(    reader-&gt;GetOutput()-&gt;GetLargestPossibleRegion().GetSize() );<br>  resampler-&gt;SetOutputOrigin(  reader-&gt;GetOutput()-&gt;GetOrigin() );<br>
  resampler-&gt;SetOutputSpacing( reader-&gt;GetOutput()-&gt;GetSpacing() );<br>  resampler-&gt;SetOutputDirection( reader-&gt;GetOutput()-&gt;GetDirection() );<br><br>  resampler-&gt;SetInterpolator (
 linearInterpolator );<br>  resampler-&gt;SetDefaultPixelValue( 30 );</div><div><br></div><div><br></div><div>  CastFilterType::Pointer  caster =  CastFilterType::New();<br>  WriterType::Pointer       writer =     WriterType::New();<br>
  caster-&gt;SetInput( resampler-&gt;GetOutput() );<br><br>  writer-&gt;SetInput( resampler-&gt;GetOutput()   );<br>  writer-&gt;SetFileName ( &quot;transformedimage.mha&quot; );<br>  writer-&gt;Update();<br></div><div><br>
</div><div>****************************************************************</div><div><br></div><div>The code compiles without error, but from the result I can say it is not working correctly. Which part is wrong here?? Do you have any suggestion? <br>
</div><div><br></div><div>Thanks in advance. <br></div></div></div><br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br>