[Insight-users] using the itk::ResampleImageFilter with deformation fields

Bill Lorensen bill.lorensen at gmail.com
Wed Feb 27 10:25:15 EST 2008


Lars,

Use itkVectorResampleImageFilter instead of itkResampleImageFilter.

Bill

On Wed, Feb 27, 2008 at 8:58 AM, Lars Friedrich <lars-friedrich at gmx.net> wrote:
> Hello ITK-users,
>
> I try to use the itk::ResampleImageFilter with deformation fields where
> the deformation field type is defined as follows:
> enum{Dimension2D = 2, Dimension = 3};
> typedef itk::Vector< float, Dimension > VectorType;
> typedef itk::Image< VectorType, Dimension > DefFieldType;
> typedef DefFieldType::Pointer DefFieldPointer;
>
> Then I try to transform (itk::Euler3DTransform<float>) this deformation
> field using the itk::ResampleImageFilter:
>
> typedef typename itk::ResampleImageFilter<ImgTp, ImgTp, float>
> ResampleFilterType;
> typedef typename itk::LinearInterpolateImageFunction <ImgTp, float>
> InterpolatorType;
> if (transform)
> { typename ResampleFilterType::Pointer resampler =
> ResampleFilterType::New();
> typename InterpolatorType::Pointer interpolator = InterpolatorType::New();
>
> resampler->SetInput(img);
> resampler->SetTransform(transform);
> resampler->SetInterpolator(interpolator);
>
> resampler->SetUseReferenceImage(true);
> resampler->SetReferenceImage(img);
> resampler->SetDefaultPixelValue(defaultPixelValue);
>
> img = resampler->GetOutput();
> resampler->Update();
> }
>
> Unfortunately this code cannot be compiled. Various error messages are
> displayed, e.g.
> "htToolkit-src/Insight/Code/BasicFilters/itkResampleImageFilter.txx:238:
> error: 'NonpositiveMin' is not a member of
> 'itk::NumericTraits<itk::Vector<float, 3u> >'".
> Obviously the used PixelType (the 3D vector) does not provide the needed
> operators/methods used by ResampleImageFilter.
>
> Can anyone tell me another way to transform a deformation field with 3D
> vector pixel type? Or do I have to decompose deformation field,
> transform the dimensions separately and then merge them again into one
> deformation field?
>
> regards,
> Lars
> _______________________________________________
> 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