I ran XCP-D on fMRIPrep output, in which I have 4 functional runs: 3 task and 1 rest. The parcellation, ALFF generation, and ReHo generation was completed for 1 of my task fMRI sessions, but crashed with the error: Regions and mask do not have the same shape. I imagine this is some sort of resampling issue?
I ran fMRIPrep (23.2.1) and XCP-D (0.7.1rc5) with no extra arguments.
Thanks!
Command used (and if a helper script was used, a link to the helper script or the command generated):
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):
Node: _parcellate_data0
Working directory: /tmp/working_dir/xcp_d_0_7_wf/sub_0000012_wf/nifti_postprocess_1_wf/connectivity_wf/parcellate_data/mapflow/_parcellate_data0
Node inputs:
atlas = /out/atlases/atlas-4S1056Parcels/atlas-4S1056Parcels_space-MNI152NLin2009cAsym_dseg.nii.gz
atlas_labels = /out/atlases/atlas-4S1056Parcels/atlas-4S1056Parcels_dseg.tsv
filtered_file = /tmp/working_dir/xcp_d_0_7_wf/sub_0000012_wf/nifti_postprocess_1_wf/denoise_bold_wf/censor_interpolated_data/filtered_denoised_censored.nii.gz
mask = /fmriprep/sub-0000012/func/sub-0000012_task-rest_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz
min_coverage = 0.5
...
Traceback:
Traceback (most recent call last):
File "/usr/local/miniconda/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 397, in run
runtime = self._run_interface(runtime)
File "/usr/local/miniconda/lib/python3.10/site-packages/xcp_d/interfaces/connectivity.py", line 102, in _run_interface
n_voxels_in_masked_parcels = sum_masker_masked.fit_transform(atlas_img_bin)
File "/usr/local/miniconda/lib/python3.10/site-packages/sklearn/utils/_set_output.py", line 295, in wrapped
data_to_wrap = f(self, X, *args, **kwargs)
File "/usr/local/miniconda/lib/python3.10/site-packages/nilearn/maskers/nifti_labels_masker.py", line 531, in fit_transform
return self.fit(imgs).transform(
File "/usr/local/miniconda/lib/python3.10/site-packages/nilearn/maskers/nifti_labels_masker.py", line 434, in fit
raise ValueError(
ValueError: Regions and mask do not have the same shape
mask_img: /fmriprep/sub-0000012/func/sub-0000012_task-rest_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz
Here is one of the 126 crash files generated. The failing nodes were labeled as data, reho, or alff.
Node: _parcellate_data0
Working directory: /tmp/working_dir/xcp_d_0_7_wf/sub_0000012_wf/nifti_postprocess_1_wf/connectivity_wf/parcellate_data/mapflow/_parcellate_data0
Node inputs:
atlas = /out/atlases/atlas-4S1056Parcels/atlas-4S1056Parcels_space-MNI152NLin2009cAsym_dseg.nii.gz
atlas_labels = /out/atlases/atlas-4S1056Parcels/atlas-4S1056Parcels_dseg.tsv
filtered_file = /tmp/working_dir/xcp_d_0_7_wf/sub_0000012_wf/nifti_postprocess_1_wf/denoise_bold_wf/censor_interpolated_data/filtered_denoised_censored.nii.gz
mask = /fmriprep/sub-0000012/func/sub-0000012_task-rest_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz
min_coverage = 0.5
Traceback (most recent call last):
File "/usr/local/miniconda/lib/python3.10/site-packages/nipype/pipeline/plugins/multiproc.py", line 67, in run_node
result["result"] = node.run(updatehash=updatehash)
File "/usr/local/miniconda/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
result = self._run_interface(execute=True)
File "/usr/local/miniconda/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
return self._run_command(execute)
File "/usr/local/miniconda/lib/python3.10/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_data0.
Traceback:
Traceback (most recent call last):
File "/usr/local/miniconda/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 397, in run
runtime = self._run_interface(runtime)
File "/usr/local/miniconda/lib/python3.10/site-packages/xcp_d/interfaces/connectivity.py", line 102, in _run_interface
n_voxels_in_masked_parcels = sum_masker_masked.fit_transform(atlas_img_bin)
File "/usr/local/miniconda/lib/python3.10/site-packages/sklearn/utils/_set_output.py", line 295, in wrapped
data_to_wrap = f(self, X, *args, **kwargs)
File "/usr/local/miniconda/lib/python3.10/site-packages/nilearn/maskers/nifti_labels_masker.py", line 531, in fit_transform
return self.fit(imgs).transform(
File "/usr/local/miniconda/lib/python3.10/site-packages/nilearn/maskers/nifti_labels_masker.py", line 434, in fit
raise ValueError(
ValueError: Regions and mask do not have the same shape
mask_img: /fmriprep/sub-0000012/func/sub-0000012_task-rest_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz
I see. Yes, this is the case. However, I’m actually only interested in the resting-state data, at least for the moment.
My resting-state data is 3.1 x 3.1 x 3.5mm. If this is the only fMRI run being processed, then this error should not arise, right?
I’m attempting to test this now – I have a separate fMRIPrep run going with the resting-state data only. Would there be a better way to tell XCP-D to run only my resting-state and ignore the other runs?