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.8. nilearn.image.largest_connected_component_img

nilearn.image.largest_connected_component_img(imgs)

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

New in version 0.3.1.

Parameters:

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

See http://nilearn.github.io/manipulating_images/input_output.html Image(s) to extract the largest connected component from.

Returns:

img or list of img 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.