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.8.4. nilearn.regions.signals_to_img_labels¶
nilearn.regions.
signals_to_img_labels
(signals, labels_img, mask_img=None, background_label=0, order='F')¶Create image from region signals defined as labels.
The same region signal is used for each voxel of the corresponding 3D volume.
labels_img, mask_img must have the same shapes and affines.
Parameters: signals: numpy.ndarray
2D array with shape: (scan number, number of regions in labels_img)
labels_img: Niimg-like object
See http://nilearn.github.io/manipulating_images/input_output.html Region definitions using labels.
mask_img: Niimg-like object, optional
Boolean array giving voxels to process. integer arrays also accepted, In this array, zero means False, non-zero means True.
background_label: number
label to use for “no region”.
order: str
ordering of output array (“C” or “F”). Defaults to “F”.
Returns: img: nibabel.Nifti1Image
Reconstructed image. dtype is that of “signals”, affine and shape are those of labels_img.
See also
nilearn.regions.img_to_signals_labels
,nilearn.regions.signals_to_img_maps
nilearn.input_data.NiftiLabelsMasker
- Signal extraction on labels images e.g. clusters