[Insight-users] problems using itkVectorResampleImageFilter
Luis Ibanez
luis.ibanez at kitware.com
Thu Sep 13 08:09:08 EDT 2007
Tomas,
This is a tricky one....
The VectorInterpolateImageFunction class assumes that the
output of the computation is going to be stored in a FixedArray
and therefore it needs to know the dimension at *compile time*.
The VariableLengthVector class doesn't know its dimension at
compile time. In fact, it can change at run time.
We could modify the VectorInterpolateImageFunction in order to
use as output a NumericTrait of the pixel type from the input
image.
Something like (pseudocode)
NumericTraits< typename InputImage::PixelType >::RealType
The NumericTraits::RealType of VariableLengthVector
is available in the file:
Insight\Code\Common\itkNumericTraitsVariableLengthVectorPixel.h
---
That being said, I think a while ago Karthik reworked the
InterpolateImageFunction itself so that it could manage a
VectorImage. That means that you could use the "normal"
ResampleImageFilter in order to process a VectorImage
(this is just a vague memory, and it is too early in the
morning to assure you that this actually happened...)
Please enter a report for this problem in the BugTracker.
http://public.kitware.com/Bug/my_view_page.php
We should start by adding a test to excercise resampling
on a Vector image (different types of them eg. image of
RGB pixels, image of Vectors, and a VectorImage<float,dim> ).
Thanks
Luis
---------------------
Tomáš Kazmar wrote:
> It is kind of silly because there is already Size() and
> GetNumberOfElements() that return the same information
> and it is called statically from the filter:
>
> const unsigned int numberOfComponents =
> PixelType::GetNumberOfComponents();
>
> ...but it seems it would make it work:)
>
> Tomas
>
> # It may be silly, but would it be possible to add a #
> GetNumberOfComponents() in the VariableLengthVector class, which #
> return the number of components at runtime ?
> # # Gaëtan
> # # # Le 12 sept. 07 à 21:26, Dan Mueller a écrit :
> # # > Hi Yogesh,
> # >
> # > It seems the VectorResampleImageFilter requires a pixel type which has
> # > the number of dimensions defined at compile time, not run-time: any
> # > type derived from FixedArray should work (eg. Vector,
> # > CovariantVector). I'm not exactly sure why -- it's a little outside my
> # > realm of knowledge. Any other takers?
> # >
> # > It should be possible to implement a templated function which can
> # > delegate to a filter with the correct number of dimensions at
> # > run-time:
> # > Eg. see http://public.kitware.com/pipermail/insight-users/2002- #
> > June/000513.html
> # >
> # > HTH
> # >
> # > Cheers, Dan
> # >
> # > On 13/09/2007, Yogesh Rathi <yogesh.rathi at gmail.com> wrote:
> # >> Anybody noticed compilation problems when using # >>
> itkVectorResampleImageFilter
> # >> ?
> # >>
> # >> I am getting the following errors when I use this filter:
> # >>
> # >> itkVectorInterpolateImageFunction.h:35: error: 'Dimension'
> # >> is not a member of 'itk::VariableLengthVector<float>'
> # >>
> # >> error: no matching function for call to
> # >> 'itk::VectorResampleImageFilter<itk::VectorImage<float,
> # >> 3u>, itk::VectorImage<float, 3u>,
> # >> double>::SetTransform # >>
> (itk::SmartPointer<itk::CenteredAffineTransform<float,
> # >> 3u> >&)'
> # >>
> # >> itkVectorResampleImageFilter.h:120: note: candidates are: void
> # >> itk::VectorResampleImageFilter<TInputImage, TOutputImage,
> # >> TInterpolatorPrecisionType>::SetTransform(const
> # >> itk::Transform<TInterpolatorPrecisionType,
> # >>
> itk::VectorResampleImageFilter<TInputImage,TOutputImage,TInterpolator #
> >> PrecisionType>::ImageDimension,
> # >>
> itk::VectorResampleImageFilter<TInputImage,TOutputImage,TInterpolator #
> >> PrecisionType>::ImageDimension>*)
> # >> [with TInputImage = itk::VectorImage<float, 3u>, TOutputImage =
> # >> itk::VectorImage<float, 3u>, TInterpolatorPrecisionType = double]
> # >>
> # >> itkVectorResampleImageFilter.txx:175: error:
> # >> 'GetNumberOfComponents' is not a member of
> # >> 'itk::VariableLengthVector<float>'
> # >>
> # >> Thanks in advance,
> # >>
> # >> Yogesh
> # > _______________________________________________
> # > Insight-users mailing list
> # > Insight-users at itk.org
> # > http://www.itk.org/mailman/listinfo/insight-users
> # # --
> # Gaëtan Lehmann
> # Biologie du Développement et de la Reproduction
> # INRA de Jouy-en-Josas (France)
> # tel: +33 1 34 65 29 66 fax: 01 34 65 29 09
> # http://voxel.jouy.inra.fr
> # # # # # # _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
More information about the Insight-users
mailing list