[Insight-developers] [Insight-users] Interpolation and resampling templates

Karthik Krishnan karthik.krishnan at kitware.com
Thu Mar 5 08:18:32 EST 2009


Emmanuel:

The patch looks good. If could also contribute a minimal test to resample
std::complex images, that would be perfect.

Thanks
Regrads
--
karthik

On Wed, Mar 4, 2009 at 11:57 PM, Emmanuel Christophe <
emmanuel.christophe at gmail.com> wrote:

> Hi again,
>
> Attached is a patch to solve these issues (see below) with the
> itkResampleImageFilter and the itkOptResampleImageFilter. They can now
> be applied to itk::Image<std::complex<double>,2>. I believe that it is
> also a step in the right direction to apply them to itk::VectorImage
> (but I did not have the time to tried). The patch is to be applied
> against the CVS version.
>
> This does not modify the previous behavior with scalar pixels or the
> filter interface. All itk tests (including Examples) still pass with
> the ITK_USE_OPTIMIZED_REGISTRATION and the ITK_USE_REVIEW options ON
> or OFF.
>
> Best regards,
> Emmanuel
>
>
> 2009/3/2 Emmanuel Christophe <emmanuel.christophe at gmail.com>:
> > Hi,
> >
> > I'm having some trouble with the templates for the ResampleImageFilter
> > and the InterpolateImageFunction.
> >
> > The ResampleImageFilter is defined as
> > template <class TInputImage, class TOutputImage,
> >          class TInterpolatorPrecisionType=double>
> > class ITK_EXPORT ResampleImageFilter:
> >    public ImageToImageFilter<TInputImage, TOutputImage>
> >
> > In this definition TInterpolatorPrecisionType refers as the pixel
> > precision (Image::PixelType). The class description gives the example
> > of a labeled image where it is not desired to interpolate the values.
> >
> > On the other hand, for the InterpolateImageFunction we have:
> > template <class TInputImage, class TCoordRep = double>
> > class ITK_EXPORT InterpolateImageFunction :
> >  public ImageFunction< TInputImage,
> >    ITK_TYPENAME NumericTraits<typename
> > TInputImage::PixelType>::RealType, TCoordRep >
> >
> > Here the second template (TCoordRep) describes the precision of the
> > coordinates (hence, similar to the Image::PointType::ValueType).
> >
> > However, in the definition of the ResampleImageFilter, there is the
> > following typedef:
> > typedef InterpolateImageFunction<InputImageType,
> > TInterpolatorPrecisionType> InterpolatorType;
> >
> > Which assumes that the precision of the pixel value is the same as the
> > precision of the coordinates. I'm running into this problem when I'm
> > trying to interpolate complex images (PixelType is
> > std::complex<double> but the coordinate are obviously still double).
> >
> > In the ResampleImageFilter filter, the same default for the coordinate
> > precision as in the itk::ImageBase could be assumed, replacing the
> > typedef by:
> > typedef InterpolateImageFunction<InputImageType, double>
> InterpolatorType;
> >
> > or keeping the InterpolateImageFunction default:
> > typedef InterpolateImageFunction<InputImageType> InterpolatorType;
> >
> > As the itk::Transform is templated over the coordinate precision also,
> > I assume the typedef of the TransformType should be corrected in the
> > same way.
> >
> > Am I missing something here ?
> >
> > Best regard,
> > Emmanuel
> >
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>


-- 
Karthik Krishnan
R&D Engineer,
Kitware Inc.
Ph: 518 371 3971 x119
Fax: 518 371 3971
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20090305/3133dc22/attachment.htm>


More information about the Insight-developers mailing list