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_regions(maps_img, min_region_size=1350, extract_type='local_regions', smoothing_fwhm=6, mask_img=None)[source]

Extract brain connected regions into separate regions.


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

Added in version 0.2.

maps_imgNiimg-like object

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

min_region_sizefloat, default=1350

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.

extractor{“local_regions”, “connected_components”}, default=”local_regions”

This option can take two values:

  • “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.

  • “local_regions”: each component/region is extracted based on their maximum peak value to define a seed marker and then using random walker segmentation algorithm on these markers for region separation.

smoothing_fwhmfloat, optional.

If smoothing_fwhm is not None, it gives the full-width at half maximum in millimeters of the spatial smoothing to apply to the signal. Use this parameter to smooth an image to extract most sparser regions.


This parameter is passed to nilearn.image.image.smooth_array. It will be used only if extract_type='local_regions'.


mask_imgNiimg-like object, optional

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


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


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

See also


A function can be used for extraction of regions on labels based atlas images.


A class can be used for both region extraction on continuous type atlas images and also time series signals extraction from regions extracted.

Examples using nilearn.regions.connected_regions

Region Extraction using a t-statistical map (3D)

Region Extraction using a t-statistical map (3D)