[Insight-users] questions on MattesMutualInformation

Stefan Klein stefan at isi.uu.nl
Wed Apr 5 10:22:56 EDT 2006


Hi,

Am I misunderstanding something or are the following lines contradicting:

itkMattesMutualInformationImageToImageMetric.txx:

line 272
// For the joint PDF define a region starting from {0,0}
// with size {m_NumberOfHistogramBins, m_NumberOfHistogramBins}.
// The dimension represents fixed image parzen window index
// and moving image parzen window index, respectively.

vs.

line 669 and line 928
      /**
         * The region of support of the parzen window determines which bins
         * of the joint PDF are effected by the pair of image values.
         * Since we are using a cubic spline for the moving image parzen
         * window, four bins are affected.  The fixed image parzen window is
         * a zero-order spline (box car) and thus effects only one bin.
         *
         *  The PDF is arranged so that moving image bins corresponds to the
         * zero-th (column) dimension and the fixed image bins corresponds
         * to the first (row) dimension.
         *
         */

 From the code it seems to me that the line 669/928 is correct.

Regarding the joint PDF derivatives matrix:

it says this:
line 286:
// For the derivatives of the joint PDF define a region starting from {0,0,0}
   // with size {m_NumberOfParameters,m_NumberOfHistogramBins,
   // m_NumberOfHistogramBins}. The dimension represents transform parameters,
   // fixed image parzen window index and moving image parzen window index,
   // respectively.

but if I understand the offset thing correctly, i would say that 'fixed' 
and 'moving' are interchanged in the explanation:

line 1118
  // move joint pdf derivative pointer to the right position
         JointPDFValueType * derivPtr = 
m_JointPDFDerivatives->GetBufferPointer() +
           ( fixedIndex * m_JointPDFDerivatives->GetOffsetTable()[2] ) +
           ( movingIndex * m_JointPDFDerivatives->GetOffsetTable()[1] );


And, just to understand, is line 1118 equivalent to the following?:

       IndexType index= {{0, movingIndex, fixedIndex}};
         JointPDFValueType * derivPtr = 
m_JointPDFDerivatives->GetBufferPointer()
	+ m_JointPDFDerivatives->ComputeOffset(index);

and is there any reason to not do it like this? (speed?)

Thanks in advance!
Stefan.









More information about the Insight-users mailing list