Hi Cagatay,<br>      I sort of realised my error late last night! Thanks for the response. <br>sid.<br><br><div class="gmail_quote">On Fri, Nov 4, 2011 at 12:58 AM, cagatay bilgin <span dir="ltr">&lt;<a href="mailto:bilgincc@gmail.com">bilgincc@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Siddharth, <br><br>Try changing unsigned char to double here<div class="im"><br>typedef itk::AffineTransform&lt;unsigned char, 2&gt; TransformType;<br>
<br></div>From <a href="http://www.itk.org/Doxygen/html/classitk_1_1AffineTransform.html" target="_blank">http://www.itk.org/Doxygen/html/classitk_1_1AffineTransform.html</a><br>
&quot;There are two template parameters for this class:<p>ScalarT The type to be used for scalar numeric values. Either float or double.&quot;</p>Regards, <br>Cagatay <br><br><div class="gmail_quote"><div><div></div><div class="h5">
On Thu, Nov 3, 2011 at 1:58 PM, Siddharth Srivastava <span dir="ltr">&lt;<a href="mailto:siddys@gmail.com" target="_blank">siddys@gmail.com</a>&gt;</span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex"><div><div></div><div class="h5">Hi ITK users,<br>     <br>      I am trying to implement, following the example given in the ITK guide, an affine registration<br>

routine. Somewhere at the top of the code, I set<br><br>    typedef itk::AffineTransform&lt;unsigned char, 2&gt; TransformType;<br>
    typedef itk::RegularStepGradientDescentOptimizer OptimizerType;<br>    typedef itk::LinearInterpolateImageFunction&lt; BFrameType, double &gt; InterpolatorType;<br>    typedef itk::MeanSquaresImageToImageMetric&lt; BFrameType, BFrameType &gt; MetricType;<br>


    typedef itk::ImageRegistrationMethod&lt;BFrameType, BFrameType&gt; RegistrationType;<br><br>// then I create the necessary smart pointers to objects<br><br>    TransformType::Pointer transform = TransformType::New();<br>


    OptimizerType::Pointer optimizer = OptimizerType::New();<br>    InterpolatorType::Pointer interpolator = InterpolatorType::New();<br>    RegistrationType::Pointer registration = RegistrationType::New();<br>    MetricType::Pointer metric = MetricType::New();<br>


<br>// and then I associate them to the registration filter:<br>     registration-&gt;SetOptimizer( optimizer );<br>    registration-&gt;SetTransform( transform ); // <b>error on this line</b><br>    registration-&gt;SetInterpolator (interpolator ); <br>


    registration-&gt;SetMetric( metric ); <br><br>// including the reference and floating images<br><br>    registration-&gt;SetFixedImage(  ref ) ; <br>    registration-&gt;SetMovingImage( flt );<br><br>during the build (on MS Visual studio 2010) I get the following error:<br>


<br>Error    12    error C2664: &#39;itk::ImageRegistrationMethod&lt;TFixedImage,TMovingImage&gt;::SetTransform&#39; : cannot convert parameter 1 from &#39;itk::SmartPointer&lt;TObjectType&gt;&#39; to &#39;itk::Transform&lt;TScalarType,NInputDimensions,NOutputDimensions&gt; *&#39;    <br>


<br>Can anyone help with useful insights? <br><br>Thanks,<br>Sid.<br>
<br></div></div>_____________________________________<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.html" target="_blank">http://www.kitware.com/products/protraining.html</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>
</blockquote></div><br>