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.

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.

Parameters
niimgsiterable of Niimg-like objects or glob pattern

See https://nilearn.github.io/stable/manipulating_images/input_output.html # noqa:E501 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.

Returns
concatenatednibabel.Nifti1Image

A single image.

Examples using nilearn.image.concat_imgs#

3D and 4D niimgs: handling and visualizing

3D and 4D niimgs: handling and visualizing

3D and 4D niimgs: handling and visualizing
Intro to GLM Analysis: a single-session, single-subject fMRI dataset

Intro to GLM Analysis: a single-session, single-subject fMRI dataset

Intro to GLM Analysis: a single-session, single-subject fMRI dataset
Visualizing global patterns with a carpet plot

Visualizing global patterns with a carpet plot

Visualizing global patterns with a carpet plot
Single-subject data (two sessions) in native space

Single-subject data (two sessions) in native space

Single-subject data (two sessions) in native space
Predicted time series and residuals

Predicted time series and residuals

Predicted time series and residuals
Beta-Series Modeling for Task-Based Functional Connectivity and Decoding

Beta-Series Modeling for Task-Based Functional Connectivity and Decoding

Beta-Series Modeling for Task-Based Functional Connectivity and Decoding