Tutorial for Developing Image-Guided Intervention Modules Using 3D Slicer



This blog provides an overview of the 3D Slicer architecture and module development with a focus on image-guided therapy (IGT) scripted modules. There are two main components required to develop an IGT module, which are explained in detail in this blog: (1) a platform for data capture and broadcasting (commonly using the Plus library, PlusServer), and (2) the 3D SlicerIGT Extension to receive the broadcasted data in Slicer for further processing and visualization. Sample code is also provided for reference and to facilitate implementation of these modules.

How to navigate the blog:

The main page of this blog is fully interactive. A description of each component in the charts below appears when the cursor is placed over it, and detailed explanations can be accessed by clicking on the components.

Common Acronyms:

IGT: Image-guided therapy
MRML: medical reality modeling language
GUI: graphic user interface



Model, view, controller (MVC) is a software architecture pattern, which promotes software maintenance and re-usability. Each component is responsible for a specific aspect of the application development. The 3D Slicer platform follows this architectural pattern. In 3D Slicer, 'model', or sometimes 'data model', is referred to as 'MRML'; 'view' is the user interface, which can be command line or graphical interface made up of Qt widgets; and 'controller' is referred to as logic (VTK logic). Following best practices, module development in 3D Slicer should follow this architectural pattern.

  • Model Manages data and its attributes.
    • MRML Overview The central data representation for managing 3D Slicer data types, such as volumes, models, tranforms, fiducials, cameras etc annd their visualization
      • MRML Scene A collection of MRML nodes
        • MRML Node A component of the data structure that is capable of storing: raw data, visualization and storage parameters.
          • Attributes Analogous to variables assoicated with a MRML node.
          • References
            and observers
            The method to access a MRML node, either through refercing a specific nodes ID or observing when changes to a node occur.
  • View The visual representation of information, that defines what the user sees and interacts with.
    • Graphic User Interface The portion of a Slicer module that the user interacts with.
      • Widget One component of the GUI, for example one specific button that the user can push to trigger an event.
  • Controller Interacts with both the model and the view and controls their functionalities.
    • Logic The portion of the code that performs most of the tasks required by an algorithm.
      • VTK logic Specific portion of the logic that is written and called on to complete one task.


This image represents how streaming medical images such as ultrasound and tracking information is accessed in 3D Slicer. The examples provided throughout this tutorial focus on ultrasound-guided interventions.




Development Modes
Scripted module
Loadable module
Create a module
Add module to an extension