[Insight-users] ModelToImageRegistration

Bradley Lowekamp blowekamp at mail.nih.gov
Fri Apr 14 14:44:26 EDT 2006


I am confused by the transformations going on in the example  
ModelToImageRegistration.cxx with regards to the custom Metric. Here  
are some highlights of the code:

In SetMovingSpacialObject():
       ...
       typedef itk::ImageRegionConstIteratorWithIndex<TFixedImage>  
myIteratorType;
       myIteratorType it(this->m_FixedImage,this->m_FixedImage- 
 >GetBufferedRegion());
       itk::Point<double,2> point;
       while(!it.IsAtEnd())
         {
         for(unsigned int i=0;i<Self::ObjectDimension;i++)
           {
           point[i]=it.GetIndex()[i];
           }

         if(this->m_MovingSpatialObject->IsInside(point,99999))
           {
           m_PointList.push_back(point);
           }
         ++it;
	....
In GetValue():
        ...
        PointListType::const_iterator it = m_PointList.begin();
        ...
        while(it != m_PointList.end())
         {
         PointType transformedPoint = this->m_Transform- 
 >TransformPoint(*it);
         this->m_FixedImage->TransformPhysicalPointToIndex 
(transformedPoint,index);
         ...

I have been reading and rereading the relevant sections in the ITK  
software guide book, especially the "Direction of the Transform  
Mapping". I believe I understand the usage and direction of the  
transformations is the registration process. Perhaps this is a poor  
example, which takes some short cuts. But this is my understanding of  
this code:

The created m_PointList contains a points in "image grid" space.  
(Slightly ambiguous as to which since the two are already aligned).

Then the m_Transform is applied. This transform maps points from  
physical space of the fixed image to the physical space of the moving  
model according to the definition of said transform. (We can overlook  
the lack of image grid to physical space transformation since it is  
the identity in both cases.) So "transformedPoint" ought to be in the  
physical space of the moving model.

Last the fixed image's physical to image grid index transform is  
applied. So "transformedPoint" must be in fixed image's physical space.

So this is a contradiction, and I am confused. What am I missing here?

Thanks,
Brad


More information about the Insight-users mailing list