Sweet-sour spot
Last updated
Last updated
Some analysis produce an image containing a sweet and sour spot in MNI space. In this example we want to visualize this image with Slicer, together with a reference atlas.
The steps to realize this are the following (this is just one way to do it):
Load template image (for example t1 MNI image).
Load image containing the sweet-sour spot.
Set the template as background and sweet-sour as foreground in the viewers.
Change the sweet-sour colormap.
With this we come up with something like the following (see included text annotations for some notes on using Slicer):
The issue with this approach is that when visualizing images that range from negative to positive values we still see the voxels with value zero, and close to zero. This is usually not the intended purpose when visualizing a sweet-sour image. When thresholding with the GUI in the Volumes module, it is not possible to mask out inner ranges.
Alternative 1: Create an image for the positive values and another one for the negative ones. The problem here is that it is not possible to visualize 3 Volumes (positive, negative and template) at the same time in Slicer.
Alternative 2: Use the Segment editor to threshold the image and create segmentations of the sweet and sour spots. The problem here is that the segments are seen with one color and not with a gradient indicating the intensity ranges.
Here, we will use Slicer's scripting capabilities to customize the range of the image that we see. Select View -> Python Interactor to see the python command window. See Slicer's scripting repository to see the interactor capabilities.
Set the name of the volume in your scene. Here, it is 'sweet-sour'
.
The values specified within [negative_threshold, positive_threshold]
will be masked out.
This will apply the threshold, but we still need to update the display node. This will also set the min/max range to the min/max values of the image.
Now we reached the following:
The following specifies a custom colormap, based on three colors (min, center, max):
Use the following to go back to original (and start over if wanted).
This tutorial shows a way to visualize a sweet-sour image in Slicer while masking out an inner range of the intensity values. Further things can be automatized by scripting in Slicer, like loading the images and saving screenshots (see the script repository for more examples).
Here are all the commands for easier copy-pasting: