# Wrap itk.MultiResolutionPDEDeformableRegistration to Python

**URL:** https://discourse.itk.org/t/wrap-itk-multiresolutionpdedeformableregistration-to-python/612
**Category:** Engineering
**Tags:** python
**Created:** [January 22, 2018, 8:42am UTC](https://discourse.itk.org/t/wrap-itk-multiresolutionpdedeformableregistration-to-python/612 "2018-01-22T08:42:12Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![zhuangming.shen](https://discourse.itk.org/letter_avatar_proxy/v4/letter/z/4af34b/32.png) [@zhuangming.shen](https://discourse.itk.org/u/zhuangming.shen)
#### Post date: [January 22, 2018, 8:42am UTC](https://discourse.itk.org/t/wrap-itk-multiresolutionpdedeformableregistration-to-python/612/1 "2018-01-22T08:42:12Z")

</div>

Hi all,

Could someone help to wrap itk.MultiResolutionPDEDeformableRegistration to Python? As a result, I can use multi-resolution deformable registration. Thanks in advance.

Regards,

Zhuangming Shen

---

<div class="post-metadata">

### Author: ![jhlegarreta](https://discourse.itk.org/user_avatar/discourse.itk.org/jhlegarreta/32/476_2.png) [@jhlegarreta](https://discourse.itk.org/u/jhlegarreta)
#### Post date: [January 22, 2018, 11:17am UTC](https://discourse.itk.org/t/wrap-itk-multiresolutionpdedeformableregistration-to-python/612/2 "2018-01-22T11:17:31Z")

</div>

Dear Zhuangming,  
the [ITK Software Guide](https://itk.org/ItkSoftwareGuide.pdf) contains a section ( **9.5 Wrapping** ) devoted to explain how wrapping can be done in ITK.

Each module contains a `wrapping` folder, where the `*.warp` files are located. You can get some inspiration by reading the mentioned section and having a look at some of the existing wrap files.

You may want to read the [CONTRIBUTING](https://github.com/InsightSoftwareConsortium/ITK/blob/master/CONTRIBUTING.md) guide to submit a topic for revision, and hence, be the author of such a great contribution !

Let us know if you find difficulties.

---

<div class="post-metadata">

### Author: ![jhlegarreta](https://discourse.itk.org/user_avatar/discourse.itk.org/jhlegarreta/32/476_2.png) [@jhlegarreta](https://discourse.itk.org/u/jhlegarreta)
#### Post date: [February 26, 2018, 10:08pm UTC](https://discourse.itk.org/t/wrap-itk-multiresolutionpdedeformableregistration-to-python/612/3 "2018-02-26T22:08:28Z")

</div>

Dear @zhuangming.shen,  
a topic was submitted to gerrit for review with the wrap file of the mentioned filter:  
[http://review.source.kitware.com/#/c/23203/](http://review.source.kitware.com/#/c/23203/)

Could you please test the patch set and tell us if you can use it locally with no issues?

Thanks.

---

<div class="post-metadata">

### Author: ![zhuangming.shen](https://discourse.itk.org/letter_avatar_proxy/v4/letter/z/4af34b/32.png) [@zhuangming.shen](https://discourse.itk.org/u/zhuangming.shen)
#### Post date: [February 28, 2018, 7:46am UTC](https://discourse.itk.org/t/wrap-itk-multiresolutionpdedeformableregistration-to-python/612/4 "2018-02-28T07:46:00Z")

</div>

Dear @jhlegarreta,

Thanks for your effort. I just downloaded the latest ITK source code from github and compiled it. I enabled ITKV3\_COMPATIBILITY, but disabled Module\_ITKv4Compatibility. After that, I still cannot run itk.MultiResolutionPDEDeformableRegistration. Did I do something wrong?

Regards,

Zhuangming Shen

 ![itkMultiResolutionPDEDeformableRegistration%20issue](https://discourse.itk.org/uploads/default/original/1X/f115e7d273c35d2d13682a643ac4555b4e559c93.PNG)

---

<div class="post-metadata">

### Author: ![jhlegarreta](https://discourse.itk.org/user_avatar/discourse.itk.org/jhlegarreta/32/476_2.png) [@jhlegarreta](https://discourse.itk.org/u/jhlegarreta)
#### Post date: [February 28, 2018, 8:31am UTC](https://discourse.itk.org/t/wrap-itk-multiresolutionpdedeformableregistration-to-python/612/5 "2018-02-28T08:31:29Z")

</div>

Thanks for trying.

Please notice that the topic **has not been merged into `ITK master`**. In order to test the Python wrap of the class you **will need to checkout the topic** :

```auto
git fetch http://review.source.kitware.com/ITK refs/changes/03/23203/2 && git checkout FETCH_HEAD
git checkout -b AddWrappingToMultiResolutionPDEDeformableRegistration-for-release

```

Then try to use it.

Please **let us know the result of this**.

---

<div class="post-metadata">

### Author: ![zhuangming.shen](https://discourse.itk.org/letter_avatar_proxy/v4/letter/z/4af34b/32.png) [@zhuangming.shen](https://discourse.itk.org/u/zhuangming.shen)
#### Post date: [March 1, 2018, 7:08am UTC](https://discourse.itk.org/t/wrap-itk-multiresolutionpdedeformableregistration-to-python/612/6 "2018-03-01T07:08:21Z")

</div>

Hi @jhlegarreta,

I tried again but encountered some errors…

 ![ITK_errors](https://discourse.itk.org/uploads/default/original/1X/83fb8ab0ae52bbcdf767b529875acf3dea7ff9bb.PNG)

---

<div class="post-metadata">

### Author: ![jhlegarreta](https://discourse.itk.org/user_avatar/discourse.itk.org/jhlegarreta/32/476_2.png) [@jhlegarreta](https://discourse.itk.org/u/jhlegarreta)
#### Post date: [March 1, 2018, 11:14am UTC](https://discourse.itk.org/t/wrap-itk-multiresolutionpdedeformableregistration-to-python/612/7 "2018-03-01T11:14:53Z")

</div>

Thanks for testing @zhuangming.shen !

@fbudin @matt.mccormick does this ring a bell to you?

---

<div class="post-metadata">

### Author: ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)
#### Post date: [March 1, 2018, 10:00pm UTC](https://discourse.itk.org/t/wrap-itk-multiresolutionpdedeformableregistration-to-python/612/8 "2018-03-01T22:00:49Z")

</div>

@zhuangming.shen Could you please try building with the `ITKV3_COMPATIBILITY` CMake option `OFF`? It should address the build error per:

[https://github.com/InsightSoftwareConsortium/ITK/blob/efd0109a4d8db70ed7490487a410ed70255b48dc/Modules/Registration/PDEDeformable/include/itkMultiResolutionPDEDeformableRegistration.h#L174-L190](https://github.com/InsightSoftwareConsortium/ITK/blob/efd0109a4d8db70ed7490487a410ed70255b48dc/Modules/Registration/PDEDeformable/include/itkMultiResolutionPDEDeformableRegistration.h#L174-L190)

---

<div class="post-metadata">

### Author: ![zhuangming.shen](https://discourse.itk.org/letter_avatar_proxy/v4/letter/z/4af34b/32.png) [@zhuangming.shen](https://discourse.itk.org/u/zhuangming.shen)
#### Post date: [March 2, 2018, 3:44am UTC](https://discourse.itk.org/t/wrap-itk-multiresolutionpdedeformableregistration-to-python/612/9 "2018-03-02T03:44:59Z")

</div>

Hi @matt.mccormick and @jhlegarreta,

Thanks for your responses. It can work now.

---

<div class="post-metadata">

### Author: ![jhlegarreta](https://discourse.itk.org/user_avatar/discourse.itk.org/jhlegarreta/32/476_2.png) [@jhlegarreta](https://discourse.itk.org/u/jhlegarreta)
#### Post date: [March 5, 2018, 11:14pm UTC](https://discourse.itk.org/t/wrap-itk-multiresolutionpdedeformableregistration-to-python/612/10 "2018-03-05T23:14:41Z")

</div>

The topic has been merged into `master`.  
@zhuangming.shen thanks for testing ! @matt.mccormick thanks for merging !
