Giving credit

Previous topic

7.9.1. nilearn.mass_univariate.permuted_ols

Next topic

7.10.2. nilearn.plotting.find_xyz_cut_coords

Note

This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the user guide for the big picture.

7.10.1. nilearn.plotting.find_cut_slices

nilearn.plotting.find_cut_slices(img, direction='z', n_cuts=7, spacing='auto')

Find ‘good’ cross-section slicing positions along a given axis.

Parameters:

img: 3D Nifti1Image

the brain map

direction: string, optional (default “z”)

sectional direction; possible values are “x”, “y”, or “z”

n_cuts: int, optional (default 7)

number of cuts in the plot

spacing: ‘auto’ or int, optional (default ‘auto’)

minimum spacing between cuts (in voxels, not milimeters) if ‘auto’, the spacing is .5 / n_cuts * img_length

Returns:

cut_coords: 1D array of length n_cuts

the computed cut_coords

Notes

This code works by iteratively locating peak activations that are separated by a distance of at least ‘spacing’. If n_cuts is very large and all the activated regions are covered, cuts with a spacing less than ‘spacing’ will be returned.