Dvars error during preprocessing on hpc

Hi! I’m getting an error during preprocessing that I’m unable to resolve/understand by looking at previous questions here. Any insight would be really appreciated. Specifically, I ran the following commands on slurm to preprocess a single subject:

singularity run --cleanenv /home/mc2835/fmriprep-1.2.6.simg \
           /home/mc2835/scratch60/RVLdata/BIDS 
           /home/mc2835/scratch60/RVLdata/fmriprep_output \
           participant \
           --skip_bids_validation \
           --fs-license-file /home/mc2835/freesurferlicense.txt \
           -w /home/mc2835/scratch60/work \
           --nthreads 8 \
           --participant-label 019 \
           --ignore slicetiming

And I get the following error:

Node Name: fmriprep_wf.single_subject_019_wf.func_preproc_ses_1_task_552_wf.bold_confounds_wf.dvars

File:  `/home/mc2835/scratch60/RVLdata/fmriprep_output/fmriprep/sub-019/log/20190325-093840_13c5f4b7-ead5-4fe8-8472-45959eb5ba4a/crash-20190325-093955-mc2835-dvars-207286d4-4138-4d48-b30b-92b0df71cdc7.txt`
Working Directory:  `/gpfs/ysm/scratch60/mc2835/work/fmriprep_wf/single_subject_019_wf/func_preproc_ses_1_task_552_wf/bold_confounds_wf/dvars`
Inputs: 

* figdpi:  `100`
* figformat:  `png`
* figsize:  `(11.7, 2.3)`
* in_file:  `/gpfs/ysm/scratch60/mc2835/work/fmriprep_wf/single_subject_019_wf/func_preproc_ses_1_task_552_wf/bold_bold_trans_wf/merge/vol0000_xform-00000_merged.nii.gz`
* in_mask:  `/gpfs/ysm/scratch60/mc2835/work/fmriprep_wf/single_subject_019_wf/func_preproc_ses_1_task_552_wf/bold_bold_trans_wf/bold_reference_wf/enhance_and_skullstrip_bold_wf/combine_masks/ref_image_corrected_brain_mask_maths.nii.gz`
* intensity_normalization:  `1000.0`
* remove_zerovariance:  `True`
* save_all:  `False`
* save_nstd:  `True`
* save_plot:  `False`
* save_std:  `True`
* save_vxstd:  `False`
* series_tr: ``

Traceback (most recent call last): File "/usr/local/miniconda/lib/python3.7/site-packages/numpy/lib/shape_base.py", line 354, in apply_along_axis ind0 = next(inds) StopIteration During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 69, in run_node result['result'] = node.run(updatehash=updatehash) File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 473, in run result = self._run_interface(execute=True) File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 557, in _run_interface return self._run_command(execute) File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 637, in _run_command result = self._interface.run(cwd=outdir) File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 369, in run runtime = self._run_interface(runtime) File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/algorithms/confounds.py", line 144, in _run_interface intensity_normalization=self.inputs.intensity_normalization) File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/algorithms/confounds.py", line 905, in compute_dvars np.float32), 1)[:, 0] File "/usr/local/miniconda/lib/python3.7/site-packages/numpy/lib/shape_base.py", line 356, in apply_along_axis raise ValueError('Cannot apply_along_axis when any iteration dimensions are 0') ValueError: Cannot apply_along_axis when any iteration dimensions are 0

Thanks!
Megha

Hi @megha,

Could you run the following command?:

singularity exec --cleanenv /home/mc2835/fmriprep-1.2.6.simg \
   python -c "import nibabel as nb; print(nb.load('/gpfs/ysm/scratch60/mc2835/work/fmriprep_wf/single_subject_019_wf/func_preproc_ses_1_task_552_wf/bold_bold_trans_wf/bold_reference_wf/enhance_and_skullstrip_bold_wf/combine_masks/ref_image_corrected_brain_mask_maths.nii.gz').get_data().sum())"

Hi @oesteban,
Sure! Here’s the output:

[mc2835@c16n06 ~]$ singularity exec --cleanenv /home/mc2835/fmriprep-1.2.6.simg \

python -c “import nibabel as nb; print(nb.load(’/gpfs/ysm/scratch60/mc2835/work/fmriprep_wf/single_subject_019_wf/func_preproc_ses_1_task_552_wf/bold_bold_trans_wf/bold_reference_wf/enhance_and_skullstrip_bold_wf/combine_masks/ref_image_corrected_brain_mask_maths.nii.gz’).get_data().sum())”
55278.0

Okay, the mask does not seem empty.

Could you check on the visual report (/home/mc2835/scratch60/RVLdata/fmriprep_output/fmriprep/sub-019.html) whether mask and BOLD data are aligned?

@oesteban They do look aligned, at least not egregiously different from subjects who completed without errors

Can you share those two files with me?

/gpfs/ysm/scratch60/mc2835/work/fmriprep_wf/single_subject_019_wf/func_preproc_ses_1_task_552_wf/bold_bold_trans_wf/merge/vol0000_xform-00000_merged.nii.gz
/gpfs/ysm/scratch60/mc2835/work/fmriprep_wf/single_subject_019_wf/func_preproc_ses_1_task_552_wf/bold_bold_trans_wf/bold_reference_wf/enhance_and_skullstrip_bold_wf/combine_masks/ref_image_corrected_brain_mask_maths.nii.gz

If not, please let me know whether they are aligned with some viewer, and whether the contents of the BOLD run make sense (it’s not empty, things like that).

@oesteban Ah, it seems to be an error during acquisition - this BOLD run was canceled for some reason after only 2 volumes were acquired. Thank you!!

This is the definition of an edge case. With 3 volumes the interface probably wouldn’t have crashed. Glad you got this figured out.

I’ve opened a new request in Nipype to address this issue: https://github.com/nipy/nipype/issues/2906