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.

6.7.2. nilearn.region.signals_to_img_labels

nilearn.region.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 :

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.