Issue with acquisition entity detection in XCP-D

Summary of what happened:

Hello

I am running XCP-D on fMRIPrep outputs. Each of my sessions contains two preprocessed BOLD runs, with or without acq-dc. Unfortunately, XCP-D selects the same confound files for both runs, apparently because it cannot read the acquisition entity, resulting in identical confounds for the two different scans. Is there any way to control this?

I was thinking about filtering by acquisition, but the documentation does not seem to cover such filtering:

“bold” determines which preprocessed BOLD files will be chosen. You can set a number of entities here, including “session”, “task”, “space”, “resolution”, and “density”. We recommend NOT setting the datatype, suffix, or file extension in the filter file.`

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

apptainer run --cleanenv \
    -B "$fmriprep_dir:/fmriprep" \
    -B "$out_dir:/out" \
    -B "$work_dir:/work" \
    -B "/path/to/templateflow:/templateflow" \
    -B "/path/to/licenses/freesurfer:/freesurfer_license" \
    $xcp_sif \
    /fmriprep /out participant \
    --mode none \
    --participant_label $sid \
    --session-id $session \
    --input-type fmriprep \
    --file-format nifti \
    --despike y \
    -p 36P \
    --smoothing 0 \
    --combine-runs n \
    --motion-filter-type none \
    -f 0 \
    --output-type censored \
    --lower-bpf 0.01 \
    --upper-bpf 0.08 \
    --datasets schaefer_supplemented="${atlas_dir}" \
    --atlases Schaefer200TianS2Cereb Schaefer400TianS2Cereb \
    --min-coverage 0.4 \
    --linc-qc y \
    --abcc-qc n \
    -w /work \
    --stop-on-first-crash \
    --warp-surfaces-native2std n \
    --fs-license-file /freesurfer_license/license.txt \
    -vvv

Version:

v0.11.1

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

Singularity

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

Data formatted according to BIDS standard

Relevant log outputs (up to 20 lines):

251005-08:31:31,32 nipype.utils IMPORTANT:
	 Collected run data for sub-B25730522_ses-004_task-rest_acq-dc_space-MNI152NLin2009cAsym_res-2_desc-preproc_bold.nii.gz:
boldmask: /fmriprep/sub-B25730522/ses-004/func/sub-B25730522_ses-004_task-rest_acq-dc_space-MNI152NLin2009cAsym_res-2_desc-brain_mask.nii.gz
boldref: /fmriprep/sub-B25730522/ses-004/func/sub-B25730522_ses-004_task-rest_acq-dc_space-MNI152NLin2009cAsym_res-2_boldref.nii.gz
motion_file: /fmriprep/sub-B25730522/ses-004/func/sub-B25730522_ses-004_task-rest_acq-dc_desc-confounds_timeseries.tsv
motion_json: /fmriprep/sub-B25730522/ses-004/func/sub-B25730522_ses-004_task-rest_acq-dc_desc-confounds_timeseries.json

Not required: schaefer_supplemented
Not required: xcpdatlases
251005-08:31:31,592 nipype.utils IMPORTANT:
	 Collected run data for sub-B25730522_ses-004_task-rest_space-MNI152NLin2009cAsym_res-2_desc-preproc_bold.nii.gz:
boldmask: /fmriprep/sub-B25730522/ses-004/func/sub-B25730522_ses-004_task-rest_acq-dc_space-MNI152NLin2009cAsym_res-2_desc-brain_mask.nii.gz
boldref: /fmriprep/sub-B25730522/ses-004/func/sub-B25730522_ses-004_task-rest_acq-dc_space-MNI152NLin2009cAsym_res-2_boldref.nii.gz
motion_file: /fmriprep/sub-B25730522/ses-004/func/sub-B25730522_ses-004_task-rest_acq-dc_desc-confounds_timeseries.tsv
motion_json: /fmriprep/sub-B25730522/ses-004/func/sub-B25730522_ses-004_task-rest_acq-dc_desc-confounds_timeseries.json

Screenshots / relevant information:


Hi @lelew,

In the future please use the Software Support post category and template which prompts you for important information that helps us help you. You can see I edited your post to add it for you this time and you can edit your post to add in the missing information.

You can still add an acquisition filter to a bids-filter-file.

Sounds like a bug. @tsalo is out of town this week but we will be sure to look at this later. It would help if you can provide a tree output of the fmriprep outputs for this subject.

Best,
Steven

Thank you @Steven, I’ve edited my post now!

Okay, great! If there is no acquisition entity, should I enter null to filter those out?

Sure, here it is:

.
├── anat
│   ├── sub-B25730522_ses-004_desc-brain_mask.json
│   ├── sub-B25730522_ses-004_desc-brain_mask.nii.gz
│   ├── sub-B25730522_ses-004_desc-preproc_T1w.json
│   ├── sub-B25730522_ses-004_desc-preproc_T1w.nii.gz
│   ├── sub-B25730522_ses-004_desc-preproc_T2w.json
│   ├── sub-B25730522_ses-004_desc-preproc_T2w.nii.gz
│   ├── sub-B25730522_ses-004_desc-ribbon_mask.json
│   ├── sub-B25730522_ses-004_desc-ribbon_mask.nii.gz
│   ├── sub-B25730522_ses-004_dseg.nii.gz
│   ├── sub-B25730522_ses-004_from-fsnative_to-T1w_mode-image_xfm.txt
│   ├── sub-B25730522_ses-004_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5
│   ├── sub-B25730522_ses-004_from-T1w_to-fsnative_mode-image_xfm.txt
│   ├── sub-B25730522_ses-004_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5
│   ├── sub-B25730522_ses-004_hemi-L_midthickness.surf.gii
│   ├── sub-B25730522_ses-004_hemi-L_pial.surf.gii
│   ├── sub-B25730522_ses-004_hemi-L_space-fsaverage_desc-reg_sphere.surf.gii
│   ├── sub-B25730522_ses-004_hemi-L_space-fsLR_desc-msmsulc_sphere.surf.gii
│   ├── sub-B25730522_ses-004_hemi-L_space-fsLR_desc-reg_sphere.surf.gii
│   ├── sub-B25730522_ses-004_hemi-L_sphere.surf.gii
│   ├── sub-B25730522_ses-004_hemi-L_sulc.shape.gii
│   ├── sub-B25730522_ses-004_hemi-L_thickness.shape.gii
│   ├── sub-B25730522_ses-004_hemi-L_white.surf.gii
│   ├── sub-B25730522_ses-004_hemi-R_midthickness.surf.gii
│   ├── sub-B25730522_ses-004_hemi-R_pial.surf.gii
│   ├── sub-B25730522_ses-004_hemi-R_space-fsaverage_desc-reg_sphere.surf.gii
│   ├── sub-B25730522_ses-004_hemi-R_space-fsLR_desc-msmsulc_sphere.surf.gii
│   ├── sub-B25730522_ses-004_hemi-R_space-fsLR_desc-reg_sphere.surf.gii
│   ├── sub-B25730522_ses-004_hemi-R_sphere.surf.gii
│   ├── sub-B25730522_ses-004_hemi-R_sulc.shape.gii
│   ├── sub-B25730522_ses-004_hemi-R_thickness.shape.gii
│   ├── sub-B25730522_ses-004_hemi-R_white.surf.gii
│   ├── sub-B25730522_ses-004_label-CSF_probseg.nii.gz
│   ├── sub-B25730522_ses-004_label-GM_probseg.nii.gz
│   ├── sub-B25730522_ses-004_label-WM_probseg.nii.gz
│   ├── sub-B25730522_ses-004_space-MNI152NLin2009cAsym_res-2_desc-brain_mask.nii.gz
│   ├── sub-B25730522_ses-004_space-MNI152NLin2009cAsym_res-2_desc-preproc_T1w.nii.gz
│   ├── sub-B25730522_ses-004_space-MNI152NLin2009cAsym_res-2_dseg.nii.gz
│   ├── sub-B25730522_ses-004_space-MNI152NLin2009cAsym_res-2_label-CSF_probseg.nii.gz
│   ├── sub-B25730522_ses-004_space-MNI152NLin2009cAsym_res-2_label-GM_mask_0-3.nii.gz
│   ├── sub-B25730522_ses-004_space-MNI152NLin2009cAsym_res-2_label-GM_probseg.nii.gz
│   └── sub-B25730522_ses-004_space-MNI152NLin2009cAsym_res-2_label-WM_probseg.nii.gz
└── func
    ├── sub-B25730522_ses-004_task-rest_acq-dc_desc-brain_mask.json
    ├── sub-B25730522_ses-004_task-rest_acq-dc_desc-brain_mask.nii.gz
    ├── sub-B25730522_ses-004_task-rest_acq-dc_desc-confounds_timeseries.json
    ├── sub-B25730522_ses-004_task-rest_acq-dc_desc-confounds_timeseries.tsv
    ├── sub-B25730522_ses-004_task-rest_acq-dc_desc-coreg_boldref.json
    ├── sub-B25730522_ses-004_task-rest_acq-dc_desc-coreg_boldref.nii.gz
    ├── sub-B25730522_ses-004_task-rest_acq-dc_desc-hmc_boldref.json
    ├── sub-B25730522_ses-004_task-rest_acq-dc_desc-hmc_boldref.nii.gz
    ├── sub-B25730522_ses-004_task-rest_acq-dc_desc-preproc_bold.json
    ├── sub-B25730522_ses-004_task-rest_acq-dc_desc-preproc_bold.nii.gz
    ├── sub-B25730522_ses-004_task-rest_acq-dc_from-boldref_to-T1w_mode-image_desc-coreg_xfm.json
    ├── sub-B25730522_ses-004_task-rest_acq-dc_from-boldref_to-T1w_mode-image_desc-coreg_xfm.txt
    ├── sub-B25730522_ses-004_task-rest_acq-dc_from-orig_to-boldref_mode-image_desc-hmc_xfm.json
    ├── sub-B25730522_ses-004_task-rest_acq-dc_from-orig_to-boldref_mode-image_desc-hmc_xfm.txt
    ├── sub-B25730522_ses-004_task-rest_acq-dc_space-MNI152NLin2009cAsym_res-2_boldref.nii.gz
    ├── sub-B25730522_ses-004_task-rest_acq-dc_space-MNI152NLin2009cAsym_res-2_desc-brain_mask.nii.gz
    ├── sub-B25730522_ses-004_task-rest_acq-dc_space-MNI152NLin2009cAsym_res-2_desc-preproc_bold.nii.gz
    ├── sub-B25730522_ses-004_task-rest_acq-dc_space-T1w_boldref.json
    ├── sub-B25730522_ses-004_task-rest_acq-dc_space-T1w_boldref.nii.gz
    ├── sub-B25730522_ses-004_task-rest_acq-dc_space-T1w_desc-brain_mask.json
    ├── sub-B25730522_ses-004_task-rest_acq-dc_space-T1w_desc-brain_mask.nii.gz
    ├── sub-B25730522_ses-004_task-rest_acq-dc_space-T1w_desc-preproc_bold.json
    ├── sub-B25730522_ses-004_task-rest_acq-dc_space-T1w_desc-preproc_bold.nii.gz
    ├── sub-B25730522_ses-004_task-rest_desc-brain_mask.json
    ├── sub-B25730522_ses-004_task-rest_desc-brain_mask.nii.gz
    ├── sub-B25730522_ses-004_task-rest_desc-confounds_timeseries.json
    ├── sub-B25730522_ses-004_task-rest_desc-confounds_timeseries.tsv
    ├── sub-B25730522_ses-004_task-rest_desc-coreg_boldref.json
    ├── sub-B25730522_ses-004_task-rest_desc-coreg_boldref.nii.gz
    ├── sub-B25730522_ses-004_task-rest_desc-hmc_boldref.json
    ├── sub-B25730522_ses-004_task-rest_desc-hmc_boldref.nii.gz
    ├── sub-B25730522_ses-004_task-rest_desc-preproc_bold.json
    ├── sub-B25730522_ses-004_task-rest_desc-preproc_bold.nii.gz
    ├── sub-B25730522_ses-004_task-rest_from-boldref_to-T1w_mode-image_desc-coreg_xfm.json
    ├── sub-B25730522_ses-004_task-rest_from-boldref_to-T1w_mode-image_desc-coreg_xfm.txt
    ├── sub-B25730522_ses-004_task-rest_from-orig_to-boldref_mode-image_desc-hmc_xfm.json
    ├── sub-B25730522_ses-004_task-rest_from-orig_to-boldref_mode-image_desc-hmc_xfm.txt
    ├── sub-B25730522_ses-004_task-rest_space-MNI152NLin2009cAsym_res-2_boldref.nii.gz
    ├── sub-B25730522_ses-004_task-rest_space-MNI152NLin2009cAsym_res-2_desc-brain_mask.nii.gz
    ├── sub-B25730522_ses-004_task-rest_space-MNI152NLin2009cAsym_res-2_desc-preproc_bold.nii.gz
    ├── sub-B25730522_ses-004_task-rest_space-T1w_boldref.json
    ├── sub-B25730522_ses-004_task-rest_space-T1w_boldref.nii.gz
    ├── sub-B25730522_ses-004_task-rest_space-T1w_desc-brain_mask.json
    ├── sub-B25730522_ses-004_task-rest_space-T1w_desc-brain_mask.nii.gz
    ├── sub-B25730522_ses-004_task-rest_space-T1w_desc-preproc_bold.json
    └── sub-B25730522_ses-004_task-rest_space-T1w_desc-preproc_bold.nii.gz

Yes, that should work, unless the syntax changed recently.