[Insight-users] Normalized Mutual Information Metric Methods

Luis Ibanez luis.ibanez at kitware.com
Wed Dec 2 18:10:10 EST 2009


Hi Oscar,


A)  Your interpretation of the Lower Bound is correct.

By setting the values of LowerBound, you can exclude certain pixels from
participating in the computation of the metric. More specifically, you can
exclude the pixels whose intensities are below the values that you set
in the lowerbound array.

The value of lowerbound[0] will apply to the Fixed image intensities, and
The value of lowerbound[1] will apply to the Moving image intensities.


For details, you can take a look at the file:

    Insight/Code/Algorithms/itkHistogramImageToImageMetric.txx

in line 286. where the values are used to initialize the internal
histogram.



B) Your interpretation of the PaddingValue is consistent with
    the documentation of the class... but....  when looking
    at the code it does not seem to be doing the same thing.



    To be more specific:

     The documentation claims that values of the fixed image
     that are equal to the padding value will be excluded from
     the metric computation.

     However, the way the PaddingValue is used in the code
     is in lines 281-298:


  FixedIteratorType ti( fixedImage, fixedRegion );

 ...
  ti.GoToBegin();
  while ( !ti.IsAtEnd() )
    {
    index = ti.GetIndex();

    if (fixedRegion.IsInside(index) &&
        (!m_UsePaddingValue ||
         (m_UsePaddingValue && ti.Get() > m_PaddingValue)))
      {
      InputPointType inputPoint;
      fixedImage->TransformIndexToPhysicalPoint(index, inputPoint);



   where, clearly, all (Fixed) pixel values that are LESS-OR-EQUAL
   to the padding value, are being excluded from the
   computation of the metric.  This seems indeed to be
   redundant with the option of setting the lower bounds.

   We could claim that it is a bug in the documentation,
  or that it is a bug in the code.

   Probably the larger question is:


         Is it useful one way or  the other ?


    From what I can tell, if you are already using the LowerBound setting,
    there is no reason for also using the Paddding Value.



       Luis


-------------------------------------------------------------------------------------------
On Wed, Dec 2, 2009 at 5:41 AM, Oscar Esteban Sanz-Dranguet
<oesteban at die.upm.es> wrote:
> Hi all,
>
> I would like to know some more detailed explanations about:
>
> <classitk_1_1ImageToImageMetric.html#7d192f58b6309c49ee01e47755faff03>SetLowerBound
> <classitk_1_1HistogramImageToImageMetric.html#b5e45cc3a80fcffed1b2c70829e72b74>
> (const MeasurementVectorType
> <classitk_1_1HistogramImageToImageMetric.html#a7b6843f20b65a03080d04e59fe8c643>
> &bound)
> SetPaddingValue
> <classitk_1_1HistogramImageToImageMetric.html#dc09073b2abf349f30562fb6de7d76ce>
> (FixedImagePixelType
> <classitk_1_1HistogramImageToImageMetric.html#88126fc413c29ba48f029e49d57d2444>
> _arg)
>
> I've looked for it on the Software Guide, but I didn't found anything.
>
> This is my guess: SetLowerBound lets you to set two pixel values for fixed
> and moving images so that below them, the sample will be ignored on metric
> computation. Its use would be like this:
>
>       // Initialization of n_init_metric and typedefs
>
>       NMIMetric::HistogramType::SizeType histogramSize;
>       histogramSize[0]=HISTOGRAM_BINS;
>       histogramSize[1]=HISTOGRAM_BINS;
>       m_init_metric->SetHistogramSize( histogramSize );
>
>       NMIMetric::MeasurementVectorType lBound;
>       lBound[0] = lBound[1] = vcl_ceil(
> std::numeric_limits<ImageType::PixelType>::max()/(HISTOGRAM_BINS*1.0) );
>       m_init_metric->SetLowerBound( lBound );
>
> With this code, I'm trying to ignore the bin 0 for metric computation. You
> could set some fixed values, e.g.:
>
>       lBound[0] = 132; // Ignore values on FIXED image under 132
>       lBound[1] = 50; // Ignore values on MOVING image under 50
>       m_init_metric->SetLowerBound( lBound );
>
> Is it all right?
>
> And, then, focusing on SetPaddingValue: I interpret from documentation that
> you can set a value on fixed image that will not be used for metric
> computation (e. g. using padding value 80, any pixel with that value will be
> ignored).
>
> Thanks in advance. Cheers,
>
> --
> Oscar Esteban
> BIT - UPM (http://www.die.upm.es/im/)
> +34 913 366 827 ext.4248
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>


More information about the Insight-users mailing list