[Insight-developers] itkOptMattesMutualInformationImageToImageMetric.txx question

Andrei Danilchenko andrei.v.danilchenko at vanderbilt.edu
Fri Mar 13 04:04:20 EDT 2009


Luis,

Initially I thought that JointPDFSum holds the number of the samples used in
computing the MI because of the way the values of m_jointPDF are normalized
by JointPDFSum in lines 695-706. My first guess was that m_jointPDF
initially contained histogram values and JointPDFSum contained the sum of
the histogram, e.g. the total amount of samples. This is of course wrong,
they contain totally different values. 

this->m_NumberOfMovingImageSamples worked for me, thanks for the tip. 

One more question about itkOptMattesMutualInformationImageToImageMetric.txx.
In comparison with itkMattesMutualInformationImageToImageMetric.txx, is it
optimized for smaller computation time or the difference between them is the
structure of the class? Do you know how much faster ITK version of MattesMI
performs in comparison with the corresponding code in Matlab?

Thanks,
Andrei.


-----Original Message-----
From: Luis Ibanez [mailto:luis.ibanez at kitware.com] 
Sent: Monday, March 09, 2009 6:18 PM
To: Danilchenko, Andrei Viktorovich
Cc: insight-developers at itk.org
Subject: Re: [Insight-developers]
itkOptMattesMutualInformationImageToImageMetric.txx question


Hi Andrei,

As part of the MattesMutualInformation metric refactoring that was performed
in the Insight/Code/Review directory, the functionality of sampling pixels
from the FixedImage was moved to the parent class:

                itkOptImageToImageMetric.h
                itkOptImageToImageMetric.txx

In that class,
you want to look at the methods:

         SetNumberOfFixedImageSamples( unsigned int N )
         SetNumberOfMovingImageSamples( unsigned int N )


The default number of Fixed samples is 50000.
(see the file itkOptImageToImageMetric.txx, line 35).


The internal variables that you are looking for in
itkOptMattesMutualInformationImageToImageMetric.txx
are

       this->m_NumberOfMovingImageSamples
       this->m_NumberOfFixedImageSamples


---


I'm confused as to why you seem to be expecting the JointPDFSum number to be
an integer, and to be related to the number of samples.


Can you elaborate on why you are expecting that to be the case ?


    Thanks


      Luis


---------------------------------------
Danilchenko, Andrei Viktorovich wrote:
> Hello, developers.
> 
> I need some help understanding how
> itkOptMattesMutualInformationImageToImageMetric.txx works. I need to 
> know the number of samples used for computing MI in GetValue() 
> function. In itkMattesMutualInformationImageToImageMetric.txx variable 
> nSamples is used for this purpose. But in 
> itkOptMattesMutualInformationImageToImageMetric.txx there is no such 
> variable. Logically, m_JointPDFSum should contain the number of 
> samples used to compute MI. Is that right?
> 
> I tried running a program using these two implementations of Mattes MI 
> and output nSamples and m_JointPDFSum. For the same images nSamples 
> was about
> 6 000 000, but m_JointPDFSum was just about 40 000 (moreover, in some 
> cases it was not an integer). So, I guess my assumption that 
> m_JointPDFSum shows the number of samples used to compute MI is not 
> right. In this case could you give me a hint how to find this number?
> 
> Thanks,
> Andrei.
> 
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.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-developers
> 



More information about the Insight-developers mailing list