[Insight-users] help with rigid 3D rotation and translation image registration.

Greg Harris Gregory-Harris at uiowa.edu
Mon Jul 11 18:07:49 EDT 2005


Luis,

Using code like this:


  typedef ChangeInformationImageFilter<TInputImage> CentererType;
  typedef NormalizeImageFilter<TInputImage,TOutputImage> NormalizerType;

  typename CentererType::Pointer   centererFixed;
  typename NormalizerType::Pointer normalizerFixed;
  typename CentererType::Pointer   centererMoving;
  typename NormalizerType::Pointer normalizerMoving;

  typedef VersorRigid3DTransform< double > VersorRigid3DTransformType;
  typedef 
CenteredTransformInitializer<VersorRigid3DTransformType,TInputImage,TInputImage> 
InputInitializerType;
  typedef 
CenteredTransformInitializer<VersorRigid3DTransformType,TOutputImage,TOutputImage> 
OutputInitializerType;

. . . .

// DEBUG HERE
  {
    typename VersorRigid3DTransformType::Pointer myTransform = 
VersorRigid3DTransformType::New();
    typename InputInitializerType::Pointer initializer = 
InputInitializerType::New();
    initializer->SetTransform(   myTransform );
    initializer->SetFixedImage(  centererFixed->GetOutput() );
    initializer->SetMovingImage( centererMoving->GetOutput() );
    initializer->MomentsOn();
    initializer->InitializeTransform();
    std::cout << "Preprocessor Stage 1, center: " << 
myTransform->GetCenter()
                                  << ", offset: " << 
myTransform->GetOffset()
                                  << "." << std::endl;
  }
  {
    typename VersorRigid3DTransformType::Pointer myTransform = 
VersorRigid3DTransformType::New();
    typename OutputInitializerType::Pointer initializer = 
OutputInitializerType::New();
    initializer->SetTransform(   myTransform );
    initializer->SetFixedImage(  normalizerFixed->GetOutput() );
    initializer->SetMovingImage( normalizerMoving->GetOutput() );
    initializer->MomentsOn();
    initializer->InitializeTransform();
    std::cout << "Preprocessor Stage 2, center: " << 
myTransform->GetCenter()
                                  << ", offset: " << 
myTransform->GetOffset()
                                  << "." << std::endl;
  }


I got output like this:


Preprocessor Stage 1, center: [-0.543803, -14.7, -0.578181], offset: 
[-0.108293, -0.729428, -6.02416].
Preprocessor Stage 2, center: [7.45049e+07, 2.01401e+09, 7.92149e+07], 
offset: [2.37017e+07, 3.09689e+08, 9.15106e+08].


This clearly says Code/BasicFilters/itkNormalizeImageFilter.txx
is spoiling things for a subsequent use of 
Code/Algorithms/itkImageMomentsCalculator.txx,
but I don't yet see where the problem is in NormalizeImageFilter or the
module it depends on, Code/BasicFilters/itkShiftScaleImageFilter.txx.

Can you help with this?  Is there something I have to say to 
NormalizeImageFilter
to make this work?

Greg Harris
Iowa Psychiatry Brain Imaging Lab.




More information about the Insight-users mailing list