[Insight-users] Modifying Mattes MI to provide a Normalized MI

Tomáš Kazmar Tomash.Kazmar at seznam.cz
Mon Nov 26 07:01:19 EST 2012


Hi Jose,




(2) is one of the ways to compute mutual information, you get it from the 
definition by using the properties of log function and marginalization in 
the summands you get.





However, I think the class you want to create already exists, I havent used 
ITK for some time, but it should be called 
NormalizedMutualInformationHistogramImageToImageMetric.




Best,

T.



---------- Původní zpráva ----------
Od: Josem <jose at apollomit.com>
Datum: 26. 11. 2012
Předmět: [Insight-users] Modifying Mattes MI to provide a Normalized MI
"Hello, 
I have searched around the web for answers but i am still stuck with this
issue:
I am trying to modify the itkMattesMutualInformationImageToImageMetric.hxx
file to provide the Normalized Mutual Information.
I found this post:
http://public.kitware.com/pipermail/insight-users/2006-May/017911.html
(http://public.kitware.com/pipermail/insight-users/2006-May/017911.html)
Where they say that I should modify the lines 815-832, but i think the post
is outdated.

I also checked the GetValue() Method, and i think that's the method i have
to modify. But i can't figure it out.
Here are the lines where i think i should modify the code:

/**
* Compute the metric by double sumdation over histogram.
*/

// Setup pointer to point to the first bin
JointPDFValueType *jointPDFPtr =
this->m_ThreaderJointPDF[0]->GetBufferPointer();

PDFValueType sum = 0.0;
for( unsigned int fixedIndex = 0;
fixedIndex < this->m_NumberOfHistogramBins;
++fixedIndex )
{
const PDFValueType fixedImagePDFValue =
this->m_ThreaderFixedImageMarginalPDF[0][fixedIndex];
for( unsigned int movingIndex = 0;
movingIndex < this->m_NumberOfHistogramBins;
++movingIndex, jointPDFPtr++ )
{
const PDFValueType movingImagePDFValue =
this->m_MovingImageMarginalPDF[movingIndex];
const PDFValueType jointPDFValue = *( jointPDFPtr );

// check for non-zero bin contribution
static const PDFValueType closeToZero =
vcl_numeric_limits<PDFValueType>::epsilon();
if( jointPDFValue > closeToZero && movingImagePDFValue > closeToZero
)
{
const PDFValueType pRatio = vcl_log(jointPDFValue /
movingImagePDFValue);
if( fixedImagePDFValue > closeToZero )
{
sum += jointPDFValue * ( pRatio - vcl_log(fixedImagePDFValue) );
}
} // end if-block to check non-zero bin contribution
} // end for-loop over moving index
} 


But i don't know where should i modify the computation to do this:
(1) NMI = ( Ha + Hb ) / Hab
instead of this computation:
(2) MI = Ha + Hb - Hab

Basically i don't get where computation (2) is going on.

thanks in advance,
Jose





--
View this message in context: http://itk-users.7.n7.nabble.com/Modifying-
Mattes-MI-to-provide-a-Normalized-MI-tp30155.html
(http://itk-users.7.n7.nabble.com/Modifying-Mattes-MI-to-provide-a-Normalized-MI-tp30155.html)
Sent from the ITK - Users mailing list archive at Nabble.com.
_____________________________________
Powered by www.kitware.com(http://www.kitware.com)

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
(http://www.kitware.com/opensource/opensource.html)

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php
(http://www.kitware.com/products/protraining.php)

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ(http://www.itk.org/Wiki/ITK_FAQ)

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users
(http://www.itk.org/mailman/listinfo/insight-users)"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20121126/b30a031b/attachment.htm>


More information about the Insight-users mailing list