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.7.7. nilearn.masking.intersect_masks¶
nilearn.masking.
intersect_masks
(mask_imgs, threshold=0.5, connected=True)¶Compute intersection of several masks
Given a list of input mask images, generate the output image which is the threshold-level intersection of the inputs
Parameters: mask_imgs: list of Niimg-like objects
See http://nilearn.github.io/manipulating_images/input_output.html 3D individual masks with same shape and affine.
threshold: float, optional
Gives the level of the intersection, must be within [0, 1]. threshold=1 corresponds to keeping the intersection of all masks, whereas threshold=0 is the union of all masks.
connected: bool, optional
If true, extract the main connected component
Returns: grp_mask: 3D nibabel.Nifti1Image
intersection of all masks.