Emmanuel:<br><br>The patch looks good. If could also contribute a minimal test to resample std::complex images, that would be perfect. <br><br>Thanks <br>Regrads<br>--<br>karthik<br><br><div class="gmail_quote">On Wed, Mar 4, 2009 at 11:57 PM, Emmanuel Christophe <span dir="ltr"><<a href="mailto:emmanuel.christophe@gmail.com">emmanuel.christophe@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi again,<br>
<br>
Attached is a patch to solve these issues (see below) with the<br>
itkResampleImageFilter and the itkOptResampleImageFilter. They can now<br>
be applied to itk::Image<std::complex<double>,2>. I believe that it is<br>
also a step in the right direction to apply them to itk::VectorImage<br>
(but I did not have the time to tried). The patch is to be applied<br>
against the CVS version.<br>
<br>
This does not modify the previous behavior with scalar pixels or the<br>
filter interface. All itk tests (including Examples) still pass with<br>
the ITK_USE_OPTIMIZED_REGISTRATION and the ITK_USE_REVIEW options ON<br>
or OFF.<br>
<br>
Best regards,<br>
Emmanuel<br>
<br>
<br>
2009/3/2 Emmanuel Christophe <<a href="mailto:emmanuel.christophe@gmail.com">emmanuel.christophe@gmail.com</a>>:<br>
> Hi,<br>
><br>
> I'm having some trouble with the templates for the ResampleImageFilter<br>
> and the InterpolateImageFunction.<br>
><br>
> The ResampleImageFilter is defined as<br>
> template <class TInputImage, class TOutputImage,<br>
> class TInterpolatorPrecisionType=double><br>
> class ITK_EXPORT ResampleImageFilter:<br>
> public ImageToImageFilter<TInputImage, TOutputImage><br>
><br>
> In this definition TInterpolatorPrecisionType refers as the pixel<br>
> precision (Image::PixelType). The class description gives the example<br>
> of a labeled image where it is not desired to interpolate the values.<br>
><br>
> On the other hand, for the InterpolateImageFunction we have:<br>
> template <class TInputImage, class TCoordRep = double><br>
> class ITK_EXPORT InterpolateImageFunction :<br>
> public ImageFunction< TInputImage,<br>
> ITK_TYPENAME NumericTraits<typename<br>
> TInputImage::PixelType>::RealType, TCoordRep ><br>
><br>
> Here the second template (TCoordRep) describes the precision of the<br>
> coordinates (hence, similar to the Image::PointType::ValueType).<br>
><br>
> However, in the definition of the ResampleImageFilter, there is the<br>
> following typedef:<br>
> typedef InterpolateImageFunction<InputImageType,<br>
> TInterpolatorPrecisionType> InterpolatorType;<br>
><br>
> Which assumes that the precision of the pixel value is the same as the<br>
> precision of the coordinates. I'm running into this problem when I'm<br>
> trying to interpolate complex images (PixelType is<br>
> std::complex<double> but the coordinate are obviously still double).<br>
><br>
> In the ResampleImageFilter filter, the same default for the coordinate<br>
> precision as in the itk::ImageBase could be assumed, replacing the<br>
> typedef by:<br>
> typedef InterpolateImageFunction<InputImageType, double> InterpolatorType;<br>
><br>
> or keeping the InterpolateImageFunction default:<br>
> typedef InterpolateImageFunction<InputImageType> InterpolatorType;<br>
><br>
> As the itk::Transform is templated over the coordinate precision also,<br>
> I assume the typedef of the TransformType should be corrected in the<br>
> same way.<br>
><br>
> Am I missing something here ?<br>
><br>
> Best regard,<br>
> Emmanuel<br>
><br>
<br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at: <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Karthik Krishnan<br>R&D Engineer,<br>Kitware Inc.<br>Ph: 518 371 3971 x119<br>Fax: 518 371 3971<br>