Functions to do automatic visualization of activation-like maps.
For 2D-only visualization, only matplotlib is required. For 3D visualization, Mayavi, version 3.0 or greater, is required.
For a demo, see the ‘demo_plot_map’ function.
Demo activation map plotting.
Plot three cuts of an anatomical image (Frontal, Axial, and Lateral)
Parameters : | anat : 3D ndarray, optional
anat_affine : 4x4 ndarray, optional
figure : integer or matplotlib figure, optional
cut_coords: None, or a tuple of floats :
slicer: {‘ortho’, ‘x’, ‘y’, ‘z’} :
figure : integer or matplotlib figure, optional
axes : matplotlib axes or 4 tuple of float: (xmin, ymin, width, height), optional
title : string, optional
annotate: boolean, optional :
draw_cross: boolean, optional :
black_bg: boolean, optional :
dim: float, optional :
cmap: matplotlib colormap, optional :
|
---|
Notes
Arrays should be passed in numpy convention: (x, y, z) ordered.
Plot three cuts of a given activation map (Frontal, Axial, and Lateral)
Parameters : | map : 3D ndarray
affine : 4x4 ndarray
cut_coords: None, int, or a tuple of floats :
anat : 3D ndarray or False, optional
anat_affine : 4x4 ndarray, optional
slicer: {‘ortho’, ‘x’, ‘y’, ‘z’} :
figure : integer or matplotlib figure, optional
axes : matplotlib axes or 4 tuple of float: (xmin, ymin, width, height), optional
title : string, optional
threshold : a number, None, or ‘auto’
annotate: boolean, optional :
draw_cross: boolean, optional :
do3d: {True, False or ‘interactive’}, optional :
threshold_3d: :
view_3d: tuple, :
black_bg: boolean, optional :
kwargs: extra keyword arguments, optional :
|
---|
Notes
Arrays should be passed in numpy convention: (x, y, z) ordered.
Use masked arrays to create transparency:
import numpy as np map = np.ma.masked_less(map, 0.5) plot_map(map, affine)