Show overlay map in sliced glassbrain

1. Upload all statistical maps into the data folder

The data folder can be found in the same folder as this notebook. Just drag and drop your NIfTI file into the data folder and press the upload button.

2. Specify relevant visualization parameters


In [1]:
# Template to use for background
mnipath = '../scripts/templates/MNI152_T1_1mm_brain.nii.gz'

# Direction to make the cuts, can be x, y, z, xy, xz, yz, xyz
ortho = 'xyz'

# How many rows should the cuts be distributed over
nRows = 2

# How many cuts should be included in the figure
nCuts = 6

# Should left / right annotation be shown
showLRannot = 1

# What should be shown: Brain, Numbers, Both
figLayout = 'Both'

# Positive threshold for overlay
threshpos = 3

# Negative threshold for overlay
threshneg = 3

# Should optimal cut spacing be estimated or not (not means equal spacing)
findOptimalCut = 1

# File extension to use for figure
imageType = 'png'

3. Run the visualization script


In [2]:
%run ../scripts/plot_glassbrain_slices.py \
    data \
    $mnipath \
    $ortho \
    $nRows \
    $nCuts \
    $showLRannot \
    $figLayout \
    $threshpos \
    $threshneg \
    $findOptimalCut \
    $imageType


/home/mnotter/anaconda/lib/python2.7/site-packages/nilearn/plotting/displays.py:649: UserWarning: empty mask
  get_mask_bounds(new_img_like(img, not_mask, affine))
/home/mnotter/anaconda/lib/python2.7/site-packages/numpy/ma/core.py:4144: UserWarning: Warning: converting a masked element to nan.
  warnings.warn("Warning: converting a masked element to nan.")

4. Look at your data


In [3]:
from IPython.display import Image, display
outputs = sorted(gg('data/figures/*.%s' % imageType))
for o in outputs:
    a = Image(filename=o)
    display(a)