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.

8.8.1. nilearn.regions.connected_regions

nilearn.regions.connected_regions(maps_img, min_region_size=1350, extract_type='local_regions', smoothing_fwhm=6, mask_img=None)

Extraction of brain connected regions into separate regions.

Note: the region size should be defined in mm^3. See the documentation for more details.

New in version 0.2.

Parameters:

maps_img: Niimg-like object

an image of brain activation or atlas maps to be extracted into set of separate brain regions.

min_region_size: int, default 1350 mm^3, optional

Minimum volume in mm3 for a region to be kept. For example, if the voxel size is 3x3x3 mm then the volume of the voxel is 27mm^3. By default, it is 1350mm^3 which means we take minimum size of 1350 / 27 = 50 voxels.

extract_type: str {‘connected_components’, ‘local_regions’} default local_regions, optional

If ‘connected_components’, each component/region in the image is extracted automatically by labelling each region based upon the presence of unique features in their respective regions. If ‘local_regions’, each component/region is extracted based on their maximum peak value to define a seed marker and then using random walker segementation algorithm on these markers for region separation.

smoothing_fwhm: scalar, default 6mm, optional

To smooth an image to extract most sparser regions. This parameter is passed _smooth_array and exists only for extract_type ‘local_regions’.

mask_img: Niimg-like object, default None

If given, mask image is applied to input data. If None, no masking is applied.

Returns:

regions_extracted_img: Nifti1Image

gives the image in 4D of extracted brain regions. Each 3D image consists of only one separated region.

index_of_each_map: numpy array

an array of list of indices where each index denotes the identity of each extracted region to their family of brain maps.

See also

nilearn.regions.connected_label_regions
A function can be used for extraction of regions on labels based atlas images.
nilearn.regions.RegionExtractor
A class can be used for both region extraction on continuous type atlas images and also time series signals extraction from regions extracted.

8.8.1.1. Examples using nilearn.regions.connected_regions