python code for DiffeomorphicDemonsRegistration in SimpleITK

simpleitk
(Sindhura C) #1

I used a few methods for registration. Simple ITK in python looks very easy than using c++ for me.
Is there any python code available for DiffeomorphicDemonsRegistration?

(Ziv Yaniv) #2

Hello @EE18D504_SINDHURA_C,

Yes,the class for that is DiffeomorphicDemonsRegistrationFilter. This Jupyter notebook illustrates various classes from the Demons registration family and their usage in a multi-resolution framework.

3 Likes
(Sindhura C) #3

Hi @zivy,
I have gone throgh the code given here
I wonder how to use it with my 3D CT brain images?
I have only two CT images . I dont have any points data.
how to proceed with only with my two images?

(Ziv Yaniv) #4

Hello @EE18D504_SINDHURA_C,

You do not need point data, that is only used for evaluation purposes.

Please take a look at the “Register and transfer the segmentation.” section of the notebook which registers 2D MRI images. You can readily modify this code for your task. You will need to modify Euler2DTransform() to Euler3DTransform() in the initializer and possibly tweak the parameters (Demons algorithm and pyramid) to work for your application.

If you are struggling with the code, you might consider using 3D Slicer which has a GUI based registration module.

1 Like
(Sindhura C) #5

It says my images do not occupy same physical space? Should I resample my image? Is there any other way? Doen’t it effect my registration process if i resample it?