<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 9pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
<PRE class=fragment><SPAN class=comment>Dear All, </SPAN></PRE><PRE class=fragment><SPAN class=comment>I read the code of <FONT size=2>itkMattesMutualInformationImageToImageMetric.txx, I notice that</FONT></SPAN></PRE><PRE class=fragment><SPAN class=comment><FONT size=2>when the joint pdf is updated the affected bins are pdfMovingIndex-1, pdfMovingIndex , </FONT></SPAN></PRE><PRE class=fragment><SPAN class=comment><FONT size=2>and pdfMovingIndex+1, while the fixedimage pdf is updated the affected bin is the FixedImageParzenWindowIndex.</FONT></SPAN></PRE><PRE class=fragment><SPAN class=comment><FONT size=2>The reason is the 3-order and zero-order BSpline kenel is used respectively.</FONT></SPAN></PRE><PRE class=fragment><SPAN class=comment><FONT size=2>Anyone can explain why the joint pdf is affected by 3 bins?</FONT></SPAN></PRE><PRE class=fragment><SPAN class=comment><FONT size=2>Thank you so much.</FONT></SPAN></PRE><PRE class=fragment><SPAN class=comment></SPAN>&nbsp;</PRE><PRE class=fragment><SPAN class=comment>00764// Since a zero-order BSpline (box car) kernel is used for</SPAN>
<A name=l00765></A>00765       <SPAN class=comment>// the fixed image marginal pdf, we need only increment the</SPAN>
<A name=l00766></A>00766       <SPAN class=comment>// fixedImageParzenWindowIndex by value of 1.0.</SPAN>
<A name=l00767></A>00767       m_FixedImageMarginalPDF[(*fiter).FixedImageParzenWindowIndex] += 
<A name=l00768></A>00768         <SPAN class=keyword>static_cast&lt;</SPAN>PDFValueType<SPAN class=keyword>&gt;</SPAN>( 1 );
<A name=l00769></A>00769         
<A name=l00783></A>00783       <SPAN class=comment>// Pointer to affected bin to be updated</SPAN>
<A name=l00784></A>00784       JointPDFValueType *pdfPtr = m_JointPDF-&gt;GetBufferPointer() +
<A name=l00785></A>00785                                    ( (*fiter).FixedImageParzenWindowIndex 
<A name=l00786></A>00786                                      * m_JointPDF-&gt;GetOffsetTable()[1] );
<A name=l00787></A>00787  
<A name=l00788></A>00788       <SPAN class=comment>// Move the pointer to the first affected bin</SPAN>
<A name=l00789></A>00789       <SPAN class=keywordtype>int</SPAN> pdfMovingIndex = <SPAN class=keyword>static_cast&lt;</SPAN><SPAN class=keywordtype>int</SPAN><SPAN class=keyword>&gt;</SPAN>( movingImageParzenWindowIndex ) - 1;
<A name=l00790></A>00790       pdfPtr += pdfMovingIndex;
<A name=l00791></A>00791 
<A name=l00792></A>00792       <SPAN class=keywordflow>for</SPAN> (; pdfMovingIndex &lt;= static_cast&lt;int&gt;( movingImageParzenWindowIndex )
<A name=l00793></A>00793                                 + 2;
<A name=l00794></A>00794             pdfMovingIndex++, pdfPtr++ )
<A name=l00795></A>00795         {
<A name=l00796></A>00796 
<A name=l00797></A>00797         <SPAN class=comment>// Update PDF for the current intensity pair</SPAN>
<A name=l00798></A>00798         <SPAN class=keywordtype>double</SPAN> movingImageParzenWindowArg = 
<A name=l00799></A>00799           <SPAN class=keyword>static_cast&lt;</SPAN><SPAN class=keywordtype>double</SPAN><SPAN class=keyword>&gt;</SPAN>( pdfMovingIndex ) - 
<A name=l00800></A>00800           static_cast&lt;double&gt;( movingImageParzenWindowTerm );
<A name=l00801></A>00801 
<A name=l00802></A>00802         *(pdfPtr) += static_cast&lt;PDFValueType&gt;( 
<A name=l00803></A>00803           m_CubicBSplineKernel-&gt;Evaluate( movingImageParzenWindowArg ) );
<A name=l00804></A>00804 
<A name=l00805></A>00805         }  <SPAN class=comment>//end parzen windowing for loop</SPAN>
<A name=l00806></A>00806 
<A name=l00807></A>00807       } <SPAN class=comment>//end if-block check sampleOk</SPAN>
<A name=l00808></A>00808     } <SPAN class=comment>// end iterating over fixed image spatial sample container for loop</SPAN></PRE><br /><hr />奥运圣火到哪里了?  <a href='http://msn.live.cn/ditu' target='_new'>点击查看!</a></body>
</html>