NIPY logo

Site Navigation

NIPY Community

Github repo

Previous topic

nipy.labs.utils.mask.compute_mask_files

Next topic

Empirical null

This Page

nipy.labs.utils.mask.compute_mask_sessions

nipy.labs.utils.mask.compute_mask_sessions(session_files, m=0.20000000000000001, M=0.90000000000000002, cc=1, threshold=0.5, exclude_zeros=False, return_mean=False)

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.

exclude_zeros: boolean, optional :

Consider zeros as missing values for the computation of the threshold. This option is useful if the images have been resliced with a large padding of zeros.

return_mean: boolean, optional :

if return_mean is True, the mean image accross subjects is returned.

Returns :

mask : 3D boolean ndarray

The brain mask

mean : 3D float array

The mean image