[Insight-users] Is it a bug in registration framework??

Laurent PAUL Laurent.Paul at orto.ucl.ac.be
Tue Feb 6 09:01:07 EST 2007


Ok, this is my code:

  typedef itk::CenteredVersorTransformInitializer < ImageType, ImageType >
TransformInitializerType;
  TransformInitializerType::Pointer Initializer =
TransformInitializerType::New();
  typedef itk::MeanSquaresImageToImageMetric< ImageType, ImageType >
	MetricType;
  MetricType::Pointer Metric = MetricType::New();
  typedef itk::ImageRegistrationMethod< ImageType, ImageType >
RegistrationType;
  RegistrationType::Pointer Registration = RegistrationType::New();
  typedef itk::VersorRigid3DTransform < double > TransformType;
  TransformType::Pointer Transform = TransformType::New();
  typedef itk::VersorRigid3DTransformOptimizer OptimizerType;
  OptimizerType::Pointer Optimizer = OptimizerType::New();
  typedef itk:: LinearInterpolateImageFunction< ImageType, double >
InterpolatorType;
  InterpolatorType::Pointer Interpolator = InterpolatorType::New();

  initializer->SetTransform (Transform );
  initializer->SetFixedImage (FixedImage);
  initializer->SetMovingImage (MovingImage);
  initializer->MomentsOn();

  Registration ->SetFixedImage ( FixedImage );
  Registration ->SetMovingImage( MovingImage );
  Registration ->SetMetric   (  metric  );
  Registration ->SetOptimizer(  Optimizer );
  Registration ->SetTransform(  Transform );
  Registration ->SetInterpolator(  Interpolator );
  Registration ->SetInitialTransformParameters( transform->GetParameters());

typedef OptimizerType::ScalesType OptimizerScalesType;
  OptimizerScalesType optimizerScales( transform->GetNumberOfParameters() );
  optimizerScales[0] = 1.0;
  optimizerScales[1] = 1.0;
  optimizerScales[2] = 1.0;
  optimizerScales[3] = 1.0 /(10.0 * spacing[0] * size[0] );
  optimizerScales[4] = 1.0 /(10.0 * spacing[1] * size[1] );
  optimizerScales[5] = 1.0 /(10.0 * spacing[2] * size[2] );
  Optimizer->SetScales( optimizerScales );
  Optimizer->MinimizeOn();
  Optimizer->SetMaximumStepLength( MaxLenght );
  Optimizer->SetMinimumStepLength( 0.001 );
  Optimizer->SetNumberOfIterations( iter );

  Metric->SetFixedImage ( FixedImage );
  Metric->SetFixedImageRegion(FixedImage->GetLargestPossibleRegion());
  Metric->SetMovingImage( MovingImage );
  Metric->SetTransform(Transform);
  Metric->SetInterpolator(  Interpolator  );

Note that I tried to use GeometryOn() on Initializer but I had a run-time
error saying Compute() must be called during intialization process.
The Compute method belongs to ImageMomentCalculator class.
Can I use GeometryOn()?

Is something wrong in registration setup?
I confess that OptimizerScale is not clear enough for me so, perhaps it is
just something wrong with that...
Is there any warning about what had been affected in centered transforms?

Thanks!

Laurent.




>
> Hi Laurent,
>
> The family of Transform was reorganized before the release of ITK 2.8.
>
> In particular, the use of the Centered transforms was affected.
>
> We will need more details about your registration setup in order
> to give you further advice.
>
>
>
>     Regards,
>
>
>        Luis
>
>
>
> --------------------
> Laurent PAUL wrote:
>> Hi users,
>>
>> I'm using ITK registration framework for a while now, and so far, it
>> worked great.
>> Since I upgrade my ITK build to 2.8.1, I had problems with the
>> framework.
>>
>> I built the same source code from ITK 1.8.0, ITK 2.0 and ITK 2.8.1.
>> I ran the program with the corresponding ITKCommon.dll and had different
>> results.
>>
>> With ITK 1.8.0 and 2.0, registration converged and gave me an excellent
>> result.
>> With 2.8.1, registration stopped because volumes weren't overlapping
>> anymore...
>> What's the matter with this release?
>>
>> I did not try with the new 3.0 release, and so don't know if this
>> behavior
>> was corrected.
>>
>> These are the components I use:
>>
>> itkImageRegistrationMethod.h
>> itkVersorRigid3DTransform.h
>> itkVersorRigid3DTransformOptimizer.h
>> itkCenteredVersorTransformInitializer.h
>> itkMeanSquaresImageToImageMetric.h
>> itkLinearInterpolateImageFunction.h
>> itkResampleImageFilter.h
>>
>> Let me know if a bug report is necessary... or if I missed something new
>> in newer releases.
>>
>> Thanks,
>>
>> Laurent.
>>
>> _______________________________________________
>> Insight-users mailing list
>> Insight-users at itk.org
>> http://www.itk.org/mailman/listinfo/insight-users
>>
>


-----------------------------------
PAUL Laurent.
Université Catholique de Louvain (UCL)
University Hospital Saint-Luc
Orthopaedic Laboratory
avenue Mounier, 53
Pasteur Tower +4
1200 BRUSSELS

tél:(0032) 2 764 93 88
----------------------------------



More information about the Insight-users mailing list