[Insight-users] itkWarpVectorImageFilter

Bing Jian bjian at cise.ufl.edu
Wed Feb 23 20:22:54 EST 2005


Hi  Luis, 
         May I ask a request to update the itkWarpVectorImageFilter 
class which was added to ITK library last year?
First I would like to thank the author (Corinne Mattmann) for this 
contribution. Now I am using this class extensively
in my own program. But, as warned in the header file, this filter 
assumes that the input type, output type and deformation
field type all have the same number of dimensions, which restricts the 
usage of this class. However,  it turns out that it
is very simple to make it work in situations where image dimension maybe 
different from the dimension of pixel vector.

       Below is what I did.  First just defined a new ConstMacro in the 
header file:
 /** Determine the image dimension. */
  itkStaticConstMacro(PixelDimension, unsigned int,
                      PixelType::Dimension );
 
         and changed two places in the .txx file. The first one is in 
the constructor
  for (unsigned int i=0; i<ImageDimension; i++)
    {
    m_EdgePaddingValue[i] = 0;
    }
    ImageDimension ==> PixelDimension

     the next one is
             for( unsigned int k = 0; k < ImageDimension; k++ )
        {
        outputValue[k] = static_cast<ValueType>( interpolatedValue[k] );
        }
   again, change ImageDimension to PixelDimension.

      The above minor changes work fine from my own experience.  But it 
will cause
trouble when somebody else tries to compile my code. To make it convenient,
I really wish to see a quick update to this itkWarpVectorImageFilter class.
Thanks in advance!
   
  






-- 
Best wishes,
Bing Jian
bjian at cise.ufl.edu




More information about the Insight-users mailing list