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.index_img

nilearn.image.index_img(imgs, index)

Indexes into a 4D Niimg-like object in the fourth dimension.

Common use cases include extracting a 3D image out of img or creating a 4D image whose data is a subset of img data.

Parameters:

imgs: 4D Niimg-like object :

index: Any type compatible with numpy array indexing :

Used for indexing the 4D data array in the fourth dimension.

Returns:

output: nibabel.Nifti1Image :