xcp_d.workflows.bold.init_postprocess_nifti_wf

xcp_d.workflows.bold.init_postprocess_nifti_wf(bold_file, bandpass_filter, high_pass, low_pass, bpf_order, motion_filter_type, motion_filter_order, band_stop_min, band_stop_max, smoothing, head_radius, params, output_dir, custom_confounds_folder, dummy_scans, fd_thresh, despike, dcan_qc, run_data, t1w_available, t2w_available, n_runs, min_coverage, omp_nthreads, layout=None, name='bold_postprocess_wf')[source]

Organize the bold processing workflow.

Workflow Graph

(Source code)

Parameters:
  • bold_file (str) – bold file for post processing

  • bandpass_filter (bool) – If True, a Butterworth bandpass filter will be applied to the fMRI data after interpolation, but before regression. If False, bandpass filtering will not be performed.

  • high_pass (float) – Lower cut-off frequency for the Butterworth bandpass filter, in Hertz. The bandpass filter is applied to the fMRI data after post-processing and denoising. Bandpass filtering will only be performed if bandpass_filter is True. This internal parameter corresponds to the command-line parameter --lower-bpf. If set to <= 0, high-pass filtering will be disabled.

    Default value is 0.01.

  • low_pass (float) – Upper cut-off frequency for the Butterworth bandpass filter, in Hertz. The bandpass filter is applied to the fMRI data after post-processing and denoising. Bandpass filtering will only be performed if bandpass_filter is True. This internal parameter corresponds to the command-line parameter --upper-bpf. If set to <= 0, low-pass filtering will be disabled.

    Default value is 0.08.

  • bpf_order (int) – Number of filter coefficients for Butterworth bandpass filter. Bandpass filtering will only be performed if bandpass_filter is True. This parameter is used in conjunction with lower_bpf/high_pass and upper_bpf/low_pass.

  • motion_filter_type ({None, “lp”, “notch”}) – Type of filter to use for removing respiratory artifact from motion regressors.

    If None, no filter will be applied.

    If the filter type is set to “notch”, frequencies between band_stop_min and band_stop_max will be removed with a notch filter. In this case, both band_stop_min and band_stop_max must be defined.

    If “lp”, frequencies above band_stop_min will be removed with a Butterworth filter. In this case, only band_stop_min must be defined.

  • motion_filter_order (int) – Number of filter coefficients for the motion parameter filter. Motion filtering is only performed if motion_filter_type is not None. This parameter is used in conjunction with band_stop_max and band_stop_min.

  • band_stop_min (float or None) – Lower frequency for the motion parameter filter, in breaths-per-minute (bpm). Motion filtering is only performed if motion_filter_type is not None. If used with the “lp” motion_filter_type, this parameter essentially corresponds to a low-pass filter (the maximum allowed frequency in the filtered data). This parameter is used in conjunction with motion_filter_order and band_stop_max.

    Here is a list of recommended values, based on participant age:

    Age Range (years)

    Recommended Value

    < 1

    30

    1 - 2

    25

    2 - 6

    20

    6 - 12

    15

    12 - 18

    12

    19 - 65

    12

    65 - 80

    12

    > 80

    10

    When motion_filter_type is set to “lp” (low-pass filter), another commonly-used value for this parameter is 6 BPM (equivalent to 0.1 Hertz), based on Gratton et al.[1].

  • band_stop_max (float or None) – Upper frequency for the motion parameter filter, in breaths-per-minute (bpm). Motion filtering is only performed if motion_filter_type is not None. This parameter is only used if motion-filter-type is set to “notch”. This parameter is used in conjunction with motion_filter_order and band_stop_min.

    Here is a list of recommended values, based on participant age:

    Age Range (years)

    Recommended Value

    < 1

    60

    1 - 2

    50

    2 - 6

    35

    6 - 12

    25

    12 - 18

    20

    19 - 65

    18

    65 - 80

    28

    > 80

    30

  • smoothing (float) – The full width at half maximum (FWHM), in millimeters, of the Gaussian smoothing kernel that will be applied to the post-processed and denoised data. ALFF and ReHo outputs will also be smoothing with this kernel.

  • head_radius (float or “auto”) – Radius of the head, in millimeters, for framewise displacement calculation.

    xcp_d’s default head radius is 50. The recommended value for infants is 35. A value of ‘auto’ is also supported, in which case the brain radius is estimated from the preprocessed brain mask. This will already be estimated before this workflow.

  • params ({“36P”, “24P”, “27P”, “acompcor”, “acompcor_gsr”, “aroma”, “aroma_gsr”, “custom”}, optional) – Shorthand for the parameter set to extract from the confounds TSV. Default is “36P”, most expansive option.

  • output_dir (str) – Path to the output directory for xcp_d derivatives. This should not include the xcp_d folder. For example, “/path/to/dset/derivatives/”.

  • custom_confounds_folder (str or None) – Path to folder containing custom nuisance regressors. Must be a folder containing confounds files, in which case the file with the name matching the preprocessing confounds file will be selected.

  • dummy_scans (int or “auto”) – Number of volumes to remove from the beginning of each run. If set to ‘auto’, xcp_d will extract non-steady-state volume indices from the preprocessing derivatives’ confounds file.

  • fd_thresh (float) – Framewise displacement threshold for censoring, in millimeters. Any framewise displacement values higher than the threshold are flagged as “high motion”. If set to <=0, no censoring will be performed. Default is 0.2 mm.

  • despike (bool) – If True, the BOLD data will be despiked before censoring/denoising/filtering/interpolation. If False, no despiking will be performed.

    For NIFTI data, despiking is performed with AFNI’s 3dDespike. For CIFTI data, the data will be converted to NIFTI format, 3dDespike will be run, and then the despiked data will be converted back to CIFTI format.

  • dcan_qc (bool) – This flag determines if DCAN-related QC steps will be taken. Enabling this flag will trigger the following steps:

    1. Brainsprite figures will be generated.

    2. The executive summary will be generated.

    3. DCAN QC files will be generated.

  • run_data (dict)

  • t1w_available

  • t2w_available

  • n_runs – Number of runs being postprocessed by XCP-D. This is just used for the boilerplate, as this workflow only posprocesses one run.

  • min_coverage (float) – Coverage threshold to apply to parcels in each atlas. Any parcels with lower coverage than the threshold will be replaced with NaNs. Must be a value between zero and one. Default is 0.5.

  • omp_nthreads (int) – Maximum number of threads an individual process may use.

  • layout (bids.layout.BIDSLayout) – BIDSLayout indexing the ingested (e.g., fMRIPrep-format) derivatives.

  • name (str, optional) – Name of the workflow. This is used for working directories and workflow graphs. Default is “nifti_postprocess_wf”.

Inputs:
  • bold_file – BOLD series NIfTI file

  • boldref (str) – Path to the BOLD reference file associated with the target BOLD run. This comes from the preprocessing derivatives. Loaded in this workflow.

  • bold_mask – bold_mask from fmriprep Loaded in this workflow.

  • custom_confounds_file (str or None) – Path to custom nuisance regressors.

  • template_to_anat_xfm (str) – Path to the MNI-to-T1w transform file. May be “identity”, for testing purposes. Fed from the subject workflow.

  • t1w – Preprocessed T1w image, warped to standard space. Fed from the subject workflow.

  • t2w – Preprocessed T2w image, warped to standard space. Fed from the subject workflow.

  • anat_dseg

  • anat_brainmask – T1w brain mask, used for transforms in the QC report workflow. Fed from the subject workflow.

  • fmriprep_confounds_file (str) – Confounds TSV file from preprocessing derivatives.

  • fmriprep_confounds_json

  • anat_to_native_xfm (str) – Path to the T1w-to-native BOLD space transform file. May be “identity”, for testing purposes.

  • dummy_scans (int or “auto”) – Number of volumes to remove from the beginning of each run. If set to ‘auto’, xcp_d will extract non-steady-state volume indices from the preprocessing derivatives’ confounds file.

Outputs:
  • name_source (str) – Path to the file that will be used as the source_file for derivatives. This is generally the preprocessed BOLD file. This file does not need to exist (e.g., in the case of a concatenated version of the filename).

  • preprocessed_bold (str) – The preprocessed BOLD file, after dummy scan removal.

  • filtered_motion (str) – Framewise displacement timeseries, potentially after bandstop or low-pass filtering. This is a TSV file with one column: ‘framewise_displacement’.

  • temporal_mask (str) – Temporal mask; all values above fd_thresh set to 1. This is a TSV file with one column: ‘framewise_displacement’.

  • fmriprep_confounds_file (str) – Confounds TSV file from preprocessing derivatives. After dummy scan removal.

  • uncensored_denoised_bold (str) – Path to the uncensored, denoised BOLD file. This file is the result of denoising the full (uncensored) preprocessed BOLD data using betas estimated using the censored BOLD data and nuisance regressors.

    This output should not be used for analysis. It is primarily used for DCAN QC plots.

  • interpolated_filtered_bold (str) – Path to the censored, denoised, interpolated, and filtered BOLD file. This file is the result of denoising the censored preprocessed BOLD data, followed by cubic spline interpolation and band-pass filtering.

    This output should not be used for analysis. It is primarily for DCAN QC plots.

  • smoothed_denoised_bold (str) – Path to the censored, denoised, interpolated, filtered, re-censored, and smoothed BOLD file. This file is the result of denoising the censored preprocessed BOLD data, followed by cubic spline interpolation, band-pass filtering, re-censoring, and spatial smoothing.

  • boldref (str) – Path to the BOLD reference file associated with the target BOLD run. This comes from the preprocessing derivatives.

  • bold_mask

  • anat_to_native_xfm (str) – Path to the T1w-to-native BOLD space transform file. May be “identity”, for testing purposes.

  • atlas_names (list of str) – A list of atlases used for parcellating the BOLD data. The list of atlas names is generated by xcp_d.utils.atlas.get_atlas_names(). The atlases include: “Schaefer117”, “Schaefer217”, “Schaefer317”, “Schaefer417”, “Schaefer517”, “Schaefer617”, “Schaefer717”, “Schaefer817”, “Schaefer917”, “Schaefer1017”, “Glasser”, “Gordon”, and “subcortical” (Tian).

  • timeseries (list of str) – List of paths to atlas-specific time series TSV files. These time series are produced from the censored_denoised_bold outputs.

  • timeseries_ciftis (list of str) – List of paths to atlas-specific time series CIFTI (ptseries) files. These time series are produced from the censored_denoised_bold outputs. This will not be defined.

References