Repurpose an existing module

Im completely novice and have zero coding skills .

I’m planning to start coding a module . One for TMj viewer and possibly another one dedicated for Clipping segmentation.

It’s partially a need and partially a fun project .

I’m gonna use spec kit / GitHub copilot / gpt codex . for vibe coding

Im thinking that it would be much easier to build on an existing module and down extras . Is that possible that I get the code for segmentation is editor for example and delete all the code for editing and only make the part for viewing then edit it to my purpose

Or do I have start something from scratch ?

Any advise is highly appreciated

Something like copilot or gemini should be able to give you a good description of how Slicer’s codebase works and even get you started with templates and working examples. Be aware that it can also be difficult or impossible to debug vibe code, so take very small steps and test as you go.

This tells me you are not ready for vibe coding, not just yet. A module like Segment Editor is not something you can easily strip down and make it work for your purposes. There are different types of modules with Slicer (CLI, C++, Python scripted) that work differently (structure wise) and have different levels of complexities. So you really want to read the developer guide a bit more carefully, and then probably through python scripting develop what you want to do (as opposed to building a module). Script is much easier to debug and iterate over, and once you figure out the workflow for a specific dataset, then you can start the designing and writing the logic that you will need for the module development and the UI (which can get complex very easily and quickly).

As someone who is sort of slightly ahead of you on this, I gave up on having agent build a module. I am perfectly happy if they can help me create the workflow as a script, and then ask them to convert to a simple module.

It is fun, but first you need to get familiar with Slicer developer guide. (also LLMs make mistakes, like looking at older documentation etc. To be able to hold their hands, you need to know where the things are and point specifically those in your prompts).