[Insight-users] StartRegistration failed
valli gummadi
valli gummadi" <valli_gummadi at rediffmail.com
13 Jan 2004 12:25:06 -0000
This is a multipart mime message
--Next_1073996706---0-202.54.124.152-18687
Content-type: text/html;
charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
<P>=0A<BR>=0A Dear Mr.Luis,<BR>=0A<BR>=0A =
I am working on the registration application. My application is failing at=
the StartRegistration() function. When I trace the code i found that it is=
failing at the metric initialization.<BR>=0A<BR>=0AIn MattesMutualinformat=
ion class at the following line:<BR>=0A<BR>=0ABSplineInterpolatorType * tes=
tPtr =3D dynamic_cast<BSplineInterpolatorType *>(<BR>=0A =
m_Interpolator.GetPointer() );<BR>=0A<BR>=0AEnclosing the code:<BR>=0Atype=
def float InternalPixelType;<BR>=0Atypedef itk::Centere=
dAffineTransform< double, Dimension > TransformType;<BR>=0Atypedef it=
k::RegularStepGradientDescentOptimizer OptimizerType;<=
BR>=0Atypedef itk::MattesMutualInformationImageToImageMetric< &nb=
sp; InternalImageType, InternalImageType &=
gt; MetricType;<BR>=0Atypedef itk:: LinearInterpolateImageFunc=
tion< InternalImageType,<BR>=0A &=
nbsp; double> InterpolatorType; &=
nbsp;typedef itk::ImageRegistrationMethod< InternalImageType, InternalIm=
ageType > RegistrationType;<BR>=0Atypedef itk::CenteredTransformI=
nitializer< TransformType, FixedImage=
Type,MovingImageType > TransformInitializerType;<BR>=0A<BR>=0AInte=
rpolatorType::Pointer interpolator =3D InterpolatorType::New()=
;<BR>=0Ainterpolator->SetInputImage( movingCaster->GetOutput());<BR>=
=0Aregistration->SetInterpolator( interpolator );<BR>=0A<BR>=
=0AMetricType::Pointer metric &nbs=
p; =3D MetricType::New();<BR>=0Ametric->SetNumberOfHistogramBins(=
50);<BR>=0Ametric->SetNumberOfSpatialSamples(1000 );<BR>=0Aregist=
ration->SetMetric( metric =
);<BR>=0A<BR>=0Atypedef OptimizerType::ScalesType &nbs=
p; OptimizerScalesType;<BR>=0AOptimizerType::Pointer o=
ptimizer =3D OptimizerType::New();<BR>=0AOptimizerScalesType =
optimizerScales( NoofParams );<BR>=0Aconst double translationScale =3D 1.0 =
/ 1000000;<BR>=0Afor( int i =3D 0; i <=3D 8; i++ )<BR>=0A &=
nbsp;optimizerScales[ i ] =3D 1.0 / 1.0;//m_scales;<BR>=0AoptimizerSc=
ales[ 9 ] =3D translationScale;<BR>=0AoptimizerScales[ 10 ] =3D=
translationScale;<BR>=0AoptimizerScales[ 11 ] =3D translationS=
cale;<BR>=0AoptimizerScales[ 12 ] =3D translationScale;<BR>=0Aoptimiz=
erScales[ 13 ] =3D translationScale;<BR>=0AoptimizerScales[ 14 ] =3D&=
nbsp; translationScale;<BR>=0Aoptimizer->SetScales( optimizerScales );<B=
R>=0Aoptimizer->SetMaximumStepLength( 4); <BR>=0Aoptimizer->SetMinimu=
mStepLength( 0.001 );<BR>=0Aoptimizer->SetNumberOfIterations( 100 ); <BR=
>=0Aoptimizer->SetMinimize( TRUE ); <BR>=0Aregistrati=
on->SetOptimizer( optimizer );<BR>=0A<BR>=0A=
TransformType::Pointer transform =3D Tran=
sformType::New();<BR>=0Atransform->SetIdentity();<BR>=0ANoofParams =3D t=
ransform->GetNumberOfParameters();<BR>=0Aregistration->SetInitialTran=
sformParameters( transform->GetParameters() );<BR>=0Aregistration->Se=
tTransform( transform );<BR>=0A<BR>=0Atry <BR>=
=0A{ <BR>=0A registration->StartRegistration(); <BR>=
=0A} <BR>=0Acatch( itk::ExceptionObject & err ) <BR>=0A{ <BR>=0A =
AfxMessageBox( err.GetDescription() );<BR>=0A &nb=
sp;return false;<BR>=0A} <BR>=0A<BR>=0A <BR>=0A<BR>=0A<BR>=0APlease help me=
in solving the problem.I had very urgent requirement for this.<BR>=0A<BR>=
=0AThanking you<BR>=0ARegards,<BR>=0ASriValli.<BR>=0A<BR>=0A=0A</P>=0A<br><=
br>=0A<A target=3D"_blank" HREF=3D"http://clients.rediff.com/signature/trac=
k_sig.asp"><IMG SRC=3D"http://ads.rediff.com/RealMedia/ads/adstream_nx.cgi/=
www.rediffmail.com/inbox.htm at Bottom" BORDER=3D0 VSPACE=3D0 HSPACE=3D0 HEIGH=
T=3D74 WIDTH=3D496></a>=0A
--Next_1073996706---0-202.54.124.152-18687
Content-type: text/plain;
charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
=0A Dear Mr.Luis,=0A=0A I am working on the registration applicati=
on. My application is failing at the StartRegistration() function. When I t=
race the code i found that it is failing at the metric initialization.=0A=
=0AIn MattesMutualinformation class at the following line:=0A=0ABSplineInte=
rpolatorType * testPtr =3D dynamic_cast<BSplineInterpolatorType *>(=0A m=
_Interpolator.GetPointer() );=0A=0AEnclosing the code:=0Atypedef float =
InternalPixelType;=0Atypedef itk::CenteredAffineTransform< double, Dimensi=
on > TransformType;=0Atypedef itk::RegularStepGradientDescentOptimizer =
OptimizerType;=0Atypedef itk::MattesMutualInformationImageToImageMetric< =
InternalImageType, InternalImageType > MetricType;=0Atypedef itk:: L=
inearInterpolateImageFunction< InternalImageType,=0A double> Interpola=
torType; typedef itk::ImageRegistrationMethod< InternalImageType, InternalI=
mageType > RegistrationType;=0Atypedef itk::CenteredTransformInitializer<=
TransformType, FixedImageType,MovingImageType > TransformInitia=
lizerType;=0A=0AInterpolatorType::Pointer interpolator =3D InterpolatorT=
ype::New();=0Ainterpolator->SetInputImage( movingCaster->GetOutput());=0Are=
gistration->SetInterpolator( interpolator );=0A=0AMetricType::Pointer =
metric =3D MetricType::New();=0Ametric->SetNumberOfHistogramBin=
s( 50);=0Ametric->SetNumberOfSpatialSamples(1000 );=0Aregistration->SetMet=
ric( metric );=0A=0Atypedef OptimizerType::ScalesType O=
ptimizerScalesType;=0AOptimizerType::Pointer optimizer =3D Optimiz=
erType::New();=0AOptimizerScalesType optimizerScales( NoofParams );=0Aconst=
double translationScale =3D 1.0 / 1000000;=0Afor( int i =3D 0; i <=3D 8; i=
++ )=0A optimizerScales[ i ] =3D 1.0 / 1.0;//m_scales;=0AoptimizerScales[ =
9 ] =3D translationScale;=0AoptimizerScales[ 10 ] =3D translationScale;=
=0AoptimizerScales[ 11 ] =3D translationScale;=0AoptimizerScales[ 12 ] =3D=
translationScale;=0AoptimizerScales[ 13 ] =3D translationScale;=0Aoptimi=
zerScales[ 14 ] =3D translationScale;=0Aoptimizer->SetScales( optimizerSca=
les );=0Aoptimizer->SetMaximumStepLength( 4); =0Aoptimizer->SetMinimumStepL=
ength( 0.001 );=0Aoptimizer->SetNumberOfIterations( 100 ); =0Aoptimizer->Se=
tMinimize( TRUE ); =0Aregistration->SetOptimizer( optimizer );=0A=
=0ATransformType::Pointer transform =3D TransformType::New();=0Atr=
ansform->SetIdentity();=0ANoofParams =3D transform->GetNumberOfParameters()=
;=0Aregistration->SetInitialTransformParameters( transform->GetParameters()=
);=0Aregistration->SetTransform( transform );=0A=0Atry =0A{ =0A re=
gistration->StartRegistration(); =0A} =0Acatch( itk::ExceptionObject & err =
) =0A{ =0A AfxMessageBox( err.GetDescription() );=0A return false;=0A} =0A=
=0A =0A=0A=0APlease help me in solving the problem.I had very urgent requir=
ement for this.=0A=0AThanking you=0ARegards,=0ASriValli.=0A=0A
--Next_1073996706---0-202.54.124.152-18687--