# VectorResampleImageFilter on ITK5.0.1.

**URL:** https://discourse.itk.org/t/vectorresampleimagefilter-on-itk5-0-1/2308
**Category:** Uncategorized
**Created:** [October 8, 2019, 12:04pm UTC](https://discourse.itk.org/t/vectorresampleimagefilter-on-itk5-0-1/2308 "2019-10-08T12:04:48Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![hothao](https://discourse.itk.org/user_avatar/discourse.itk.org/hothao/32/923_2.png) [@hothao](https://discourse.itk.org/u/hothao)
#### Post date: [October 8, 2019, 12:04pm UTC](https://discourse.itk.org/t/vectorresampleimagefilter-on-itk5-0-1/2308/1 "2019-10-08T12:04:48Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)
#### Post date: [October 8, 2019, 12:56pm UTC](https://discourse.itk.org/t/vectorresampleimagefilter-on-itk5-0-1/2308/2 "2019-10-08T12:56:26Z")

</div>

Please use the [NearestNeighborInterpolateImageFunction](https://itk.org/Doxygen/html/classitk_1_1NearestNeighborInterpolateImageFunction.html) instead of the `VectorLinearInterpolateNearestNeighborExtrapolateImageFunction`.

---

<div class="post-metadata">

### Author: ![hothao](https://discourse.itk.org/user_avatar/discourse.itk.org/hothao/32/923_2.png) [@hothao](https://discourse.itk.org/u/hothao)
#### Post date: [October 9, 2019, 8:49am UTC](https://discourse.itk.org/t/vectorresampleimagefilter-on-itk5-0-1/2308/3 "2019-10-09T08:49:51Z")

</div>

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() );

Thanks!

---

<div class="post-metadata">

### Author: ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)
#### Post date: [October 9, 2019, 11:30am UTC](https://discourse.itk.org/t/vectorresampleimagefilter-on-itk5-0-1/2308/4 "2019-10-09T11:30:55Z")

</div>

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`.

> <https://github.com/InsightSoftwareConsortium/ITK/commit/b8dbc939ecb086b0e60faf4710657596553f643f#diff-1703fe5408b4ae95b1ea6d362848a9d6>

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [October 9, 2019, 1:54pm UTC](https://discourse.itk.org/t/vectorresampleimagefilter-on-itk5-0-1/2308/5 "2019-10-09T13:54:34Z")

</div>

Maybe we should update the [migration guide](https://github.com/InsightSoftwareConsortium/ITK/blob/master/Documentation/ITK5MigrationGuide.md#class-changes) with a link to this commit which is quite instructive?

---

<div class="post-metadata">

### Author: ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)
#### Post date: [October 9, 2019, 8:10pm UTC](https://discourse.itk.org/t/vectorresampleimagefilter-on-itk5-0-1/2308/6 "2019-10-09T20:10:45Z")

</div>

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 🤦‍♂️

---

<div class="post-metadata">

### Author: ![hothao](https://discourse.itk.org/user_avatar/discourse.itk.org/hothao/32/923_2.png) [@hothao](https://discourse.itk.org/u/hothao)
#### Post date: [October 10, 2019, 7:12am UTC](https://discourse.itk.org/t/vectorresampleimagefilter-on-itk5-0-1/2308/7 "2019-10-10T07:12:05Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [October 10, 2019, 2:29pm UTC](https://discourse.itk.org/t/vectorresampleimagefilter-on-itk5-0-1/2308/8 "2019-10-10T14:29:50Z")

</div>

That is correct.

---

<div class="post-metadata">

### Author: ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)
#### Post date: [October 10, 2019, 2:36pm UTC](https://discourse.itk.org/t/vectorresampleimagefilter-on-itk5-0-1/2308/9 "2019-10-10T14:36:21Z")

</div>

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

> <https://github.com/InsightSoftwareConsortium/ITK/pull/1311>
