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

nilearn.image.largest_connected_component_img(imgs)[source]

Return the largest connected component of an image or list of images.

Added in version 0.3.1.

Parameters:
imgsNiimg-like object or iterable of Niimg-like objects (3D)

Image(s) to extract the largest connected component from. See Input and output: neuroimaging data representation.

Returns:
3D Niimg-like object or list of

Image or list of images containing the largest connected component.

Notes

Handling big-endian in given Nifti image This function changes the existing byte-ordering information to new byte order, if the dtype in given Nifti image has non-native data type. This operation is done internally to avoid big-endian issues with scipy ndimage module.