Crash caused by itk.PDEDeformableRegistrationFilter

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

1 Like

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.

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

Hi Zhuangming,

Is it possible to share the input images?

Thanks,
Matt

Hi Matt,

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

Regards,

Zhuangming Shen

secondary_image.nrrd (1.9 MB)
primary_image.nrrd (1.9 MB)

1 Like

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.

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, can be used instead:

But, the filter should not segfault regardless. This patch fixes that issue.

1 Like

Hi Bradley and Matt,

Thanks for your explanations. It’s clear now.

Regards,

Zhuangming Shen