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:
- mtx
numpy.ndarray
A 2- or 3- D array that contains the value of the nodes.
- atlas
str
,os.PathLike
, 3DNifti1Image
, ornumpy.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.
- filename
None
,str
, oros.PathLike
, optional The path to save the plot on disk.
- thr
float
,str
orNone
, optional The threshold to use in plotting the nodes. If str, needs to express a percentage.
- closeplot
bool
, optional Whether to close plots after saving or not. Mainly used for debug or use with live python/ipython instances.
- mtx
- 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