xcp_d.utils.utils.denoise_with_nilearn

xcp_d.utils.utils.denoise_with_nilearn(preprocessed_bold, confounds_file, temporal_mask, low_pass, high_pass, filter_order, TR)[source]

Denoise an array with Nilearn.

This step does the following:

  1. Orthogonalize nuisance regressors w.r.t. any signal regressors.

  2. Censor the data and associated confounds.

  3. Mean-center the censored and uncensored confounds, based on the censored confounds.

  4. Estimate betas using only the censored data.

  5. Apply the betas to denoise the full (uncensored) BOLD data.

  6. Apply the betas to denoise the censored BOLD data.

  7. Interpolate the censored, denoised data.

  8. Bandpass filter the interpolated, denoised data.

Parameters:
  • preprocessed_bold (numpy.ndarray of shape (T, S)) – Preprocessed BOLD data, after dummy volume removal, but without any additional censoring.

  • confounds_file (str) – Path to TSV file containing selected confounds, after dummy volume removal, but without any additional censoring.

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

  • low_pass, high_pass (float or None) – Lowpass and high_pass thresholds, in Hertz.

  • filter_order (int) – Filter order.

  • TR (float) – Repetition time of the BOLD run, in seconds.

Returns:

  • 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. Returned as a numpy.ndarray of shape (T, S)

  • 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. Returned as a numpy.ndarray of shape (T, S) This is the primary output.