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

Lydia Ng lydiang at gmail.com
Tue Aug 2 19:45:35 EDT 2005


Hi,

The division by(m_FixedImageStandardDeviation*m_FixedImageStandardDeviation)
*is* taken into account. Instead of doing the division by this
constant value (N*N) times inside the nested loop, it is done once at
then end (line 398):

derivative  /= vnl_math_sqr( m_MovingImageStandardDeviation );

-Lydia


On 4/15/05, Luis Ibanez <luis.ibanez at kitware.com> wrote:
> 
> Hi 庄吓海 ,
> 
> Thanks for pointing this out.
> 
> There seems to be a dimensional inconsistency at this level,
> however, using a square standard deviation will not fix it.
> 
> The "weight" variable should be adimnesional, therefore it
> looks like the division should be by a single standard
> deviation.
> 
> 
> Could you please report this as a bug in the Bug tracker ?
> 
> 
>              http://www.itk.org/Bug/
> 
> 
>  Thanks
> 
> 
>     Luis
> 
> 
> 
> ----------------------------------
> 
> 庄吓海 wrote:
> 
> >
> > 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
> >
> >
> >
> > _______________________________________________
> > Insight-users mailing list
> > Insight-users at itk.org
> > http://www.itk.org/mailman/listinfo/insight-users
> >
> >
> 
> 
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>


More information about the Insight-users mailing list