Nuisance Signal Removal

CPAC.nuisance.find_offending_time_points(fd_j_file_path=None, fd_p_file_path=None, dvars_file_path=None, fd_j_threshold=None, fd_p_threshold=None, dvars_threshold=None, number_of_previous_trs_to_censor=0, number_of_subsequent_trs_to_censor=0)[source]

Applies criterion in method to find time points whose FD or DVARS (or both) are above threshold.

Parameters:
  • fd_j_file_path – path to TSV containing framewise displacement as a single column. If not specified, it will not be used.
  • fd_p_file_path – path to TSV containing framewise displacement as a single column. If not specified, it will not be used.
  • dvars_file_path – path to TSV containing DVARS as a single column. If not specified, it will not be used.
  • fd_j_threshold – threshold to apply to framewise displacement (Jenkinson), it can be a value such as 0.2 or a floating point multiple of the standard deviation specified as, e.g. ‘1.5SD’.
  • fd_p_threshold – threshold to apply to framewise displacement (Power), it can be a value such as 0.2 or a floating point multiple of the standard deviation specified as, e.g. ‘1.5SD’.
  • dvars_threshold – threshold to apply to DVARS, can be a value such as 0.5 or a floating point multiple of the standard deviation specified as, e.g. ‘1.5SD’.
  • number_of_previous_trs_to_censor – extent of censorship window before the censor.
  • number_of_subsequent_trs_to_censor – extent of censorship window after the censor.
Returns:

File path to TSV file containing the volumes to be censored.

CPAC.nuisance.generate_summarize_tissue_mask(nuisance_wf, pipeline_resource_pool, regressor_descriptor, regressor_selector, use_ants=True, ventricle_mask_exist=True)[source]

Add tissue mask generation into pipeline according to the selector.

Parameters:
  • nuisance_wf – Nuisance regressor workflow.
  • pipeline_resource_pool – dictionary of available resources.
  • regressor_descriptor – dictionary of steps to build, including keys: ‘tissue’, ‘resolution’, ‘erosion’
  • regressor_selector – dictionary with the original selector
Returns:

the full path of the 3D nifti file containing the mask created by this operation.

CPAC.nuisance.bandpass_voxels(realigned_file, regressor_file, bandpass_freqs, sample_period=None)[source]

Performs ideal bandpass filtering on each voxel time-series.

Parameters:
realigned_file : string

Path of a realigned nifti file.

bandpass_freqs : tuple

Tuple containing the bandpass frequencies. (LowCutoff_HighPass HighCutoff_LowPass)

sample_period : float, optional

Length of sampling period in seconds. If not specified, this value is read from the nifti file provided.

Returns:
bandpassed_file : string

Path of filtered output (nifti file).

CPAC.nuisance.cosine_filter(input_image_path, timestep, period_cut=128, remove_mean=True, axis=-1, failure_mode='error')[source]
input_image_path: string
Bold image to be filtered.
timestep: float
‘Repetition time (TR) of series (in sec) - derived from image header if unspecified’
period_cut: float
Minimum period (in sec) for DCT high-pass filter, nipype default value: 128