XCP-D misaligned in summary report

Summary of what happened:

Hi everyone,

I’m using xcp_d for post-process the output from fmriprep. I found misalignment between t1w and atlas almost all the subjects, similar to the case here but with worse result:


And I’m not sure if this is the reason of why there exist some ROIs with N/A timeseries signal in the mean_timeseries.tsv

I checked the report of fmriprep and I think the results of spatial normalization as well as alignment are correct.

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

singularity run --cleanenv \
  -B /work    \
  -B /proj    \
  -B /users   \
  "${SIMG}"   \
  --mode abcd \
  --motion-filter-type lp \
  --band-stop-min 12 \
  --input-type fmriprep \
  --file-format nifti \
  --warp-surfaces-native2std n \
  --nthreads 8 \
  --min-coverage auto \
  --omp-nthreads 2 \
  --mem-mb 32000 \
  --fs-license-file "${FS_LICENSE}" \
  -w "${WORK_DIR}" \
  "${INPUT_BIDS}" "${OUTPUT_DIR}" \
  participant \
  --participant-label "${SUBJECT}" \
  --create-matrices all

Version:

xcp-d 0.11.0
fmriprep 24.1.1

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

Singularity

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

PASTE VALIDATOR OUTPUT HERE

Relevant log outputs (up to 20 lines):

PASTE LOG OUTPUT HERE

Screenshots / relevant information:


Dear @taka2223,
This is the result of a bug that @tsalo fixed recently. Would you mind updating to XCP-D’s latest version?
Best,
Roey

Thank you @roeysc !
I’ll try to update to latest XCP-D. And I solved this problem by rearrange structures of the output (derivatives) from fmriprep and qsiprep. Specifically, the log file tells that

250612-04:06:32,335 nipype.utils WARNING:
Multiple files found for query ‘t1w’:
…/output/qsiprep/sub-xxx/anat/sub-xxx_desc-preproc_T1w.nii.gz
…/output/sub-xxx/anat/sub-xxx_desc-preproc_T1w.nii.gz

And XCP-D choose the first processed t1w, which results in the misalignment. Therefore I move qsiprep output to another folder and it works. I’m not sure if the bug solved in lateset version is corresponding to this one.

The command you shared doesn’t mention a directory called output. Where is it located?

Also, it seems like your data are not organized in a way that BIDS Apps can make sense of. Can you post the tree? At a glance, if you have fMRIPrep derivatives and QSIPrep derivatives, it seems like you have them organized like this:

output/       # fMRIPrep derivatives
    qsiprep/  # QSIPrep derivatives

If so, this isn’t going to work. Given that these are two independent BIDS Apps, they should be organized like this:

fmriprep/
qsiprep/

If one pipeline was applied to outputs from another pipeline, then you could do this:

pipeline1/
    derivatives/
        pipeline2/

But the key there is that the second-order derivatives dataset should be within a “derivatives” folder- not just in the first-order derivatives dataset.

Thanks for your quick reply. Actually it was the case you mentioned. I misplace the derivatives as

output/       # fMRIPrep derivatives
    qsiprep/  # QSIPrep derivatives

And I fix it by rearranging to:

fmriprep/
qsiprep/