Custom confounds in xcpd

Summary of what happened:

I used fmriprep to preprocess a fMRI dataset using the following code. I found the method generated by fMRIprep did not show slice-timing procedure ’ For each of the 1 BOLD runs found per subject (across all tasks and sessions), the following preprocessing was performed. First, a reference volume was generated, using a custom methodology of fMRIPrep , for use in head motion correction. Head-motion parameters with respect to the BOLD reference (transformation matrices, and six corresponding rotation and translation parameters) are estimated before any spatiotemporal filtering using mcflirt (FSL , Jenkinson et al. 2002). The estimated fieldmap was then aligned with rigid-registration to the target EPI (echo-planar imaging) reference run. The field coefficients were mapped on to the reference EPI using the transform. The BOLD reference was then co-registered to the T1w reference using bbregister (FreeSurfer) which implements boundary-based registration (Greve and Fischl 2009). Co-registration was configured with six degrees of freedom. Several confounding time-series were calculated based on the preprocessed BOLD : framewise displacement (FD), DVARS and three region-wise global signals.’ But the functional report show that ‘Slice timing correction: Applied’ Which one is right?

Moreover, I want to postprocess the fMRIprep output with XCP-D according to this procedure: the aCompcor, cosine (highpass filtering), six head-motion, and global signal regressors were regressed out of each subjects MNI-space voxel level images. I previous used the **-p acompcor **. But this code also excludes derivatives of motion and fixed number of aCompcor. How can I just regress out the cosine (highpass filtering), six head-motion, and global signal regressors and aCompcor that 50% of variance is explained? Specificially, the number of aCompcor that 50% of variance is explained for different subjects are different. How could I write the corresponding confound configuration file?

Command used (and if a helper script was used, a link to the helper script or the command generated):

#!/bin/bash

#User inputs:
HOME=/share/home/candy_group
bids_root_dir=/share/home/candy_group/ZJJ/data/SUDMEX_CONN/
#subj=015
nthreads=40
mem=200 #gb
container=singularity #docker or singularity

#Begin:

#Convert virtual memory from gb to mb
mem=`echo "${mem//[!0-9]/}"` #remove gb at end
mem_mb=`echo $(((mem*1000)-5000))` #reduce some memory for buffer space during pre-processing

#export TEMPLATEFLOW_HOME=$HOME/.cache/templateflow
FREESURFER_HOME=$HOME/yzheng/software/FreeSurferLicense
TEMPLATEFLOW_HOME=/share/home/candy_group/yzheng/software/templateflow
#Run fmriprep

singularity run --cleanenv -B $TEMPLATEFLOW_HOME:/templateflow $HOME/yzheng/software/my_images/fmriprep-latest.simg \
  $bids_root_dir $HOME/yzheng/project5/processing_fastsurfer/derivatives \
  participant \
    --participant-label 009 010 011 012 013 014 016 017 018 \
    --skip-bids-validation \
    --fs-license-file $FREESURFER_HOME/license.txt \
    --dummy-scans 5 \
    --fs-no-resume \
    --fs-subjects-dir /share/home/candy_group/yzheng/project5/preprocessing/derivatives1/fastsurfer \
    --output-spaces MNI152NLin6Asym:res-2 \
    --nthreads $nthreads \
    --stop-on-first-crash \
    --mem_mb $mem_mb \
    -w $HOME/yzheng/project5/processing_fastsurfer/work

Version:

24.1.0

Environment (Docker, Singularity / Apptainer, custom installation):

Singularity

Data formatted according to a validatable standard? Please provide the output of the validator:

BIDS format

Relevant log outputs (up to 20 lines):

no

Screenshots / relevant information:


Hi @Yi_Zheng,

The custom confound configuration is explained in the documentation here: Running XCP-D — xcp_d 0.10.0rc3.dev1+g9275de8 documentation

Best,
Steven

Thank you very much for your reply.

When post-processing the fMRIprep output using XCP-D 0.10.0rc1, I met the same problem as Xcp_d: Some connections were not found. Has this issue been resolved?

Hi @Yi_Zheng,

Please try the most recent release candidate (rc3).

Best,
Steven

Thank you for your kind reply. Version rc3 successfully solved this problem.

I try to denoise the dataset with the AROMA strategy. The document shows that fMRIPrep removed AROMA support in 23.1.0. In order to use the aroma or aroma_gsr strategies, please run fMRIPost-AROMA on your fMRIPrep outputs before running XCP-D. You will need to supply the AROMA derivatives dataset to XCP-D via the --datasets parameter (i.e., --datasets aroma=/path/to/fmripost-aroma/dset).

However, this post Does fMRIPost-AROMA replace xcp_d for ICA-aroma denoising? suggests that XCP-D can’t use regressors from fMRIPost-AROMA.

Can XCP-D (version:rc3) and fMRIPost-AROMA (version:main) do this now?

Yes, please refer to the documentation:Processing Pipeline Details — xcp_d 0.10.0rc3.dev2+gf927f34 documentation