nigsp.viz.plot_nodes

nigsp.viz.plot_nodes(ns, atlas, filename=None, thr=None, closeplot=False)[source]

Create a marker plot in the MNI space.

If ns has 2 dimensions, average first along last dimension.

Parameters:
nsnumpy.ndarray

A 1- or 2- D array that contains the value of the nodes.

atlasstr, os.PathLike, 3D Nifti1Image, or numpy.ndarray

The 3d nifti image of an atlas, a string or path to its position, or a list of coordinates of the center of mass of parcels.

filenameNone, str, or os.PathLike, optional

The path to save the plot on disk.

thrfloat or None, optional

The threshold to use in plotting the nodes.

closeplotbool, optional

Whether to close plots after saving or not. Mainly used for debug or use with live python/ipython instances.

Returns:
0

If there are no errors.

Raises:
ImportError

If matplotlib and/or nilearn are not installed.

ValueError

If ns has more than 2 dimensions. If coordinates can’t be extracted from atlas.

Notes

Requires matplotlib and nilearn