VectorResampleImageFilter on ITK5.0.1.

Hi everyone!

I used VectorResampleImageFilter to resample vector images by ITK 4.12.
And It isn’t working by ITK5.0.1. I’m trying with ResampleImageFilter to resample vector images. And I got error like that:
DeformableRegistration.hxx:1500:3: error: no matching function for call to ‘itk::ResampleImageFilter<itk::Image<itk::Vector<float, 3>, 3>, itk::Image<itk::Vector<float, 3>, 3>, double,double>::SetInterpolator(itk::VectorLinearInterpolateNearestNeighborExtrapolateImageFunction<itk::Image<itk::Vector<float, 3>, 3>, double>::Pointer&)’ resample->SetInterpolator( vectorInterpolate );
How i can fix that error?
Thank you so much!

Please use the NearestNeighborInterpolateImageFunction instead of the VectorLinearInterpolateNearestNeighborExtrapolateImageFunction.


Thanks so much!=)) I changed all my code! and i got the next error. Do you have any ideas for me?
DeformableRegistration.hxx:1134:5: error: no matching function for call to ‘itk::WarpVectorImageFilter<itk::Image<itk::Vector<float, 3>, 3>, itk::Image<itk::Vector<float, 3>, 3>, itk::Image<itk::Vector<float, 3>, 3> >::SetInterpolator(itk::NearestNeighborInterpolateImageFunction<itk::Image<itk::Vector<float, 3>, 3>, double>::Pointer)’
m_Warper->SetInterpolator( DefaultFieldInterpolatorType::New() );


Again the ResampleImageFilter should be used. Here is a commit where a couple examples were updated from the deprecated WarpImageFilter to using the powerful and flexible ResampleImageFilter with a DisplacementFieldTransform.

1 Like

Maybe we should update the migration guide with a link to this commit which is quite instructive?


For clarification WarpImageFilter and WarpVectorImageFilter are not deprecated (yet), but the ResampleImageFilter can perform the same operation as it recommended to be used instead.

@dzenanz Working on a PR to improve the guide now.

Edited: some how I missed the word not before deprecated :man_facepalming:


It means that WarpImageFilter and WarpVectorImageFilter are no longer used on ITK5. So, the best way is that I should replace WarpImageFilter and WarpVectorImageFilter with ResampleImageFilter?

1 Like

That is correct.

1 Like

Here is the PR to add this information to the migration guide:

1 Like