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.
8.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 Niimg-like object
See http://nilearn.github.io/manipulating_images/input_output.html 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.