xcp_d.interfaces.censoring module
Interfaces for the post-processing workflows.
- class xcp_d.interfaces.censoring.Censor(from_file=None, resource_monitor=None, **inputs)[source]
Bases:
SimpleInterface
Apply temporal mask to data.
- Mandatory Inputs:
in_file (a pathlike object or string representing an existing file) – BOLD file after denoising, interpolation, and filtering.
temporal_mask (a pathlike object or string representing an existing file) – Temporal mask; all motion outlier volumes set to 1. This is a TSV file with one column: ‘framewise_displacement’.
- Outputs:
censored_denoised_bold (a pathlike object or string representing an existing file) – Censored BOLD file.
- class xcp_d.interfaces.censoring.GenerateConfounds(from_file=None, resource_monitor=None, **inputs)[source]
Bases:
SimpleInterface
Load, consolidate, and filter confounds.
Also, generate the temporal mask.
- Mandatory Inputs:
TR (a float) – Repetition time in seconds.
band_stop_max (a float or None) – Upper frequency for the band-stop motion filter, in breaths-per-minute (bpm).
band_stop_min (a float or None) – Lower frequency for the band-stop motion filter, in breaths-per-minute (bpm).
custom_confounds_file (a pathlike object or string representing an existing file or None) – Custom confounds tsv.
fmriprep_confounds_file (a pathlike object or string representing an existing file) – FMRIPrep confounds tsv.
fmriprep_confounds_json (a pathlike object or string representing an existing file) – FMRIPrep confounds json.
in_file (a pathlike object or string representing an existing file) – BOLD file after denoising, interpolation, and filtering.
motion_filter_order (an integer or None)
motion_filter_type (a string or None)
params (a string) – Parameter set for regression.
- Optional Inputs:
fd_thresh (a float) – Framewise displacement threshold. All values above this will be dropped.
head_radius (a float) – Head radius in mm .
- Outputs:
confounds_file (a pathlike object or string representing an existing file or None) – The selected confounds. This may include custom confounds as well.
confounds_metadata (a dictionary with keys which are any value and with values which are any value) – Metadata associated with the confounds_file output.
filtered_confounds_file (a pathlike object or string representing an existing file) – The original fMRIPrep confounds, with the motion parameters and their Volterra expansion regressors replaced with filtered versions.
motion_file (a pathlike object or string representing an existing file) – The filtered motion parameters.
motion_metadata (a dictionary with keys which are any value and with values which are any value) – Metadata associated with the filtered_motion output.
temporal_mask (a pathlike object or string representing an existing file) – Temporal mask; all values above fd_thresh set to 1. This is a TSV file with one column: ‘framewise_displacement’.
temporal_mask_metadata (a dictionary with keys which are any value and with values which are any value) – Metadata associated with the temporal_mask output.
- class xcp_d.interfaces.censoring.RandomCensor(from_file=None, resource_monitor=None, **inputs)[source]
Bases:
SimpleInterface
Randomly flag volumes to censor.
- Mandatory Inputs:
exact_scans (a list of items which are an integer) – Numbers of scans to retain. If None, no additional censoring will be performed.
temporal_mask (a pathlike object or string representing an existing file) – Temporal mask; all motion outlier volumes set to 1. This is a TSV file with one column: ‘framewise_displacement’.
- Optional Inputs:
random_seed (an integer or None) – Random seed. (Nipype default value:
None
)temporal_mask_metadata (a dictionary with keys which are any value and with values which are any value) – Metadata associated with the temporal_mask output.
- Outputs:
temporal_mask (a pathlike object or string representing an existing file) – Temporal mask file.
temporal_mask_metadata (a dictionary with keys which are any value and with values which are any value) – Metadata associated with the temporal_mask output.
- class xcp_d.interfaces.censoring.RemoveDummyVolumes(from_file=None, resource_monitor=None, **inputs)[source]
Bases:
SimpleInterface
Removes initial volumes from a nifti or cifti file.
A bold file and its corresponding confounds TSV (fmriprep format) are adjusted to remove the first n seconds of data.
- Mandatory Inputs:
bold_file (a pathlike object or string representing an existing file) – Either cifti or nifti .
confounds_file (a pathlike object or string representing an existing file or None) – TSV file with selected confounds for denoising. May be None if denoising is disabled.
dummy_scans (an integer or ‘auto’) – Number of volumes to drop from the beginning, calculated in an earlier workflow from dummy_scans.
fmriprep_confounds_file (a pathlike object or string representing an existing file) – FMRIPrep confounds tsv. Used for motion-based censoring.
motion_file (a pathlike object or string representing an existing file) – Confounds file containing only filtered motion parameters.
temporal_mask (a pathlike object or string representing an existing file) – Temporal mask file.
- Outputs:
bold_file_dropped_TR (a pathlike object or string representing an existing file) – Bold or cifti with volumes dropped.
confounds_file_dropped_TR (a pathlike object or string representing an existing file or None) – TSV file with selected confounds for denoising, after removing TRs.
dummy_scans (an integer) – Number of volumes dropped.
fmriprep_confounds_file_dropped_TR (a pathlike object or string representing an existing file) – FMRIPrep confounds tsv after removing TRs. Used for motion-based censoring.
motion_file_dropped_TR (a pathlike object or string representing an existing file) – Confounds file containing only filtered motion parameters.
temporal_mask_dropped_TR (a pathlike object or string representing an existing file) – Temporal mask file.