[Insight-users] NormalizedMutualInformationMetric

Luis Ibanez luis.ibanez at kitware.com
Mon May 12 11:49:40 EDT 2008


Hi Giorgos,

Thanks for posting your progress on this problem.

Here are some comments:

1) Yes, when using Normalized Mutual Information
    you should set the optimizer to "maximize".
    You are doing this right by calling
    "optimizer->MaximizeOn();"

    see for example

    Insight/Examples/Registration/ImageRegistration14.cxx


2) The Optimizer scales are definitely a good place
    to look for a culprit.

    With your current scale selection you are actually
    telling the optimizer to avoid changing the values
    of the Transform's center of rotation, which is a
    good thing.

    One thing you should try is replacing the

         itkCenteredSimilarity2DTransform

    with the

         itkSimilarity2DTransform

    The second one still offers the user the possibility
    of setting a customized a center of rotation, but
    as opposed to the first one, it doesn't include the
    center coordinates in the list of parameters to be
    optimized. In other words, with the second transform
    the optimizer will not try to change the center of
    rotation.

    Historical note: initially ITK transforms didn't
    provided a SetCenter() method. E.g. by default,
    all rotations and scalings were performed with
    respect to the origin (0,0).

    Later on we introduced the variants of Transform with
    center of rotation, and we called "Centered" transforms,
    however, we made the mistake of including the coordinate
    of the center of rotation in the list of parameters to
    optimize.

    Later on it was decided that almost all transforms
    needed a customizable center of rotation, and the
    functionality was added to the basic transform, but
    without inserting the coordinates of the center of
    rotation in to the parameters array.

    Allowing the optimizer to move the center of rotation
    makes the Transform to behave very unstably, and therefore
    should only be done by allowing the optimizer to make
    very small changes in the center of rotation (as you
    already discovered).

    Switching to the itkSimilarity2DTransform may alleviate
    some of the stability problems that you are facing.

    Please note that the Similarity2DTransform have *less*
    parameters. Only four, instead of the six parameters
    in the CenteredSimilarity2DTransform.

    Note also that the "Scale" and "Angle" parameters are
    still critical in this transforms and you should apply
    the same approach that you have used for the Centered
    transform. (e.g. using different optimizer scalings
    for these two first parameters of the Transform).



Please give it a try at this modification and
let us know how it works for you.


    Thanks


       Luis


---------------------
Giorgos Pichis wrote:
> Hi,
> I made some changes to the code,
> and it seems as it is having better results,
> but they are still far from the optimum.
> 
> I am using the BrainProtonDensitySlice.png  and 
> BrainProtonDensitySliceR10X13Y17S12.png from
> the examples data to test the algorithm.
> 
> As far as the metric parameters are concerned , I did the following changes:
> //////////////////////
>   const unsigned int numberOfParameters = 
> transform->GetNumberOfParameters();
> 
>   typedef MetricType::ScalesType ScalesType;
>   ScalesType scales( numberOfParameters );
> double t_scale;
> double center_scale;
>   //scales.Fill( 1.0 );
>     std::cout<<" enter center_scale : ";
>   std::cin>>center_scale;
>   std::cout<<" enter t_scale : ";
>   std::cin>>t_scale;
>   std::cout<<" enter scales[0] : "; //scaling
>   std::cin>>scales[0];
>  
>   std::cout<<" enter scales[1] : "; //angle
>   std::cin>>scales[1];
>  
>   //const double t_scale=0.1; //translation scale
>   //scales[0] =  10.0;
>   //scales[1] =  1.0;
>   scales[2] =  center_scale;
>   scales[3] =  center_scale;
>   scales[4] =  t_scale;
>   scales[5] =  t_scale;
> 
>    
>   metric->SetDerivativeStepLengthScales(scales);
>   metric->SetDerivativeStepLength(1.0);
> 
> /////////
> ... and had some relatively (to the previous ones) good results, using:
> center_scale :10000,
> t_scale: 0.1
> scale[0] :0.1  //for scaling
> scale[1] :1  //for the angle
> 
> Also the optimizer setting where changes to:
> 
> 
>   typedef OptimizerType::ScalesType       OptimizerScalesType;
>   OptimizerScalesType optimizerScales( transform->GetNumberOfParameters() );
>   const double translationScale = 1.0 / 100.0;
>   const double centerScale =1.0/100.0;
> 
>   optimizerScales[0] = 10.0;
>   optimizerScales[1] =  1.0;
>   optimizerScales[2] =  centerScale;
>   optimizerScales[3] =  centerScale;
>   optimizerScales[4] =  translationScale;
>   optimizerScales[5] =  translationScale;
> 
>   optimizer->SetScales( optimizerScales );
> 
>   double steplength = 1.0;
>  
>   if( argc > 9 )
>     {
>     steplength = atof( argv[9] );
>     }
>   optimizer->SetMaximumStepLength( steplength );
>   optimizer->SetMinimumStepLength( 0.00001 );
>   optimizer->SetNumberOfIterations( 500 );
>  optimizer->MaximizeOn(); //change
> .... using step lenght=0.5
> The algorithm exited, at iteration number 70,
> with
> Scale 1.00275
> Angle (radians) -0.160493
> Angle (degrees) -9.19556
> Center X = 90.318
> Center Y = 108.849
> Translation X=15.2579
> Translation Y= 15.4322
> Metric Value= 1.07114
> 
> Can I get some help , on what further changes should I do,
> in order to get better results?
> I had almost optimum results working with Mattes MI,
> Scale 0.832628
> Angle (radians) -0.174455
> Angle (degrees) -9.99554
> Center X = 87.1628
> Center Y = 107.813
> Translation X=7.37987
> Translation Y= 8.52768
> Metric Value= -1.42415,
> but I want to get familiar and work with NMI.
> What changes to the scales parameters, should I do?
> 
> Thanks in advance,
> Giorgos
> 
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list