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

Julien Jomier jjomier at cs.unc.edu
Mon Nov 29 12:17:47 EST 2004


Hi Martin,

This type of exception means that the optimizer is going too far in the
parameters space.

One thing you can try to adjust for the 1+1 optimizer is the initial radius.
Basically this optimizer is doing a random search of the parameters and
start with an initial radius, meaning, for instance, that if your initial
radius is 40 the first iteration will optimize each parameters in the range
[-40,40] around th e initial parameter values. I'm confident that this is
your problem since you are optimizing a quaternion transform with such a
range... Try to decrease the initialRadius of optimizer (initialRadius =
1?).

Also you might want to change the scaling such that initialRadius/scaling is
within a "correct" range.

Hope that helps,

Julien

> -----Original Message-----
> From: insight-users-bounces at itk.org 
> [mailto:insight-users-bounces at itk.org] On Behalf Of Martin Kavec
> Sent: Monday, November 29, 2004 10:03 AM
> To: insight-users at itk.org
> Subject: [Insight-users] Lost in registration: NMI and 1+1
> 
> 
> 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/itkHistogramImageToImag
> eMetric.txx
> Line: 255
> Description: itk::ERROR: 
> NormalizedMutualInformationHistogramImageToImageMetric(0x81003
> f0): 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
> 



More information about the Insight-users mailing list