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

nilearn.image.concat_imgs(niimgs, dtype=<class 'numpy.float32'>, ensure_ndim=None, memory=Memory(location=None), memory_level=0, auto_resample=False, verbose=0)[source]

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.

niimgsiterable of Niimg-like objects or glob pattern

See Niimgs to concatenate.

dtypenumpy dtype, optional

The dtype of the returned image. Default=np.float32.

ensure_ndiminteger, optional

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

auto_resampleboolean, optional

Converts all images to the space of the first one. Default=False.

verboseint, optional

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

memoryinstance of joblib.Memory or string, optional

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. Default=Memory(location=None).

memory_levelinteger, optional

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


A single image.