[Insight-users] Lost in registration: NMI and 1+1

Martin Kavec kavec at messi.uku.fi
Mon Nov 29 10:03:07 EST 2004


Hi,

I have been double-checking several times my modifications to 
MultiResMIRegistration from InsightApplications but didn't find the problem. 
This is basically a repost with hope that someone will kindly help me. I can 
not find where is the problem of the exection I am getting:

Caught an exception:

itk::ExceptionObject (0x810eef8)
Location: "Unknown"
File: /opt/include/InsightToolkit/Algorithms/itkHistogramImageToImageMetric.txx
Line: 255
Description: itk::ERROR: 
NormalizedMutualInformationHistogramImageToImageMetric(0x81003f0): All the 
points mapped to outside of the moving image 

My aim is to register 3D MRI images using normalized mutual information and 
1+1 optimizer. To be able to monitor the metric throughout iterations I 
attached an observer to the optimizer. Just to make sure, I print both 
initial matrix values and scaling factors. The values are always the same as 
before and after I make any changes.  Here is what I have done:

1) First I changed the metric type to NMI. To initialize it I followed the 
ImageRegistration14.cxx. To test the changes I took high-res T1-weighted MRI 
volume and rotated it 15 degrees in one direction. The output of the 
registration of the rotated against the original:

Preprocess the images ...
Register the images ...
--- Starting level 0
[0, 0, 0, 1, 0, 0, 0] ... Initial values
[1, 1, 1, 1, 9.76563e-06, 9.76563e-06, 9.76563e-06] ... Scaling 
 No. Iterations: 20 Current value: 0
0   1.16376
1   1.15109
2   1.15341
3   1.15736
4   1.16313
5   1.17055
.
.
.
18   1.19548
19   1.19584

So it seems to be working.

2) In the second step I changed the optimizer and initialize it:

  typedef typename Statistics::NormalVariateGenerator  GeneratorType;
  GeneratorType::Pointer m_Generator = GeneratorType::New();
  m_Generator->Initialize(12345);
  m_Optimizer->SetNormalVariateGenerator( m_Generator );

  const double initialRadius = 40;
  m_Optimizer->Initialize( initialRadius );
  m_Optimizer->SetEpsilon( 0.01 );
  m_Optimizer->SetMaximumIteration( 500 );
  m_Optimizer->SetGrowthFactor(1.05);
  m_Optimizer->SetShrinkFactor(0.9);

Now on the same two input volumes the registration throws exception after the 
following lines:

Preprocess the images ...
Register the images ...
--- Starting level 0
[0, 0, 0, 1, 0, 0, 0] ... Initial values
[1, 1, 1, 1, 9.76563e-06, 9.76563e-06, 9.76563e-06] ... Scaling 
 No. Iterations: 0 Current value: 0


Since the scaling, initial values and the transform (QuaternionRigidTransform) 
stay the same, I really can not figure out where could be the problem. I 
attached the source code in case someone would like to have more detailed 
look. I would truly appreciate any help as to what might be wrong.

Thanks,

Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MIMRegistrator.txx
Type: text/x-c++src
Size: 7376 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/insight-users/attachments/20041129/173e23d0/MIMRegistrator.cc


More information about the Insight-users mailing list