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.

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_sizefloat, 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.

extractor{‘local_regions’, ‘connected_components’}, optional

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.

Default=’local_regions’.

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.

Note

This parameter is passed to nilearn.image.image._smooth_array. It will be used only if 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_imgnibabel.nifti1.Nifti1Image

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

index_of_each_mapnumpy.ndarray

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.

Examples using nilearn.regions.connected_regions#

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

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

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