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_2d’ function.
Demo activation map plotting.
Plot three cuts of a given activation map (Frontal, Axial, and Lateral)
Parameters : | map : 3D ndarray
affine : 4x4 ndarray
cut_coords: 3-tuple of floats or None :
anat : 3D ndarray or False, optional
anat_affine : 4x4 ndarray, optional
figure : integer or matplotlib figure, optional
axes : matplotlib axes or 4 tuple of float: (xmin, xmax, ymin, ymin), optional
title : string, optional
threshold : a number, None, or ‘auto’
annotate: boolean, optional :
draw_cross: boolean, optional :
do3d: {True, False or ‘interactive’}, optional :
view_3d: tuple, :
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)