Utilities for extracting masks from EPI images and applying them to time series.
Compute a mask file from fMRI data in 3D or 4D ndarrays.
Compute and write the mask of an image based on the grey level This is based on an heuristic proposed by T.Nichols: find the least dense point of the histogram, between fractions m and M of the total image histogram.
In case of failure, it is usually advisable to increase m.
Parameters : | mean_volume : 3D ndarray
reference_volume: 3D ndarray, optional :
m : float, optional
M: float, optional :
cc: boolean, optional :
opening: boolean, optional :
|
---|---|
Returns : | mask : 3D boolean ndarray
|
Compute a mask file from fMRI nifti file(s)
Compute and write the mask of an image based on the grey level This is based on an heuristic proposed by T.Nichols: find the least dense point of the histogram, between fractions m and M of the total image histogram.
In case of failure, it is usually advisable to increase m.
Parameters : | input_filename : string
output_filename : string or None, optional
return_mean : boolean, optional
m : float, optional
M: float, optional :
cc: boolean, optional :
|
---|---|
Returns : | mask : 3D boolean array
mean_image : 3d ndarray, optional
|
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
threshold : float, optional
m : float, optional
M: float, optional :
cc: boolean, optional :
|
---|---|
Returns : | mask : 3D boolean ndarray
|
Given a list of input mask images, generate the output image which is the the threshold-level intersection of the inputs
Parameters : | input_masks: list of strings or ndarrays :
output_filename, string: :
threshold: float within [0, 1[, optional :
cc: bool, optional :
|
---|---|
Returns : | grp_mask, boolean array of shape the image shape : |
Return the largest connected component of a 3D mask array.
Parameters : | mask: 3D boolean array :
|
---|---|
Returns : | mask: 3D boolean array :
|
Read the time series from the given sessions filenames, using the mask.
Parameters : | filenames: list of 3D nifti file names, or 4D nifti filename. :
mask: 3d ndarray :
smooth: False or float, optional :
ensure_finite: boolean :
|
---|---|
Returns : | session_series: ndarray :
header: header object :
|
Notes
When using smoothing, ensure_finite should be True: as elsewhere non finite values will spread accross the image.
Given a map with some coefficients set to zero, segment the connect components with number of voxels smaller than the threshold and set them to 0.
Parameters : | map: ndarray :
threshold: :
copy: bool, optional :
|
---|