[Insight-users] MR Registration

Luis Ibanez luis . ibanez at kitware . com
Thu, 08 Aug 2002 09:40:00 -0400


Hi cspl,

The exception message that you are getting indicates that the
transformation at this particular iteration of the registration
process is mapping the moving image out of the range of the
fixed image.

Once the registration goes so much off there is not much hope
for recovery.

You may want to reduce the learning rate of the optimizer so the
steps taken on the transform parameters are smaller.

You may also have to increase the translation scale parameter
since usually images go off due to large translations.

How many iterations have been done before the image goes out of
range ?


Luis

===============================================================

cspl wrote:
> Dear Friends,
>  I am working on MRI Registration.I have made my own project using MRI 
> Registration example available in ITK examples.It is working well for 
> some MRI images.But,It is throwing exception  at StartRegistration() for 
> some imagess.I have hard coded the Parameters which I have to set before 
> calling StartRegistration().Plese, help me in solving my problem and 
> give me some information on setting parameter values. Here I am 
> enclosing the code and parameters details.I am also enclosing the 
> exception message thrown by startregistration().
> 
>  
> 
> //Exception message
> itk::ERROR: MutualInformationImageToImageMetric(003C6D20): All the 
> sampled point mapped to outside of the moving image
> 
>  
> 
> //Code and parameter details
> 
>  
> 
> typedef itk::QuaternionRigidTransform<double> TransformType;
>   typedef itk::QuaternionRigidTransformGradientDescentOptimizer 
> OptimizerType;
>   typedef itk::MutualInformationImageToImageMetric<ImageType, ImageType> 
> MetricType;
>   typedef itk::LinearInterpolateImageFunction<ImageType, double> 
> InterpolatorType;
>   typedef itk::ImageRegistrationMethod<ImageType,ImageType> 
> RegistrationType1;
> 
>  
> 
> 
>   MetricType::Pointer         metric        = MetricType::New();
>   TransformType::Pointer      transform     = TransformType::New();
>   OptimizerType::Pointer      optimizer     = OptimizerType::New();
>   InterpolatorType::Pointer   interpolator  = InterpolatorType::New();
>   RegistrationType1::Pointer  registration  =RegistrationType1::New();
>  
> 
>  
> 
>   RegistrationType1::ParametersType 
> guess(transform->GetNumberOfParameters() );
>   
>   guess[0] = 0.0;
>   guess[1] = 0.0;
>   guess[2] = 0.0;
>   guess[3] = 1.0;
>   guess[4] = 20.0;
>   guess[5] = 40.0;
>   guess[6] = 0.0;
> 
>  
> 
>   registration->SetInitialTransformParameters (guess);
>  
>   
>   //set metric parameters
>   metric->SetMovingImageStandardDeviation( 2 );
>   metric->SetFixedImageStandardDeviation( 2 );
>   metric->SetNumberOfSpatialSamples( 50 );
>   
>  
>  // Set translation scale
>   typedef OptimizerType::ScalesType ScaleType;
>   ScaleType scales(transform->GetNumberOfParameters());
>   scales.Fill( 1.0 );
>   for( unsigned j = 4; j < 7; j++ )
>     {
>   scales[j] = 1.0 / vnl_math_sqr(1.0);
>     }
>  
>  
> 
>  
> 
>  //Scale parameters 
>   optimizer->SetNumberOfIterations( 2000 );
>   optimizer->SetLearningRate( 0.0005 );
> 
>  
> 
> 
>   //set registration parameters
>   registration->SetMetric(metric);
>   registration->SetOptimizer(optimizer);
>   registration->SetTransform(transform);
>   registration->SetInterpolator(interpolator);
>   registration->SetFixedImage(FixedImage);
>   registration->SetMovingImage(MovingImage);
> 
>  
> 
>   // Setup the optimizer
>   optimizer->SetScales(scales);
>   //optimizer->MaximizeOn();
>  
>  
>   AfxMessageBox("Before registration") ;
>   registration->StartRegistration();
>   AfxMessageBox("After registration") ;
>  
>   // Get the results
>   itk::Array<double>  *arr=new itk::Array<double>;
>   RegistrationType1::ParametersType solution 
> =registration->GetLastTransformParameters();
> 
>  
> 
> 
> Regars,
> CSPL
>