"--cifti-output" flag causes an error on conf_plot

Summary of what happened:

Dear experts,

I’ve recently started to learn fMRIPrep to preprocess our resting-state fMRI data. I tried the pipeline according to the descriptions in Docs, but I noticed that if I added the --cifti-output flag, I get an error about conf_plot. However, the carpetplot appears to be generated successfully. On the other hand, the grayordinate files are not generated in the out/func directory.
I’ve confirmed that the above error does not occur and fMRIPrep finishes successfully if I don’t use the --cifti-output flag.

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

Here is the command I used.

fmriprep-docker $bids_root_dir $bids_root_dir/derivatives \
  participant \
  -w $HOME \
    --skip-bids-validation \
    --participant-label $subj \
    --nthreads $nthreads \
    --mem-mb $mem_mb \
    --low-mem \
    --output-spaces MNI152NLin6Asym:res-2 MNI152NLin2009cAsym:res-native \
    --md-only-boilerplate \
    --output-layout bids \
    --medial-surface-nan \
    --bold2t1w-init register \
    --bold2t1w-dof 6 \
    --force-bbr \
    --random-seed 0 \
    --project-goodvoxels \
    --cifti-output \
    --use-aroma \
    --error-on-aroma-warnings \
    --return-all-components \
    --fd-spike-threshold 0.5 \
    --dvars-spike-threshold 1.5 \
    --skull-strip-template OASIS30ANTs \
    --skull-strip-fixed-seed \
    --skull-strip-t1w force \
    --fs-license-file $FS_LICENSE \
    --write-graph \
    --stop-on-first-crash

Version:

23.0.1

Environment (Docker, Singularity, custom installation):

Docker

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

I confirmed that my data structure is in line with BIDS standards, using the BIDS validator.

Relevant log outputs (up to 20 lines):

The error log is below. Although " Finished “gen_cifti” " is displayed, grayordinates files are not generated in out/func.

230502-00:18:42,631 nipype.workflow INFO:
	 [Node] Executing "gen_cifti" <niworkflows.interfaces.cifti.GenerateCifti>
230502-00:19:06,630 nipype.workflow INFO:
	 [Node] Finished "gen_cifti", elapsed time 23.997285s.
230502-00:19:08,630 nipype.workflow INFO:
	 [Node] Setting-up "fmriprep_23_0_wf.single_subject_N0001_wf.func_preproc_task_rest_wf.carpetplot_wf.conf_plot" in "/scratch/fmriprep_23_0_wf/single_subject_N0001_wf/func_preproc_task_rest_wf/carpetplot_wf/conf_plot".
230502-00:19:08,631 nipype.workflow INFO:
	 [Node] Outdated cache found for "fmriprep_23_0_wf.single_subject_N0001_wf.func_preproc_task_rest_wf.carpetplot_wf.conf_plot".
230502-00:19:08,676 nipype.workflow INFO:
	 [Node] Executing "conf_plot" <fmriprep.interfaces.confounds.FMRISummary>
230502-00:19:11,751 nipype.workflow INFO:
	 [Node] Finished "conf_plot", elapsed time 3.062313s.
230502-00:19:11,751 nipype.workflow WARNING:
	 Storing result file without outputs
230502-00:19:11,756 nipype.workflow WARNING:
	 [Node] Error on "fmriprep_23_0_wf.single_subject_N0001_wf.func_preproc_task_rest_wf.carpetplot_wf.conf_plot" (/scratch/fmriprep_23_0_wf/single_subject_N0001_wf/func_preproc_task_rest_wf/carpetplot_wf/conf_plot)
230502-00:19:12,697 nipype.workflow ERROR:
	 Node conf_plot failed to run on host 3c643796fd03.
230502-00:19:12,704 nipype.workflow ERROR:
	 Saving crash info to /out/sub-N0001/log/20230501-102240_cf4fc7fe-1369-4d9c-a842-9eeb89ecc41e/crash-20230502-001912-root-conf_plot-ad732c91-f9f6-4199-aae7-13a664cc02d7.txt

Screenshots / relevant information:

Another concern is that no “sub-<subject_label>_[specifiers]_space-<space_label>_hemi-[LR]_bold.func.gii” files are generated in my out/func directory. What does this have to do with the above error?
I would be grateful for the knowledge of possible causes and solutions. Please point out any missing information.

Sincerely yours,

Hi @Printemps and welcome to Neurostars!

What are the contents of /out/sub-N0001/log/20230501-102240_cf4fc7fe-1369-4d9c-a842-9eeb89ecc41e/crash-20230502-001912-root-conf_plot-ad732c91-f9f6-4199-aae7-13a664cc02d7.txt ?

Best,
Steven

Hi @Steven , thank you for your kind reply.

The contents of that file are below;

Node: fmriprep_23_0_wf.single_subject_N0001_wf.func_preproc_task_rest_wf.carpetplot_wf.conf_plot
Working directory: /scratch/fmriprep_23_0_wf/single_subject_N0001_wf/func_preproc_task_rest_wf/carpetplot_wf/conf_plot

Node inputs:

confounds_file = /scratch/fmriprep_23_0_wf/single_subject_N0001_wf/func_preproc_task_rest_wf/bold_confounds_wf/spike_regressors/confounds_expansion_desc-motion_outliers.tsv
confounds_list = [('global_signal', None, 'GS'), ('csf', None, 'GSCSF'), ('white_matter', None, 'GSWM'), ('std_dvars', None, 'DVARS'), ('framewise_displacement', 'mm', 'FD')]
drop_trs = 0
in_cifti = /scratch/fmriprep_23_0_wf/single_subject_N0001_wf/func_preproc_task_rest_wf/bold_grayords_wf/gen_cifti/vol0000_xform-00000_clipped_merged.dtseries.nii
in_nifti = /scratch/fmriprep_23_0_wf/single_subject_N0001_wf/func_preproc_task_rest_wf/unwarp_wf/merge/vol0000_unwarped_merged.nii.gz
in_segm = /scratch/fmriprep_23_0_wf/single_subject_N0001_wf/func_preproc_task_rest_wf/carpetplot_wf/parcels/segments.nii.gz
str_or_tuple = <undefined>
tr = 2.5

Traceback (most recent call last):
  File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/plugins/multiproc.py", line 67, in run_node
    result["result"] = node.run(updatehash=updatehash)
  File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
  File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
  File "/opt/conda/lib/python3.9/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 conf_plot.

Traceback:
	Traceback (most recent call last):
	  File "/opt/conda/lib/python3.9/site-packages/nipype/interfaces/base/core.py", line 398, in run
	    runtime = self._run_interface(runtime)
	  File "/opt/conda/lib/python3.9/site-packages/fmriprep/interfaces/confounds.py", line 562, in _run_interface
	    fig = fMRIPlot(
	  File "/opt/conda/lib/python3.9/site-packages/niworkflows/viz/plots.py", line 129, in plot
	    plot_carpet(
	  File "/opt/conda/lib/python3.9/site-packages/niworkflows/viz/plots.py", line 239, in plot_carpet
	    children, _, n_leaves, _, distances = ward_tree(roi_data, return_distance=True)
	  File "/opt/conda/lib/python3.9/site-packages/sklearn/cluster/_agglomerative.py", line 270, in ward_tree
	    out = hierarchy.ward(X)
	  File "/opt/conda/lib/python3.9/site-packages/scipy/cluster/hierarchy.py", line 834, in ward
	    return linkage(y, method='ward', metric='euclidean')
	  File "/opt/conda/lib/python3.9/site-packages/scipy/cluster/hierarchy.py", line 1065, in linkage
	    raise ValueError("The condensed distance matrix must contain only "
	ValueError: The condensed distance matrix must contain only finite values.

Hm, if your data are completely BIDS valid, then I cannot think of what is going wrong here, may be best to post on the Github repo and reference this thread. Sorry I couldn’t be of more help!

Thank you @Steven , I’ll try to post the Github repo soon.
I appreciate your kind advice.