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

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!

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