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.5.2. nilearn.image.concat_imgs

nilearn.image.concat_imgs(niimgs, dtype=<type ‘numpy.float32’>, ensure_ndim=None, memory=Memory(cachedir=None), memory_level=0, auto_resample=False, verbose=0)

Concatenate a list of 3D/4D niimgs of varying lengths.

The niimgs list can contain niftis/paths to images of varying dimensions (i.e., 3D or 4D) as well as different 3D shapes and affines, as they will be matched to the first image in the list if auto_resample=True.

Parameters:

niimgs: iterable of Niimg-like objects or glob pattern

dtype: numpy dtype, optional

the dtype of the returned image

ensure_ndim: integer, optional

Indicate the dimensionality of the expected niimg. An error is raised if the niimg is of another dimensionality.

auto_resample: boolean

Converts all images to the space of the first one.

verbose: int

Controls the amount of verbosity (0 means no messages).

memory : instance of joblib.Memory or string

Used to cache the resampling process. By default, no caching is done. If a string is given, it is the path to the caching directory.

memory_level : integer, optional

Rough estimator of the amount of memory used by caching. Higher value means more memory for caching.

Returns:

concatenated: nibabel.Nifti1Image

A single image.