# Implementing the Demons Algorithm Registration

**URL:** <https://discourse.slicer.org/t/implementing-the-demons-algorithm-registration/16054>\
**Category:** Support\
**Created:** [February 18, 2021, 8:22am UTC](https://discourse.slicer.org/t/implementing-the-demons-algorithm-registration/16054 "2021-02-18T08:22:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![toyama](https://avatars.discourse-cdn.com/v4/letter/t/82dd89/32.png) [@toyama](https://discourse.slicer.org/u/toyama)\
**Post date:** [February 18, 2021, 8:22am UTC](https://discourse.slicer.org/t/implementing-the-demons-algorithm-registration/16054/1 "2021-02-18T08:22:29Z")

</div>

I would like to implement DIR using the demon algorithm.  
I am including SlicerRT and Elastix to do the DIR.  
Is it possible to do DIR using demon algorithm with these two?

---

<div class="post-metadata">

**Author:** ![Andinet\_Enquobahrie](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/andinet_enquobahrie/32/75_2.png) [@Andinet\_Enquobahrie](https://discourse.slicer.org/u/Andinet_Enquobahrie)\
**Post date:** [February 18, 2021, 12:58pm UTC](https://discourse.slicer.org/t/implementing-the-demons-algorithm-registration/16054/2 "2021-02-18T12:58:44Z")

</div>

@toyama

If you are trying to implement this in python, you can look into using SimpleITK which is available via SimpleElastix or independently in as part of Slicer dependencies. Here is a notebook that shows how you can executed demons based non-rigid registration.

[http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/Python\_html/66\_Registration\_Demons.html](http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/Python_html/66_Registration_Demons.html)

Or use ITK C++ API directly

[https://itk.org/Doxygen/html/Examples\_2RegistrationITKv4\_2DeformableRegistration2\_8cxx-example.html](https://itk.org/Doxygen/html/Examples_2RegistrationITKv4_2DeformableRegistration2_8cxx-example.html)

[https://itk.org/Doxygen/html/Examples\_2RegistrationITKv4\_2DeformableRegistration16\_8cxx-example.html](https://itk.org/Doxygen/html/Examples_2RegistrationITKv4_2DeformableRegistration16_8cxx-example.html)

-Andinet

---

<div class="post-metadata">

**Author:** ![toyama](https://avatars.discourse-cdn.com/v4/letter/t/82dd89/32.png) [@toyama](https://discourse.slicer.org/u/toyama)\
**Post date:** [February 26, 2021, 5:39am UTC](https://discourse.slicer.org/t/implementing-the-demons-algorithm-registration/16054/3 "2021-02-26T05:39:45Z")

</div>

Thank you for your answer.  
I will try it as soon as possible.

---

<div class="post-metadata">

**Author:** ![Chuan](https://avatars.discourse-cdn.com/v4/letter/c/4da419/32.png) [@Chuan](https://discourse.slicer.org/u/Chuan)\
**Post date:** [November 28, 2024, 8:02am UTC](https://discourse.slicer.org/t/implementing-the-demons-algorithm-registration/16054/4 "2024-11-28T08:02:35Z")

</div>

Hi Toyama,

Could you tell me if you find the DemonRegistration in python? Now I think I meet the similar question with you. What I am looking for is the python code of DemonRegistration that used in SLICER3D, not sure if the link from Andinet uses the same code that SLICER3D employed.  
Best regards,  
Chuan
