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"><<a href="mailto:bilgincc@gmail.com">bilgincc@gmail.com</a>></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<unsigned char, 2> 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>
"There are two template parameters for this class:<p>ScalarT The type to be used for scalar numeric values. Either float or double."</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"><<a href="mailto:siddys@gmail.com" target="_blank">siddys@gmail.com</a>></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<unsigned char, 2> TransformType;<br>
typedef itk::RegularStepGradientDescentOptimizer OptimizerType;<br> typedef itk::LinearInterpolateImageFunction< BFrameType, double > InterpolatorType;<br> typedef itk::MeanSquaresImageToImageMetric< BFrameType, BFrameType > MetricType;<br>
typedef itk::ImageRegistrationMethod<BFrameType, BFrameType> 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->SetOptimizer( optimizer );<br> registration->SetTransform( transform ); // <b>error on this line</b><br> registration->SetInterpolator (interpolator ); <br>
registration->SetMetric( metric ); <br><br>// including the reference and floating images<br><br> registration->SetFixedImage( ref ) ; <br> registration->SetMovingImage( flt );<br><br>during the build (on MS Visual studio 2010) I get the following error:<br>
<br>Error 12 error C2664: 'itk::ImageRegistrationMethod<TFixedImage,TMovingImage>::SetTransform' : cannot convert parameter 1 from 'itk::SmartPointer<TObjectType>' to 'itk::Transform<TScalarType,NInputDimensions,NOutputDimensions> *' <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>