3D Slicer

Getting 3D Slicer

Download the latest stable release of 3D Slicer from the Slicer site. It has an open-source licence. Install the software. For example, under MS Windows 10, download and run the installer (e.g., Slicer-4.11.20210226-win-amd64.exe). By default it will be installed under AppData\Local rather than in the usual Program Files.

The Web site includes good documentation and tutorials, although it is sometimes hard to find details about simple things. There are over 100 modules to choose from for various kinds of operations. The discussion forum is quite active and the developers are responsive. Release notes are available.

They don’t seem to be able to decide whether the programme is called 3D Slicer, 3DSlicer or just Slicer. It is not to be confused with Slic3r for 3D printing.

If you get an error message, you can see the details in the error log by clicking on the error-log icon Error-log icon in the lower-right corner of the Slicer window, or by selecting View ► Error Log. The message texts may disappear off the edge of the error-log window but you can see the full text of a message by clicking on it.

Simple exercise

Loading sample data

Slicer can load sets of JPEG images but I haven’t figured out how to set the pixel size and slice spacing. The software would take forever (approximately) to load a set of, for example, 700 images of 1024×1024 pixels.

DICOM is a format that is commonly used for medical imaging.

3-D rotation is awkward because it is not possible to rotate the scene around an axis perpendicular to the screen.

Do File ► Download Sample Data (or select Download Sample Data in the Welcome module) and select one of the datasets. I suggest CTA Abdomen.

Viewing the data

In the default display layout, three orthogonal slices through the image volume are displayed in three separate panels. A fourth panel is a 3-D view. To display the slices in that view as well, within each 2-D panel hover with the mouse over the tiny push-pin icon push-pin icon in the upper left corner of the panel and, in the set of icons that pops up, click on the closed-eyelid icon Closed-eye icon. It turns into an open eye Open-eye icon and the image slice appears in the 3-D panel. The slice may not be visible until you rotate the 3-D view.

In each 2-D panel, play with your mouse’s scroll wheel, and with the slider at the top of the panel.

Doing segmentation

From the dropdown list of modules on the toolbar, select Segmentation ► Simple Region Growing Segmentation. Since version 5.0, this module is found under Legacy ► Segmentation.

To ‘create and place’ a seed point for the algorithm, click on the arrow-and-red-blob ‘Fiducial’ icon Fiducial icon in the toolbar at the top and then click on a location in the image. A numbered marker will be displayed at the location. (If you don’t see the icon, try making your Slicer window wider, to allow more space for the icons. If you still don't see the icon, do View ► Toolbars and make sure Mouse Interaction is checked, and again try widening the Slicer window if necessary. If you still don't see the icon, do View ► Toolbars and check the box Markups.) (The icon is confusingly described as ‘an arrow pointing to a sphere fiducial’ – the arrow points away from the red blob, and ‘fiducial points’ normally refers to markers used for alignment, not to seed points.)

When a first seed point is created, it is added to a new list of seed points, obscurely named F. In the Segmentation Parameters panel, click on the Seeds dropdown list and select F as the current list of seeds.

In the IO panel, click on the Input Volume dropdown list and select the name of the dataset that you are using. Then click on the Output Volume dropdown list and select Create new LabelMapVolume; the default volume name will be Output Volume.

Click on Apply. If you’re lucky, there will be a few seconds of processing and then the segmented region will be highlighted in the displayed images.

If the segmentation doesn’t include enough, you can define additional seed points by repeatedly clicking on the Fiducial icon and then clicking in the images. Alternatively, you can click on the small triangle beside the icon and select Persistent in the drop-down list – if the Persistent attribute has a checkmark beside it, you can click once on the arrow-and-blob icon and then click repeatedly in the images to create multiple seed points. Click on Apply again to rerun the region-growing segmentation algorithm.

You can use the Markups module to edit the list of seed points, removing some if you got too much or adding some if you didn’t get enough.

You can also increase or decrease the amount included in the segmented region by increasing or decreasing

Work on getting a segmentation that looks as though it could represent some fairly localized internal structure.

See the documentation for more information.

Creating surface model from segmentation

Select the module Surface Models ► Model Maker. In the IO section make sure the ‘volume’ corresponding to your segmentation is selected as the Input Volume. For Models select Create new ModelHierarchy. Make sure the Generate All Models box is checked (or specify the labels in the Model Maker Parameters section). Click on Apply. If you’re lucky, after some processing a 3-D surface model will appear in the 3-D section of the display. You may want to close the eye icons.

Note that there are a lot of parameters that can be played with in an attempt to improve the model, with varying degrees of loss of control.

To switch between perspective and orthographic views of the model, hover with the mouse over the tiny push-pin icon in the upper left corner of the panel and, in the set of icons that pops up, alternate between the perspective Perspective-view icon and orthographic Orthographic-view icon icons.

Slicer doesn’t seem to be able to export the model in VRML format.

Volume rendering

The module Volume Rendering can be fun to play with. Select the desired Volume and make sure the eye icon beside the Volume: selector is open. There are many many parameters that can be adjusted, as well as some preset sets of settings like CT-Bones and MR-Angio. For example, try the CTChest sample data with the CT-Bone preset. Make sure the eye icon beside Volume: is open. The 3-D images are impressive at first glance but actually contain a lot of junk.

Note that this volume rendering has nothing to do with the model resulting from the region-growing segmentation above. You can turn off the Volume eye icon to see that model again.

Saving results

Use File ► Save to save things like lists of region-growing seed points and results of segmentations. The Change directory for selected files button in the Save dialogue can be used to change the directories for all of the file types at once.

Other tasks

Slicer has tools for many other tasks, including image filtering, registration and quantification, mesh generation, and specialized applications like image-guided therapy and endoscopy. These tools are ‘for research purposes only’ and have not been approved for clinical use.

Automatic segmentation

Slicer contains a number of modules for automatic image segmentation, including

Reslicing

The Resample Scalar Volume is considered to be a Legacy module.

At More efficient resampling (2021 Sep), recommended the Volume Reslice Driver module in the SlicerIGT extension. (Click on Install Extensions in the Welcome to Slicer module.) Installing that extension brings in the dependency SlicerIGSIO, a utility extension. The extension’s modules are listed under IGT in Slicer’s list of modules. Help on using the module is at www.slicerigt.org.

The following is an attempt to follow the tutorial SlicerIGT_HandsOn_2015-1--05.pptx at the link given at www.slicerigt.org/wp/user-tutorials/, starting at slide 17.

  1. Download data: for example, Welcome to Slicer ► Download Sample Data
  2. Go to module IGT ► Volume Reslice Driver
  3. In the red frame, select the data name from the drop-down list for Driver.
  4. Select Mode ► Transverse. (By default, the red viewer is axial; I don't know how the two settings interact.) Click on the pushpin icon in the red viewer, select the data name, and click on the eye icon to see the slice in the 3D panel.

Data larger than memory

In Slicer, all of the data to be processed needs to be loaded into memory. (Fiji, for example, allows ‘virtual stacks’ that are larger than memory.) Slicer offers a work-around using the ImageStacks module in SlicerMorph.


AudiLab home page
R. Funnell
Last modified: 2025-03-02 11:57:27