# Crash caused by itk.PDEDeformableRegistrationFilter

**URL:** https://discourse.itk.org/t/crash-caused-by-itk-pdedeformableregistrationfilter/611
**Category:** Algorithms
**Tags:** registration, python
**Created:** [January 22, 2018, 8:37am UTC](https://discourse.itk.org/t/crash-caused-by-itk-pdedeformableregistrationfilter/611 "2018-01-22T08:37:31Z")
**Posts on this page:** 8
**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:37am UTC](https://discourse.itk.org/t/crash-caused-by-itk-pdedeformableregistrationfilter/611/1 "2018-01-22T08:37:32Z")

</div>

Hi all,

When I used itk.PDEDeformableRegistrationFilter to perform deformable registration on two 3D images using python supported ITK, “Segmentation fault (core dumped)” appeared. Other deformable registration methods including itk.DemonsRegistrationFilter, itk.DiffeomorphicDemonsRegistrationFilter, itk.LevelSetMotionRegistration Filter, itk.FastSymmetricForcesDemonsRegistrationFilter and SymmetricForcesDemonsRegistrationFilter can work without crash. Could someone help to check it? Thanks in advance.

Regards,

Zhuangming Shen

Here is my code

import itk

primary\_image\_path = “primary\_image.nrrd”

reader = itk.ImageFileReader[itk.Image.SS3].New()  
reader.SetFileName(primary\_image\_path)  
reader.Update()

primary\_image = reader.GetOutput()

secondary\_image\_path = “secondary\_image.nrrd”

reader = itk.ImageFileReader[itk.Image.SS3].New()  
reader.SetFileName(secondary\_image\_path)  
reader.Update()

secondary\_image = reader.GetOutput()

filter = itk.PDEDeformableRegistrationFilter[itk.Image.SS3, itk.Image.SS3, itk.Image.VF33].New()  
filter.SetFixedImage(primary\_image)  
filter.SetMovingImage(secondary\_image)  
filter.Update()

---

<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: [January 22, 2018, 1:42pm UTC](https://discourse.itk.org/t/crash-caused-by-itk-pdedeformableregistrationfilter/611/2 "2018-01-22T13:42:43Z")

</div>

I am not sure what you mean by “crash”. Is there a python exception? a segfault?

Please include any output from the execution which may give an indication of the error encountered.

---

<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 23, 2018, 12:26am UTC](https://discourse.itk.org/t/crash-caused-by-itk-pdedeformableregistrationfilter/611/3 "2018-01-23T00:26:51Z")

</div>

Hi blowekamp,

Thanks for your immediate response. Attached is the screenshot of this error. I have no idea on how to get more information of this exception.

Regards,

Zhuangming Shen

 ![PDEDeformableRegistrationFilter](https://discourse.itk.org/uploads/default/original/1X/16b1551ff143d32c5be792f30adf66fbf7ebd3fe.PNG)

---

<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: [January 23, 2018, 2:49pm UTC](https://discourse.itk.org/t/crash-caused-by-itk-pdedeformableregistrationfilter/611/4 "2018-01-23T14:49:18Z")

</div>

Hi Zhuangming,

Is it possible to share the input images?

Thanks,  
Matt

---

<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 24, 2018, 2:10am UTC](https://discourse.itk.org/t/crash-caused-by-itk-pdedeformableregistrationfilter/611/5 "2018-01-24T02:10:57Z")

</div>

Hi Matt,

Sure. Attached are the primary image and the secondary image.

Regards,

Zhuangming Shen

[secondary\_image.nrrd](https://discourse.itk.org/uploads/default/original/1X/db2ba8eb894b4c8ced14c2b5cbed6cda6ade82b2.nrrd) (1.9 MB)  
[primary\_image.nrrd](https://discourse.itk.org/uploads/default/original/1X/9aa564709b09e01192ab0734340bf75f04d5fc95.nrrd) (1.9 MB)

---

<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: [January 26, 2018, 2:11pm UTC](https://discourse.itk.org/t/crash-caused-by-itk-pdedeformableregistrationfilter/611/6 "2018-01-26T14:11:28Z")

</div>

Hello,

I have never used PDEDeformableRegistrationFilter directly. I have only used the derived classes from it such as Demons and the LevelSet based registration methods.

It is possible that this filter is not intended to be used directly, and only as a base class. I don’t see any examples which use this class either.

---

<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: [January 26, 2018, 9:30pm UTC](https://discourse.itk.org/t/crash-caused-by-itk-pdedeformableregistrationfilter/611/7 "2018-01-26T21:30:24Z")

</div>

Yes, `PDEDeformableRegistrationFilter` is a base class and is not intended to be used directly. One of the inherited classes, visualized in the [class’s Doxygen inheritance diagram](https://itk.org/Doxygen/html/classitk_1_1PDEDeformableRegistrationFilter.html), can be used instead:

 ![PDEDeformableTransform](https://discourse.itk.org/uploads/default/original/1X/86d2002017be8b0acefa8394e1096ed0b0264280.jpg)

But, the filter should not segfault regardless. [This patch](http://review.source.kitware.com/#/c/23092/) fixes that issue.

---

<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 29, 2018, 12:18am UTC](https://discourse.itk.org/t/crash-caused-by-itk-pdedeformableregistrationfilter/611/8 "2018-01-29T00:18:00Z")

</div>

Hi Bradley and Matt,

Thanks for your explanations. It’s clear now.

Regards,

Zhuangming Shen
