Giving credit

4.5.1.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 :

Region definitions using labels.

mask_img: niimg, 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.