NIPY logo

Site Navigation

NIPY Community

Previous topic

nipy.neurospin.utils.mask.compute_mask_files

Next topic

Empirical null

This Page

nipy.neurospin.utils.mask.compute_mask_sessions

nipy.neurospin.utils.mask.compute_mask_sessions(session_files, m=0.2, M=0.9, cc=1, threshold=0.5)

Compute a common mask for several sessions of fMRI data.

Uses the mask-finding algorithmes to extract masks for each session, and then keep only the main connected component of the a given fraction of the intersection of all the masks.
Parameters :

session_files : list of list of strings

A list of list of nifti filenames. Each inner list represents a session.

threshold : float, optional

the inter-session threshold: the fraction of the total number of session in for which a voxel must be in the mask to be kept in the common mask. threshold=1 corresponds to keeping the intersection of all masks, whereas threshold=0 is the union of all masks.

m : float, optional

lower fraction of the histogram to be discarded.

M: float, optional :

upper fraction of the histogram to be discarded.

cc: boolean, optional :

if cc is True, only the largest connect component is kept.

Returns :

mask : 3D boolean ndarray

The brain mask