Getting started with python for creating custom modules

We use 3D slicer and markup as a tool in education and also a combination of different datasets and markup during the examination of students.

Some students think it is a bit difficult to do this manually, hence I am staring the process to develop an extension that should combine choosing the dataset as well as handling markups.

I have started with the extention wizard that gives you the ability to choose between different datasets (but to threshold).

If anyone could give me some advice on the following it would be very appreciated:

  1. where do I find a list of the commands that slicer cand respond to? For instance after choosing a dataset in the dropdown list. I want it to be the active one in slicer
  2. Is there a way to load parts from a different module easily into another? In that case is there a resource on how to make this calls?

I would of course also be very thankful for any other advice to get me going.

Hundreds of thousands of commands are available in Slicer (entire Qt, VTK, SimpleITK library, Python core libraries, etc. are already bundled and you can install any number of additional Python packages), so giving an exhaustive list is impossible.

I would recommend to start with the PerkLab bootcamp’s Slicer programming tutorial. There are also a number of Slicer tutorials on youtube - see for example these.

Yes, there are lots of reusable widgets. You can find instructions here for finding any Slicer feature that you want to use in Python.

If you don’t find anything in tutorials or examples in the script repository then you can also always ask here.