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)[source]

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_imgNiimg-like object

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

min_region_sizeint, 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. Default=1350mm^3, which means we take minimum size of 1350 / 27 = 50 voxels.

extract_typestr {‘local_regions’, ‘connected_components’}, 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. Default=’local_regions’.

smoothing_fwhmscalar, optional

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

mask_imgNiimg-like object, optional

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

Returns
regions_extracted_imgNifti1Image

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

index_of_each_mapnumpy 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