# Is it possible to reuse parts of other modules' source code to create a custom module?

**URL:** <https://discourse.slicer.org/t/is-it-possible-to-reuse-parts-of-other-modules-source-code-to-create-a-custom-module/41128>\
**Category:** Development\
**Created:** [January 17, 2025, 1:47pm UTC](https://discourse.slicer.org/t/is-it-possible-to-reuse-parts-of-other-modules-source-code-to-create-a-custom-module/41128 "2025-01-17T13:47:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![igi133](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/igi133/32/78666_2.png) [@igi133](https://discourse.slicer.org/u/igi133)\
**Post date:** [January 17, 2025, 1:47pm UTC](https://discourse.slicer.org/t/is-it-possible-to-reuse-parts-of-other-modules-source-code-to-create-a-custom-module/41128/1 "2025-01-17T13:47:00Z")

</div>

Hello everyone,

I’ve been working with Slicer and I’m interested in creating my own custom module. I wanted to ask the community whether it’s possible to reuse parts of source code from other existing modules to help build my own module.

Specifically, I’m wondering about the best practices for integrating or adapting existing code in a way that follows the Slicer framework’s guidelines and avoids any potential issues.

Has anyone had experience with this? Are there any limitations or things to consider when reusing code from other modules?

Any tips or advice would be greatly appreciated!

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [January 17, 2025, 2:18pm UTC](https://discourse.slicer.org/t/is-it-possible-to-reuse-parts-of-other-modules-source-code-to-create-a-custom-module/41128/2 "2025-01-17T14:18:50Z")

</div>

Yes, reusing functionality from modules to build new modules is a core part of Slicer. Typically you can just use the `Logic` classes directly and sometimes you may want to use widgets.

[https://slicer.readthedocs.io/en/latest/developer\_guide/modules/index.html](https://slicer.readthedocs.io/en/latest/developer_guide/modules/index.html)
