Slicing Scientific Data

I've covered scientific software in previous articles that either analyzes image information or actually generates image data for further analysis. In this article, I introduce a tool that you can use to analyze images generated as part of medical diagnostic work.

In several diagnostic medical tests, complex three-dimensional images are generated that need to be visualized and analyzed. This is where 3D Slicer steps into the workflow. 3D Slicer is a very powerful tool for dissecting, analyzing and visualizing this type of complex 3D imaging data. It is fully open source, and it's available not only on Linux, but also on Windows and Mac OS X.

It's also built as a core program with a plugin architecture. This means you can add extra functionality to do completely new analysis.

Although 3D Slicer was written to handle medical images, the development team has been very careful to say that the software has not been approved for clinical use and shouldn't be used for diagnostic work. It's intended to be a research tool—hence its open-source license and plugin architecture, which aid in working with newly created algorithms and developing the next-generation tools that will be incorporated into diagnostic software.

Installation involves downloading a file directly from the project website. For Linux, this file is a gzipped tarball. You can select between a stable release or a nightly release. Once you download the tarball, you can unpack it with the command:


tar xvzf Slicer-4.6.2-linux.amd64.tar.gz

This unpacks everything into a subdirectory named Slicer-4.6.2-linux-amd64. Of course, the 4.6.2 portion will be different if you download a different version.

Once you have everything untarred, you can run it with:


./Slicer-4.6.2-linux-amd64/Slicer

When it starts, you end up with an empty project (Figure 1).

Figure 1. When you first start 3D Slicer, you get a display of an empty project, ready to start your work.

If you're trying to learn how to use 3D Slicer, you may not have any data to work with at first. Luckily, there is a button on the main window that allows you to download sample data. When you click it, you get a list of potential sample data sets available for download.

For this article's example, click the Download MRHead button and use the related data set (Figure 2).

Figure 2. Several sample data sets are available for you to learn with, such as this head MRI data.

Once downloaded, it's loaded automatically, and you can see the results in the three 2D slice viewing windows. A fourth window is used for 3D rendering, however. In order to get an image rendered there, you need to hover over the pin icon in the top left-hand corner of one of the 2D panes. Once you do, a small popup window appears where you can select a link icon to tell 3D Slicer to link all three slices together. You then can click the eye icon beside the link icon to tell 3D Slicer to render the 3D view of the image data (Figure 3).

Figure 3. You can get a 3-D rendering of the imaging data for alternative analysis options.

You can manipulate this rendered image with your mouse, which allows you to rotate it or change the zoom level. There also are several built-in visualization options, which are available by clicking the pin icon at the top left-hand corner of the 3D pane. Doing so pops up a new window where you can manipulate the 3D image, including setting the zoom level and what labels are displayed, and you even can make the image rotate automatically (Figure 4).

Figure 4. You can use several built-in functions to manipulate the 3D rendering of your imaging data.

Simply viewing the image data is not the only thing you likely will want to do as far as analyzing your data. This is where 3D Slicer's plugin architecture really shines. More than 100 modules are available in 36 different categories. You can find them in the dropdown box in the center at the top of the window (Figure 5).

Figure 5. A rather large collection of modules is available for data analysis.

This is where a lot of the real work gets done. As an example, say you wanted to apply an island removal filter to your image. You can select this option from the modules drop-down list, which adds a new entry within the left-hand pane. This is where you can select the required options, such as the input and output volumes, and the minimum island size (Figure 6). You then can click apply and let your computer run the process.

Figure 6. Activating the island removal module opens an options pane on the left-hand side.

What if the modules included with the default installation don't do what you need 3D Slicer to do? Click the menu item View→Extension Manager to pop up a new management window (Figure 7).

Figure 7. You can add and remove a large number of extra modules with the Extension Manager.

Installing a new module is as simple as clicking the install button. Once you do, you may need to restart 3D Slicer before the new module is available to use. You can uninstall any modules no longer needed by selecting the Manage Extensions tab in the Extension Manager.

Because so much work has been put into managing and manipulating three dimensional image data, 3D Slicer's capabilities have started to be used in other problem domains. As an example, there's a module named SlicerAstro that you can use to handle astronomical image data. It includes a number of sample data sets for exploring the functions available within SlicerAstro.

Loading one of the sample data sets provides output that is very similar to that which you saw above. Selecting the module drop-down list and clicking the Astronomy→Welcome to SlicerAstro entry pops up new information within the left-hand pane (Figure 8).

Figure 8. You can get extra information for newly installed modules, such as SlicerAstro.

Here you can download more sample data or get access to tutorials on how to use the SlicerAstro module. This is just one example of how you may want to extend 3D Slicer into your own problem domain of three-dimensional image analysis.

If you have complex imaging data that needs to be processed, hopefully this short introduction to 3D Slicer has provided a new option you may not have encountered before. It's heavily used in research applications, and with the ability to write your own extensions, it should be able to handle almost any work you want to throw at it. Just be aware that it has not been approved to do any diagnostic work. Also, note that a large number of tutorials are available online, covering many different problem domains. A little bit of Google-Fu should help you find examples to get started.

Load Disqus comments