# How to add another module (Reformat) into a module that I have created?

**URL:** <https://discourse.slicer.org/t/how-to-add-another-module-reformat-into-a-module-that-i-have-created/38077>\
**Category:** Development\
**Created:** [August 28, 2024, 12:26pm UTC](https://discourse.slicer.org/t/how-to-add-another-module-reformat-into-a-module-that-i-have-created/38077 "2024-08-28T12:26:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saladi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/saladi/32/77856_2.png) [@Saladi](https://discourse.slicer.org/u/Saladi)\
**Post date:** [August 28, 2024, 12:26pm UTC](https://discourse.slicer.org/t/how-to-add-another-module-reformat-into-a-module-that-i-have-created/38077/1 "2024-08-28T12:26:41Z")

</div>

Hi community,  
I am trying to develop a new module from my research work, in that “Reformat” module is essential. I want to have some features (offset, rotation, etc) into my existing module. I am developing in Python but “Reformat” is in C/C++. Is there any way I can access some features from “Reformat” without coding the entire function?

---

<div class="post-metadata">

**Author:** ![Llujoo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/llujoo/32/77417_2.png) [@Llujoo](https://discourse.slicer.org/u/Llujoo)\
**Post date:** [September 5, 2024, 9:26am UTC](https://discourse.slicer.org/t/how-to-add-another-module-reformat-into-a-module-that-i-have-created/38077/2 "2024-09-05T09:26:40Z")

</div>

So you want to run c++ code in python, right?  
I haven’t used it myself but I’ve heard **pybind11** is pretty useful.

---

<div class="post-metadata">

**Author:** ![Saladi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/saladi/32/77856_2.png) [@Saladi](https://discourse.slicer.org/u/Saladi)\
**Post date:** [September 7, 2024, 11:32am UTC](https://discourse.slicer.org/t/how-to-add-another-module-reformat-into-a-module-that-i-have-created/38077/3 "2024-09-07T11:32:16Z")

</div>

Oh cool! I’ll check it out once.  
Thanks

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [September 7, 2024, 7:30pm UTC](https://discourse.slicer.org/t/how-to-add-another-module-reformat-into-a-module-that-i-have-created/38077/4 "2024-09-07T19:30:55Z")

</div>

I don’t recommend using libraries and mechanisms that are not already part of Slicer. You’ll need to change basic Slicer cmake and other files, and will end up with something that is very hard to maintain, or you will spend a year or more making it part of Slicer.

The best way would be to create a reusable widget from the part of the module that you want to use from Python and add that widget like any other. There are many examples, e.g. [here](https://github.com/Slicer/Slicer/tree/main/Modules/Loadable/Segmentations/Widgets/Resources/UI).
