[Insight-users] SampleFixedImageDomian in MIImageToImageMetric, ***why mapping fiximage to movImage***

庄吓海 arhye at 163.com
Mon Apr 11 05:19:21 EDT 2005


insight-users,您好!


MutualInformationImageToImageMetric< TFixedImage,TMovingImage> 
::SampleFixedImageDomain(
  SpatialSampleContainer& samples ) const
{
.............................
  for( iter = samples.begin(); iter != end; ++iter )
    {
    // get sampled index
    FixedImageIndexType index = randIter.GetIndex();

    // get sampled fixed image value
    (*iter).FixedImageValue = randIter.Get(); 

    // get moving image value
    m_FixedImage-> TransformIndexToPhysicalPoint( index, 
                                                 (*iter).FixedImagePointValue ); 


    //here, Transform should taking movImage to fixImage, why here uses just the opposite direction.
    MovingImagePointType mappedPoint =  m_Transform-> TransformPoint( (*iter).FixedImagePointValue );


 



    if( m_Interpolator-> IsInsideBuffer( mappedPoint ) )
      {
      (*iter).MovingImageValue = m_Interpolator-> Evaluate( mappedPoint ); 
      allOutside = false;
      }
    else
      {
      (*iter).MovingImageValue = 0;//出界点
      }

    // jump to random position
    ++randIter; 
    } 
  if( allOutside )
    {
    // if all the samples mapped to the outside throw an exception
    itkExceptionMacro(< < "All the sampled point mapped to outside of the moving image" );
    } 
 } 

        致
礼!
 

        庄吓海
        arhye at 163.com
          2005-04-11
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20050411/4394e51d/attachment.html


More information about the Insight-users mailing list