No subject
Tue Nov 1 15:57:14 EDT 2011
ScalarT The type to be used for scalar numeric values. Either float or
double."
Regards,
Cagatay
On Thu, Nov 3, 2011 at 1:58 PM, Siddharth Srivastava <siddys at gmail.com>wrote:
> Hi ITK users,
>
> I am trying to implement, following the example given in the ITK
> guide, an affine registration
> routine. Somewhere at the top of the code, I set
>
> typedef itk::AffineTransform<unsigned char, 2> TransformType;
> typedef itk::RegularStepGradientDescentOptimizer OptimizerType;
> typedef itk::LinearInterpolateImageFunction< BFrameType, double >
> InterpolatorType;
> typedef itk::MeanSquaresImageToImageMetric< BFrameType, BFrameType >
> MetricType;
> typedef itk::ImageRegistrationMethod<BFrameType, BFrameType>
> RegistrationType;
>
> // then I create the necessary smart pointers to objects
>
> TransformType::Pointer transform = TransformType::New();
> OptimizerType::Pointer optimizer = OptimizerType::New();
> InterpolatorType::Pointer interpolator = InterpolatorType::New();
> RegistrationType::Pointer registration = RegistrationType::New();
> MetricType::Pointer metric = MetricType::New();
>
> // and then I associate them to the registration filter:
> registration->SetOptimizer( optimizer );
> registration->SetTransform( transform ); // *error on this line*
> registration->SetInterpolator (interpolator );
> registration->SetMetric( metric );
>
> // including the reference and floating images
>
> registration->SetFixedImage( ref ) ;
> registration->SetMovingImage( flt );
>
> during the build (on MS Visual studio 2010) I get the following error:
>
> Error 12 error C2664:
> 'itk::ImageRegistrationMethod<TFixedImage,TMovingImage>::SetTransform' :
> cannot convert parameter 1 from 'itk::SmartPointer<TObjectType>' to
> 'itk::Transform<TScalarType,NInputDimensions,NOutputDimensions> *'
>
> Can anyone help with useful insights?
>
> Thanks,
> Sid.
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>
--bcaec529a05113c21e04b0e413f1
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hi Siddharth, <br><br>Try changing unsigned char to double here<br>typedef =
itk::AffineTransform<unsigned char, 2> TransformType;<br><br>From <a =
href=3D"http://www.itk.org/Doxygen/html/classitk_1_1AffineTransform.html">h=
ttp://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>Rega=
rds, <br>Cagatay <br><br><div class=3D"gmail_quote">On Thu, Nov 3, 2011 at =
1:58 PM, Siddharth Srivastava <span dir=3D"ltr"><<a href=3D"mailto:siddy=
s at gmail.com">siddys at gmail.com</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin: 0pt 0pt 0pt 0.8ex; borde=
r-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi ITK users,<br>=
=A0=A0=A0=A0 <br>=A0=A0=A0=A0=A0 I am trying to implement, following the ex=
ample given in the ITK guide, an affine registration<br>
routine. Somewhere at the top of the code, I set<br><br>=A0=A0=A0 typedef i=
tk::AffineTransform<unsigned char, 2> TransformType;<br>
=A0=A0=A0 typedef itk::RegularStepGradientDescentOptimizer OptimizerType;<b=
r>=A0=A0=A0 typedef itk::LinearInterpolateImageFunction< BFrameType, dou=
ble > InterpolatorType;<br>=A0=A0=A0 typedef itk::MeanSquaresImageToImag=
eMetric< BFrameType, BFrameType > MetricType;<br>
=A0=A0=A0 typedef itk::ImageRegistrationMethod<BFrameType, BFrameType>=
; RegistrationType;<br><br>// then I create the necessary smart pointers to=
objects<br><br>=A0=A0=A0 TransformType::Pointer transform =3D TransformTyp=
e::New();<br>
=A0=A0=A0 OptimizerType::Pointer optimizer =3D OptimizerType::New();<br>=A0=
=A0=A0 InterpolatorType::Pointer interpolator =3D InterpolatorType::New();<=
br>=A0=A0=A0 RegistrationType::Pointer registration =3D RegistrationType::N=
ew();<br>=A0=A0=A0 MetricType::Pointer metric =3D MetricType::New();<br>
<br>// and then I associate them to the registration filter:<br>=A0=A0=A0=
=A0 registration->SetOptimizer( optimizer );<br>=A0=A0=A0 registration-&=
gt;SetTransform( transform ); // <b>error on this line</b><br>=A0=A0=A0 reg=
istration->SetInterpolator (interpolator ); <br>
=A0=A0=A0 registration->SetMetric( metric ); <br><br>// including the re=
ference and floating images<br><br>=A0=A0=A0 registration->SetFixedImage=
(=A0 ref ) ; <br>=A0=A0=A0 registration->SetMovingImage( flt );<br><br>d=
uring the build (on MS Visual studio 2010) I get the following error:<br>
<br>Error=A0=A0=A0 12=A0=A0=A0 error C2664: 'itk::ImageRegistrationMeth=
od<TFixedImage,TMovingImage>::SetTransform' : cannot convert para=
meter 1 from 'itk::SmartPointer<TObjectType>' to 'itk::Tr=
ansform<TScalarType,NInputDimensions,NOutputDimensions> *'=A0=A0=
=A0 <br>
<br>Can anyone help with useful insights? <br><br>Thanks,<br>Sid.<br>
<br>_____________________________________<br>
Powered by <a href=3D"http://www.kitware.com" target=3D"_blank">www.kitware=
.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href=3D"http://www.kitware.com/opensource/opensource.html" target=3D"_bl=
ank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href=3D"http://www.kitware.com/products/protraining.html" target=3D"_bla=
nk">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href=3D"http://www.itk.org/Wiki/ITK_FAQ" target=3D"_blank">http://www.it=
k.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href=3D"http://www.itk.org/mailman/listinfo/insight-users" target=3D"_bl=
ank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br>
--bcaec529a05113c21e04b0e413f1--
More information about the Insight-users
mailing list