Fmriprep 3dvolreg error in bold_t1_trans_wf.bold_reference_wf.gen_avg

I’m encountering the following error message that causing terrible co-registration to my data:

Inputs:

    in_file:
    mc_method: AFNI
    nonnegative: True
    t_mask:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.8/site-packages/nipype/pipeline/plugins/legacymultiproc.py", line 67, in run_node
    result["result"] = node.run(updatehash=updatehash)
  File "/opt/conda/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py", line 516, in run
    result = self._run_interface(execute=True)
  File "/opt/conda/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py", line 635, in _run_interface
    return self._run_command(execute)
  File "/opt/conda/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py", line 741, in _run_command
    result = self._interface.run(cwd=outdir)
  File "/opt/conda/lib/python3.8/site-packages/nipype/interfaces/base/core.py", line 428, in run
    runtime = self._run_interface(runtime)
  File "/opt/conda/lib/python3.8/site-packages/niworkflows/interfaces/images.py", line 322, in _run_interface
    res = Volreg(
  File "/opt/conda/lib/python3.8/site-packages/nipype/interfaces/base/core.py", line 428, in run
    runtime = self._run_interface(runtime)
  File "/opt/conda/lib/python3.8/site-packages/nipype/interfaces/afni/base.py", line 124, in _run_interface
    return super(AFNICommandBase, self)._run_interface(
  File "/opt/conda/lib/python3.8/site-packages/nipype/interfaces/base/core.py", line 822, in _run_interface
    self.raise_exception(runtime)
  File "/opt/conda/lib/python3.8/site-packages/nipype/interfaces/base/core.py", line 749, in raise_exception
    raise RuntimeError(
RuntimeError: Command:
3dvolreg -Fourier -twopass -1Dfile vol0000_xform-00000_clipped_merged_sliced.1D -1Dmatrix_save vol0000_xform-00000_clipped_merged_sliced.aff12.1D -prefix vol0000_xform-00000_clipped_merged_sliced_volreg.nii.gz -zpad 4 -maxdisp1D vol0000_xform-00000_clipped_merged_sliced_md.1D /N/scratch/dlevitas/fmriprep-21.0.2_temp/sub-41/fmriprep_wf/single_subject_41_wf/func_preproc_task_pacpal_run_2_wf/bold_t1_trans_wf/bold_reference_wf/gen_avg/vol0000_xform-00000_clipped_merged_sliced.nii
Standard output:

Standard error:
++ 3dvolreg: AFNI version=AFNI_22.1.02 (Apr  6 2022) [64-bit]
++ Authored by: RW Cox
** AFNI converts NIFTI_datatype=4 (INT16) in file /N/scratch/dlevitas/fmriprep-21.0.2_temp/sub-41/fmriprep_wf/single_subject_41_wf/func_preproc_task_pacpal_run_2_wf/bold_t1_trans_wf/bold_reference_wf/gen_avg/vol0000_xform-00000_clipped_merged_sliced.nii to FLOAT32
     Warnings of this type will be muted for this session.
     Set AFNI_NIFTI_TYPE_WARN to YES to see them all, NO to see none.
++ Coarse del was 10, replaced with 5

Fatal Signal 11 (SIGSEGV) received
       fft_shift2
      apply_zshear
     apply_3shear
    THD_rota_vol
   mri_3dalign_one
  3dvolreg main
 Bottom of Debug Stack
** Command line was:
3dvolreg -Fourier -twopass -1Dfile vol0000_xform-00000_clipped_merged_sliced.1D -1Dmatrix_save vol0000_xform-00000_clipped_merged_sliced.aff12.1D -prefix vol0000_xform-00000_clipped_merged_sliced_volreg.nii.gz -zpad 4 -maxdisp1D vol0000_xform-00000_clipped_merged_sliced_md.1D /N/scratch/dlevitas/fmriprep-21.0.2_temp/sub-41/fmriprep_wf/single_subject_41_wf/func_preproc_task_pacpal_run_2_wf/bold_t1_trans_wf/bold_reference_wf/gen_avg/vol0000_xform-00000_clipped_merged_sliced.nii
** AFNI version = AFNI_22.1.02  Compile date = Apr  6 2022
** [[Precompiled binary linux_openmp_64: Apr  6 2022]]
** Program Death **
** If you report this crash to the AFNI message board,
** please copy the error messages EXACTLY, and give
** the command line you used to run the program, and
** any other information needed to repeat the problem.
** You may later be asked to upload data to help debug.
** Crash log is appended to file /N/u/dlevitas/Carbonate/.afni.crashlog
Return code: 1

I’ve tried re-running fmriprep (version 21.0.2) a few times with new freesurfer and working directories, but the issue persists. I tried looking into the working directory files to see where this first occurs, and it appears to be during the unwarp_wf/resample workflow, where the unwarped volumes are severely cut (and in some cases appear reoriented). This issue only occurs for a single subject in my dataset, but nothing about the BIDS data seems out of the ordinary for this subject. I haven’t found any solutions online and wanted to see if anyone here might know what the issue is? For reference, my fmriprep command was:

            unset PYTHONPATH; singularity run \
		    -B ${bids_root_dir}:${bids_root_dir} \
		    -B /N/dcwan/projects/irf/templateflow:/opt/templateflow
		    -B ${work_dir}:${work_dir} \
		    -B ${output_dir}:${output_dir} \
		    /N/dcwan/projects/irf/containers/fmriprep-${fmriprep_version}.simg 			\
		    $bids_root_dir $output_dir													\
			participant															\
			--participant-label $s 													\
			--skip-bids-validation 													\
			--md-only-boilerplate													\
			--fs-license-file $FREESURFER_HOME/license.txt							\
			--fs-subjects-dir $output_dir/sourcedata/freesurfer/sub-${s} 			\
			--output-spaces MNI152NLin6Asym:res-2									\
			--nthreads $cores														\
			--stop-on-first-crash 													\
			--resource-monitor 														\
			--low-mem 																\
			--mem_mb $reduced_mem 													\
			--use-plugin $bids_root_dir/fmriprep_plugin_${s}.yml 					\
			--use-aroma 															\
			--aroma-melodic-dimensionality 100 										\
			--dummy-scans $dummy_scans 												\
			--verbose 																\
			--bids-filter-file ${bids_root_dir}/code/bids_filter_file.json 			\
			--output-layout bids 													\
			-w $work_dir/sub-${s}

Thanks,

Dan