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.regions.connected_label_regions(labels_img, min_size=None, connect_diag=True, labels=None)#
Extract connected regions from a brain atlas image defined by labels (integers).
For each label in a parcellation, separates out connected components and assigns to each separated region a unique label.
- labels_imgNifti-like image
A 3D image which contains regions denoted as labels. Each region is assigned with integers.
Minimum region size (in mm^3) in volume required to keep after extraction. Removes small or spurious regions.
If ‘connect_diag’ is True, two voxels are considered in the same region if they are connected along the diagonal (26-connectivity). If it is False, two voxels are considered connected only if they are within the same x, y, or z direction.
Each string in a list or array denote the name of the brain atlas regions given in labels_img input. If provided, same names will be re-assigned corresponding to each connected component based extraction of regions relabelling. The total number of names should match with the number of labels assigned in the image.
The order of the names given in labels should be appropriately matched with the unique labels (integers) assigned to each region given in labels_img (also excluding ‘Background’ label).