Developer Guide
- Slicer API
- MRML Overview
- Module Overview
- Parameter Nodes
- Modules API
- Extensions
- Create an extension
- Build an extension
- Test an extension
- Create an extension package
- Write documentation for an extension
- Distribute an extension
- Application settings
- Extension catalog entry file
- Extension description file
- Extensions server
- Extensions Index
- Extensions build system
- Frequently asked questions
- Can an extension contain different types of modules?
- Should the name of the source repository match the name of the extension?
- Where can I find the extension templates?
- How are Superbuild extension packaged?
- How to build a custom Slicer package with additional extensions bundled?
- Can an extension depend on other extensions?
- How dependent extensions are configured and built?
- What are the extension specific targets: INSTALL, PACKAGE, packageupload, …?
- Is –launch flag available for a MacOSX installed Slicer.app?
- How to check if an extension is built by Slicer Extensions build system?
- How often extensions are uploaded on the extensions server?
- Will an extension be uploaded if associated tests are failing?
- How do I associate a remote with my local extension git source directory?
- Which remote name is expected for extension git checkout?
- Why ExtensionWizard failed to describe extension: “script does not set ‘EXTENSION_HOMEPAGE’”?
- Is project() statement allowed in extension CMakeLists.txt?
- Is call to “if(NOT Slicer_SOURCE_DIR)” required to protect “find_package(Slicer)” in extension CMakeLists.txt?
- Why is the –contribute option is not available with the ExtensionWizard?
- How to package third party libraries?
- Can I use C++14/17/20 language features?
- How do I publish a paper about my extension?
- How to force Slicer to download extensions corresponding to a different Slicer revision?
- How to address ITK test driver caught an ITK exception “Could not create IO object for reading file”?
- Python FAQ
- What is the Slicer Python environment?
- What is the PythonSlicer executable?
- What is the Python Console?
- How to access Slicer’s Python API via an external program while Slicer is running?
- How to run a CLI module from Python
- How to use a loadable module from Python
- How to find a Python function for any Slicer features
- How to connect GUI widget events to Python code
- How to run an external Python script as a CLI module
- How to type file paths in Python
- How to modify a Python scripted module
- How to include Python modules in an extension
- Can I use any Python package in a Slicer module
- Script repository
- Install Slicer
- Launch Slicer
- MRML scene
- Module selection
- Views
- Display text in a 3D view or slice view
- Activate hanging protocol by keyboard shortcut
- Show orientation marker in all views
- Change view axis labels
- Hide view controller bars
- Hide Slicer logo from main window
- Customize widgets in view controller bars
- Display a node in only some views
- Get current mouse coordinates in a slice view
- Display crosshair at a 3D position
- Change the crosshair color
- Display mouse pointer coordinates in alternative coordinate system
- Get 3D coordinates from 2D display coordinates
- Get DataProbe text
- Create custom color table
- Show color legend for a volume node
- Create custom color map and display color legend
- Customize view layout
- Turn on slice intersections
- Hide slice view annotations
- Change slice offset
- Change slice orientation
- Measure angle between two slice planes
- Set slice position and orientation from a normal vector and position
- Show slice views in 3D window
- Change default slice view orientation
- Set all slice views linked by default
- Set crosshair jump mode to centered by default
- Set up custom units in slice view ruler
- Center the 3D view on the scene
- Rotate the 3D View
- Change 3D view background color
- Change box color in 3D view
- Show a slice view outside the view layout
- Show a 3D view outside the view layout
- Access VTK rendering classes
- Keyboard shortcuts and mouse gestures
- Launch external applications
- Manage extensions
- DICOM
- Load DICOM files into the scene from a folder
- Import DICOM files into the application’s DICOM database
- Import DICOM files using DICOMweb
- Access top level tags of DICOM images imported into Slicer
- Access DICOM tags nested in a sequence
- Access tag of a scalar volume loaded from DICOM
- Access tag of an item in the Subject Hierarchy tree
- Get path and filename of a scalar volume node loaded from DICOM
- Convert DICOM to NRRD on the command line
- Export a volume to DICOM file format
- Export a segmentation to DICOM segmentation object
- Export DICOM series from the database to research file format
- Customize table columns in DICOM browser
- Query and retrieve data from a PACS using classic DIMSE DICOM networking
- Query and retrieve data from a PACS using classic DIMSE DICOM networking with the (experimental) ctkDICOMVisualBrowser
- Query and retrieve data from a PACS using classic DIMSE DICOM networking with the (experimental) ctkDICOMScheduler (no UI needed)
- Send data to a PACS using classic DIMSE DICOM networking
- Send data to a PACS using DICOMweb networking
- Convert RT structure set to labelmap NRRD files
- Run a DCMTK Command Line Tool
- Additional Notes
- Markups
- Save markups to file
- Load markups from file
- Load markups point list from file
- Adding control points Programmatically
- How to draw a curve using control points stored in a numpy array
- Add a button to module GUI to activate control point placement
- Adding control points via mouse clicks
- Access to markups point list Properties
- Define/edit a circular region of interest in a slice viewer
- Specify a sphere by multiple control points
- Fit markups ROI to volume
- Fit markups plane to model
- Measure angle between two markup planes
- Measure angle between two markup lines
- Project a line to a plane
- Measure distances of points from a plane
- Measure distances of points from a line
- Set slice position and orientation from 3 markups control points
- Switching to markups control point placement mode
- Change markup point list display properties
- Get a notification if a markup control point position is modified
- Write markup control point positions to JSON file
- Write markup ROI to JSON file
- Create markup plane JSON file - outside Slicer
- Fit slice plane to markup control points
- Change color of a markups node
- Display list of control points in my module’s GUI
- Pre-populate the scene with measurements
- Copy all measurements in the scene to Excel
- Use markups json files in Python - outside Slicer
- Assign custom actions to markups
- Models
- Show a simple surface mesh as a model node
- Measure distance of points from surface
- Add a texture mapped plane to the scene as a model
- Get scalar values at surface of a model
- Apply VTK filter on a model node
- Select cells of a model using markups point list
- Export entire scene as glTF
- Export entire scene as VRML
- Export model to Blender, including color by scalar
- Show comparison view of all model files a folder
- Rasterize a model and save it to a series of image files
- Plots
- Screen Capture
- Capture the full Slicer screen and save it into a file
- Capture all the views save it into a file
- Capture a single view
- Capture a slice view sweep into a series of PNG files
- Capture 3D view into PNG file with transparent background
- Capture slice view into PNG file with white background
- Save a series of images from a slice view
- Segmentations
- Load a 3D image or model file as segmentation
- Create a segmentation from a labelmap volume and display in 3D
- Create segmentation from a model node
- Export labelmap node from segmentation node
- Import/export labelmap node using custom label value mapping
- Export model nodes from segmentation node
- Create a hollow model from boundary of solid segment
- Show a segmentation in 3D
- Modify segmentation display options
- Get a representation of a segment
- Convert all segments using default path and conversion parameters
- Convert all segments using custom path or conversion parameters
- Re-convert using a modified conversion parameter
- Create keyboard shortcut for toggling sphere brush for paint and erase effects
- Create keyboard shortcut for toggling visibility of a set of segments
- Customize list of displayed Segment editor effects
- Center all views on a segment
- Read and write a segment as a numpy array
- Get centroid of a segment in world (RAS) coordinates
- Get histogram of a segmented region
- Get segments visible at a selected position
- Set default segmentation options
- How to run segment editor effects from a script
- Process segment using a VTK filter
- Use segmentation files in Python - outside Slicer
- Clone a segment
- Resample segmentation to higher resolution
- Quantifying segments
- Registration
- Sequences
- Access voxels of a 4D volume as numpy array
- Access voxels of a 4D volume as a single numpy array
- Get index value
- Browse a sequence and access currently displayed nodes
- Concatenate all sequences in the scene into a new sequence
- Plot segments average intensity over time
- Export nodes warped by transform sequence
- Create a 4D volume in Python - outside Slicer
- Subject hierarchy
- Get the pseudo-singleton subject hierarchy node
- Create subject hierarchy item
- Get subject hierarchy item
- Traverse children of a subject hierarchy item
- Manipulate subject hierarchy item
- Filter items in TreeView or ComboBox
- Listen to subject hierarchy item events
- Subject hierarchy plugin offering view context menu action
- Use allowlist to customize view menu
- Save files to directory structure matching subject hierarchy folders
- Tractography
- Transforms
- Get a notification if a transform is modified
- Rotate a node around a specified point
- Rotate a node around a specified line
- Convert between ITK and Slicer linear transforms
- Apply a transform to a transformable node
- Set a transformation matrix from a numpy array
- Example of moving a volume along a trajectory using a transform
- Combine multiple transforms
- Convert the transform to a grid transform
- Export the displacement magnitude of the transform as a volume
- Visualize the displacement magnitude as a color volume
- Volumes
- Load volume from file
- Save volume to file
- Load volume from .vti file
- Load volume from a remote server
- Show volume rendering automatically when a volume is loaded
- Show volume rendering using maximum intensity projection
- Show volume rendering making soft tissues transparent
- Automatically load volumes that are copied into a folder
- Extract slice from volume
- Extract randomly oriented slabs of given shape from a volume
- Clone a volume
- Create a new volume
- Create a new volume from ROI
- Get value of a volume at specific voxel coordinates
- Modify voxels in a volume
- Get volume voxel coordinates from markup control point RAS coordinates
- Get markup control point RAS coordinates from volume voxel coordinates
- Get the values of all voxels for a label value
- Access values in a DTI tensor volume
- Change window/level (brightness/contrast) or colormap of a volume
- Make mouse left-click and drag on the image adjust window/level
- Reset field of view to show background volume maximized
- Rotate slice views to volume plane
- Iterate over current visible slice views, and set foreground and background images
- Show a volume in slice views
- Change opacity of foreground volume in slice views
- Turning off interpolation
- Running an ITK filter in Python using SimpleITK
- Get axial slice as numpy array
- Get reformatted image from a slice viewer as numpy array
- Combine multiple volumes into one
- Add noise to image
- Mask volume using segmentation
- Apply random deformations to image
- Thick slab reconstruction and maximum/minimum intensity volume projections
- Display volume using volume rendering
- Apply a custom volume rendering color/opacity transfer function
- Limit volume rendering to a specific region of the volume
- Register a new Volume Rendering mapper
- Register custom volume rendering presets
- Batch processing
- WebServer
- Build Instructions
- Debugging
- Contributing to Slicer
- Style Guide
- Advanced Topics
- Credits