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:
Censor the data and associated confounds.
Mean-center the censored and uncensored confounds, based on the censored confounds.
Estimate betas using only the censored data.
Apply the betas to denoise the full (uncensored) BOLD data.
Apply the betas to denoise the censored BOLD data.
Interpolate the censored, denoised data.
Bandpass filter the interpolated, denoised data.
- Parameters:
preprocessed_bold (
numpy.ndarrayof shape (T, S)) – Preprocessed BOLD data, after dummy volume removal, but without any additional censoring.confounds_file (
stror None) – Path to TSV file containing selected confounds, after dummy volume removal, but without any additional censoring. May be None, if no denoising should be performed.temporal_mask (
str) – Temporal mask; all values abovefd_threshset 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.ndarrayof 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.ndarrayof shape (T, S) This is the primary output.