nigsp.viz.plot_edges

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

Create a connectivity plot in the MNI space.

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

Parameters:
mtxnumpy.ndarray

A 2- or 3- 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, str or None, optional

The threshold to use in plotting the nodes. If str, needs to express a percentage.

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 mtx has more than 3 dimensions. If coordinates can’t be extracted from atlas.

Notes

Requires matplotlib and nilearn