[Insight-users] Is it a mistake in itkMutualInformationImageToImageMetric.cxx

庄吓海 arhye at 163.com
Fri Apr 15 10:14:45 EDT 2005


 
in the this method in class MutualInformationImageToImageMetric:: 

GetValueAndDerivative(
  const ParametersType& parameters,
  MeasureType& value,
  DerivativeType& derivative) 
{
   ...
  for( biter = m_SampleB.begin(); biter != bend; ++biter )
    {
     ...
    for( aiter = m_SampleA.begin(); aiter != aend; ++aiter )
      {... 
      } // end of sample A loop
		...
    for( aiter = m_SampleA.begin(), aditer = sampleADerivatives.begin();
         aiter != aend; ++aiter, ++aditer )
      {
      double valueFixed;
      double valueMoving;
      double weightMoving;
      double weightJoint;
      double weight;

      valueFixed = ( (*biter).FixedImageValue - (*aiter).FixedImageValue ) /
        m_FixedImageStandardDeviation;
      valueFixed = m_KernelFunction->Evaluate( valueFixed );

      valueMoving = ( (*biter).MovingImageValue - (*aiter).MovingImageValue ) /
        m_MovingImageStandardDeviation;
      valueMoving = m_KernelFunction->Evaluate( valueMoving );

      weightMoving = valueMoving / dDenominatorMoving;  
      weightJoint = valueMoving * valueFixed / dDenominatorJoint;

      weight = ( weightMoving - weightJoint );
      weight *= (*biter).MovingImageValue - (*aiter).MovingImageValue; //*********************************** please check here***********
      //according to the paper Alignment by Maximization of Mutual Information of Paul Viola, 
      //here should need weight = weight / (m_FixedImageStandardDeviation*m_FixedImageStandardDeviation);
      // could you tell me why here omit standard diviation or it is a mistake ? --------:) Thanks!

      totalWeight += weight;
      derivative -= (*aditer) * weight;

      } // end of sample A loop

    derivative += derivB * totalWeight;  

    } // end of sample B loop


	

        致
礼!
 				

        庄吓海
        arhye at 163.com
          2005-04-15





More information about the Insight-users mailing list