[Insight-users] MultiResMIRegistration - QuaternionRigid 2 Affine

Christos Panagiotou C.Panagiotou at cs.ucl.ac.uk
Sat, 20 Mar 2004 17:28:33 +0000


Dear all

I am trying to modify the MultiResMIRegistration application in a way to 
handle an affine transformation (and not a QuaternionRigid) as i want to 
incorporate scaling.
I want to register two different modalities (an MRI volume and a volume 
reconstructed by optical tomography data). The unchanged application 
achieves an acceptable
if not very good result of registration, however the ot volume is 
smaller in size and is not obviously scaled to better fit the mri volume.

I changed the optimizer to GradientDescentOptimizer and the 
QuaternionRigidTransform to AffineTransform.

In the MIMRegistration.txx file I ve proceeded to the following changes:

MIMRegistration::Execute()

  // Setup the optimizer
  typename OptimizerType::ScalesType scales(
    m_Transform->GetNumberOfParameters() );
  scales.Fill( 1.0);
 
  for ( int j = 9; j < 12; j++ )            // before it was j=4; j<7 
for rigid quaternion T
    {
    scales[j] = m_TranslationScale;  <---- scale the last N parameters 
(3 dimensions) which represent translations
    }

MIMRegistration::GetAffineTransform()
m_AffineTransform->SetMatrix( m_Transform->GetRotationMatrix() );  
changed to:
 m_AffineTransform->SetMatrix( m_Transform->GetMatrix() );

When I run the code I get the "All the sampled point mapped to outside 
of the moving image" exception from the first iterations
even if i use a large translation scale value with small learning rates.

i paste some of the input i ve tried in the parameters file.
4 4 1 (or 8 8 1)
2 2 1 ( 4 4 1)
2000 (<-- or 4000) 2500 2500 3000
1e-7 1e-7 5e-7 1e-6
320 (or bigger)

I am not sure if i have to change more things to get the affine 
transform working (do i miss something very important)?
Is the GradientDescentOptimizer a good choice or should i use the 
GradientDescentOptimizer?

I do all the necessary permutations and flipping before the registration 
(and it worked fine in the rigidquaternionT)

I ve read in the itk guide that in an AffineT the first iterations 
should be devoted to eliminate substantial translations and
then the system should devote to rotations and scaling. I thought that 
this is accomplished by the fact that both fixed and moving
images are centered in 0,0,0 by the use of a centerer. I assume it 
relates to translations after the centerer has been applied. How is it 
possible
to implement such a thing?

My main problem is actualy that i get the exception and i dont know if 
it is because i ve forgot to alter something in the code or if my parameters
need tunning

I would appreciate any suggestions
christos