# Bi variate polynomial warping filter?

**URL:** <https://discourse.itk.org/t/bi-variate-polynomial-warping-filter/3512>\
**Category:** Algorithms\
**Created:** [October 5, 2020, 12:46am UTC](https://discourse.itk.org/t/bi-variate-polynomial-warping-filter/3512 "2020-10-05T00:46:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rfrank](https://discourse.itk.org/user_avatar/discourse.itk.org/rfrank/32/2977_2.png) [@rfrank](https://discourse.itk.org/u/rfrank)\
**Post date:** [October 5, 2020, 12:46am UTC](https://discourse.itk.org/t/bi-variate-polynomial-warping-filter/3512/1 "2020-10-05T00:46:25Z")

</div>

I have coefficients a b for a polynomial  
X = a0 + a1x + a2y +a3xy + a4x^2 + a5y^2  
Y = b0 +b1x + b2y + b3xy + b4x^2 + b5y^2

I would imagine there is an ITK filter for this type of transformation but I don’t seem to find it,

Can someone tell me which filter would work for this warping?

Thanks

Rick

---

<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 5, 2020, 1:34pm UTC](https://discourse.itk.org/t/bi-variate-polynomial-warping-filter/3512/2 "2020-10-05T13:34:43Z")

</div>

Are you looking to optimize this type of transformation?

- I am not aware of such an existing transformation. Perhaps there is one in a remote module that I am not familiar with?

Are you looking to construct a displacement field or b-spline to apply such a transformation?

- You could use the [PhysicalPointSourceImageFilter](https://itk.org/Doxygen/html/classitk_1_1PhysicalPointImageSource.html) to generate a vector image of the x,y location then use the [UnaryGeneratorImageFilter](https://itk.org/Doxygen/html/classitk_1_1UnaryGeneratorImageFilter.html) and a lambda to apply your equation. If you are using SimpleITK, you can look at the [marschner\_lobb](http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/Python_html/20_Expand_With_Interpolators.html) function for how to use overloaded operators on the points.

---

<div class="post-metadata">

**Author:** ![zivy](https://discourse.itk.org/user_avatar/discourse.itk.org/zivy/32/1726_2.png) [@zivy](https://discourse.itk.org/u/zivy)\
**Post date:** [October 5, 2020, 4:05pm UTC](https://discourse.itk.org/t/bi-variate-polynomial-warping-filter/3512/3 "2020-10-05T16:05:51Z")

</div>

Hello @rfrank,

If you are working with SimpleITK, [this notebook](https://github.com/InsightSoftwareConsortium/SimpleITK-Notebooks/blob/master/Python/70_Data_Augmentation.ipynb), section titled “Radial Distortion” has code that should be easily modifiable to do what you want.
