Nuisance Signal Removal

CPAC.nuisance.create_nuisance(use_ants, name='nuisance')[source]

Workflow for the removal of various signals considered to be noise in resting state fMRI data. The residual signals for linear regression denoising is performed in a single model. Therefore the residual time-series will be orthogonal to all signals.

name : string, optional
Name of the workflow.
nuisance : nipype.pipeline.engine.Workflow
Nuisance workflow.

Workflow Inputs:

inputspec.subject : string (nifti file)
    Path of the subject's realigned nifti file.
inputspec.wm_mask : string (nifti file)
    Corresponding white matter mask.
inputspec.csf_mask : string (nifti file)
    Corresponding cerebral spinal fluid mask.
inputspec.gm_mask : string (nifti file)
    Corresponding grey matter mask.
inputspec.mni_to_anat_linear_xfm : string (nifti file)
    Corresponding MNI to anatomical linear transformation 
inputspec.func_to_anat_linear_xfm : string (nifti file)
    Corresponding EPI to anatomical linear transformation
inputspec.harvard_oxford_mask : string (nifti file)
    Harvard Oxford parcellation for ventrical locations
inputspec.motion_components : string (text file)
    Corresponding rigid-body motion parameters.  Matrix in the file should be of shape 
    (`T`, `R`), `T` timepoints and `R` motion parameters.
inputspec.selector : dictionary
inputspec.compcor_ncomponents : integer

Workflow Outputs:

outputspec.subject : string (nifti file)
    Path of residual file in nifti format
outputspec.regressors : string (mat file)
    Path of csv file of regressors used.  Filename corresponds to the name of each
    regressor in each column.

Nuisance Procedure:

  1. Compute nuisance regressors based on input selections.
  2. Calculate residuals with respect to these nuisance regressors in a single model for every voxel.

Workflow Graph:

workflows/../images/nuisance.dot.png

Detailed Workflow Graph:

workflows/../images/nuisance_detailed.dot.png
CPAC.nuisance.calc_residuals(subject, selector, wm_sig_file=None, csf_sig_file=None, gm_sig_file=None, motion_file=None, compcor_ncomponents=0)[source]

Calculates residuals of nuisance regressors for every voxel for a subject.

subject : string
Path of a subject’s realigned nifti file.
selector : dictionary
Dictionary of selected regressors. Keys are represented as a string of the regressor name and keys are True/False. See notes for an example.
wm_mask_file : string, optional
Path to subject’s white matter mask (in the same space as the subject’s functional file)
csf_mask_file : string, optional
Path to subject’s cerebral spinal fluid mask (in the same space as the subject’s functional file)
gm_mask_file : string, optional
Path to subject’s grey matter mask (in the same space as the subject’s functional file)
compcor_ncomponents : integer, optional
The first n principal of CompCor components to use as regressors. Default is 0.
residual_file : string
Path of residual file in nifti format
regressors_file : string
Path of csv file of regressors used. Filename corresponds to the name of each regressor in each column.

Example of selector parameter:

>>> selector = {'compcor' : True,
>>> 'wm' : True,
>>> 'csf' : True,
>>> 'gm' : True,
>>> 'global' : True,
>>> 'pc1' : True,
>>> 'motion' : True,
>>> 'linear' : True,
>>> 'quadratic' : True}
CPAC.nuisance.bandpass_voxels(realigned_file, bandpass_freqs, sample_period=None)[source]

Performs ideal bandpass filtering on each voxel time-series.

realigned_file : string
Path of a realigned nifti file.
bandpass_freqs : tuple
Tuple containing the bandpass frequencies. (LowCutoff, HighCutoff)
sample_period : float, optional
Length of sampling period in seconds. If not specified, this value is read from the nifti file provided.
bandpassed_file : string
Path of filtered output (nifti file).