A scripted module is one way of developing a module in 3D Slicer. It is written using Python, and provides access to most classes required to build a module, such as all of VTK, most of ITK and Qt. If complete access to all of these classes is required, the module should be written in C++ (see the section below). For more information on scripted module development click here!
Does not require extensive programming experience.
Compatible with downloaded slicer, both nightly and stable releases, which means it does not require compiling Slicer from source code.
The python console in 3D Slicer allows you to test parts of your code. Be aware that there are minor differences in coding structure between the console and your python script.
To incorporate logic that was written in another scripted module in your module, you must use a scripted module yourself.
Scripted modules can access logic class written in any C++ (loadable) module available in 3D Slicer using slicer.modules.[ModuleName].logic().
ITK is available in scripted modules through SimpleITK. SimpleITK is slightly different than ITK. Please refer to SimpleITK documentation for more information, provided here.
The Qt functions that are available for a scripted module have been converted to Python (I.e. Python wrapped) from C++. Due to this, the naming convention and functionality are not entirely consistent. Note: PyQt is a commercial product that is entirely separate from the Python wrapped Qt. To access these functions use: qt.Q[FunctionName].
All other normal python functionality can be accessed through a scripted module, including importing classes (eg. import numpy)
This section provides sample code for developing a 3D Slicer loadable module with IGT capabilities. This skeleton file is scripted in Python with specific IGT capabilities that you can use for development. If these capabilities are not useful for your application they can simply be commented out or removed from the script. A sample xlm file is also included to enable connection to the Plus Server. Sample code for a scripted module can be found here!
Loadable Module (i.e. development in C++)
A loadable module is another way of developing a module in 3D Slicer. It is written using C++, and provides full access to VTK, ITK and Qt. Please refer to this page to learn how to create a loadable module here! .
Able to handle complex computations efficiently.
Provides full control over the user interface.
Enables logic classes to be reused by any other scripted or loadable module.
Requires building Slicer in other words compiling Slicer from source code through CMake. Learn how to build Slicer here!
Packaging a loadable module requires it to be complied in a similar manner to Slicer. Packing allows the modules to be loaded into Slicer.
Developing loadable modules require more advanced coding skills and a background in C++ programing.