XCP_d running error and no ALFF files were generated

Hi all,

I used XCP_d to do the postprocessing of resting-state fMRI with fmriprep as input. The code is as follows:

apptainer exec docker://pennlinc/xcp_d xcp_d $fmriprepPath $xcpdPath participant --participant-label sub-001 --input-type fmriprep --dummy-scans 10 --lower-bpf 0.01 --upper-bpf 0.08 --s moothing 6 -p 27P

I tried to conduct nuisance regression, band-filtering (0.01-0.08 HZ), and smoothing for the further preprocessing, and tried to get ALFF, ReHo and functional connectivity (FC) as output.

It seems that the ReHo nii file and FC matrix file were generated successfully, but no ALFF file was generated.

The error information is “xcp_d failed: 28 raised. Re-raising first.”. I have checked the disk space. There are plenty disk space.

Any suggestions of this error?

Thanks in advance!


Can you share the error log? The error message you provided just says how many errors were raised, not what those errors were.

One of the crash file is:

Node: _parcellate_reho13
Working directory: /common/wanglab/jojo/datasets/testCocaine/scripts/working_dir/xcpd_wf/single_subject_001_wf/nifti_postprocess_1_wf/connectivity_wf/parcellate_reho/mapflow/_parcellate_reho13

Node inputs:

atlas = /common/wanglab/jojo/datasets/testCocaine/derivatives/xcp-d/xcp_d/space-MNI152NLin6Asym_atlas-Tian_dseg.nii.gz
atlas_labels = /common/wanglab/jojo/datasets/testCocaine/derivatives/xcp-d/xcp_d/atlas-Tian_dseg.tsv
filtered_file = /common/wanglab/jojo/datasets/testCocaine/scripts/working_dir/xcpd_wf/single_subject_001_wf/nifti_postprocess_1_wf/reho_wf/reho_3d/reho.nii.gz
mask = /common/wanglab/jojo/datasets/testCocaine/derivatives/fmriprep/sub-001/func/sub-001_task-rest_space-MNI152NLin6Asym_res-2_desc-brain_mask.nii.gz
min_coverage = 0.5

Traceback (most recent call last):
File “/usr/local/miniconda/lib/python3.8/site-packages/nipype/pipeline/plugins/multiproc.py”, line 67, in run_node
result[“result”] = node.run(updatehash=updatehash)
File “/usr/local/miniconda/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py”, line 527, in run
result = self._run_interface(execute=True)
File “/usr/local/miniconda/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py”, line 645, in _run_interface
return self._run_command(execute)
File “/usr/local/miniconda/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py”, line 771, in _run_command
raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node _parcellate_reho13.

Traceback (most recent call last):
File “/usr/local/miniconda/lib/python3.8/site-packages/nipype/interfaces/base/core.py”, line 397, in run
runtime = self._run_interface(runtime)
File “/usr/local/miniconda/lib/python3.8/site-packages/xcp_d/interfaces/connectivity.py”, line 105, in _run_interface
n_voxels_in_masked_parcels = sum_masker_masked.fit_transform(atlas_img_bin)
File “/usr/local/miniconda/lib/python3.8/site-packages/sklearn/utils/_set_output.py”, line 157, in wrapped
data_to_wrap = f(self, X, args, kwargs)
File “/usr/local/miniconda/lib/python3.8/site-packages/nilearn/maskers/nifti_labels_masker.py”, line 455, in fit_transform
return self.fit().transform(imgs, confounds=confounds,
File “/usr/local/miniconda/lib/python3.8/site-packages/nilearn/maskers/nifti_labels_masker.py”, line 364, in fit
raise ValueError(
ValueError: Regions and mask do not have the same shape
** labels_img: /common/wanglab/jojo/datasets/testCocaine/derivatives/xcp-d/xcp_d/space-MNI152NLin6Asym_atlas-Tian_dseg.nii.gz

** mask_img: /common/wanglab/jojo/datasets/testCocaine/derivatives/fmriprep/sub-001/func/sub-001_task-rest_space-MNI152NLin6Asym_res-2_desc-brain_mask.nii.gz

This error may be due to the resolution match. I have two kinds of fmriprep output, one is sub-001_task-rest_space-MNI152NLin6Asym_desc-brain_mask.nii.gz, the other is sub-001_task-rest_space-MNI152NLin6Asym_res-2_desc-brain_mask.nii.gz.

I guess xcp-d used the first one to generate ReHo and FC, but when it used the second one, errors happened. xcp-d has 14 atlases, so 14*2 = 28 error files.

That’s definitely an odd error. Can you share the following:

  1. Your fMRIPrep call.
  2. The tree of your fMRIPrep derivatives.
  3. Your XCP-D call.
  4. The full output log. You can attach it as a text file.
  5. The full error log. You can attach it as a text file.

EDIT: You can DM or email me the files if you want.


I’ve run into a similar issue. I ran XCP-D on fMRIPrep output, in which I have 4 functional runs: 3 task and 1 rest. The parcellation was completed for 1 of my task fMRI sessions, but crashed before the rest ran with the same error: “Regions and mask do not have the same shape”.

Did you determine the source of the error?

I ran fMRIPrep (23.2.1) and XCP-D (0.7.1rc5) with no extra arguments.