Summary of what happened:
While running fMRIprep in Singularity, I get an error on a subject related to the init_bold_fit_wf
process. I am using fMRIprep v23.2.1 and Freesurfer v7.3.2.
Command used (and if a helper script was used, a link to the helper script or the command generated):
singularity run \
--cleanenv \
--containall \
-B ${TEMPLATEFLOW_DIR}:/opt/templateflow \
-B ${BIDS_ROOT_DIR}:/bids \
-B ${DERIVATIVES_DIR}:/out \
-B ${WORK_DIR}:/work \
-B ${FS_LICENSE}:/license.txt \
$fmriprep_path \
/bids \
/out \
participant \
--participant-label $subj \
--skip-bids-validation \
--fs-license-file $BIDS_ROOT_DIR/derivatives/freesurfer_license.txt \
--work-dir $WORK_DIR \
--mem_mb 80000 \
--nprocs 16 \
--omp-nthreads 8 \
--longitudinal \
--bids-filter-file $BIDS_ROOT_DIR/code/bids_filter.json \
--output-spaces MNI152NLin2009cAsym:res-2 \
--stop-on-first-crash \
--verbose \
Relevant log outputs (up to 20 lines):
Process Process-2:
Traceback (most recent call last):
File "/opt/conda/envs/fmriprep/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/opt/conda/envs/fmriprep/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/fmriprep/cli/workflow.py", line 115, in build_workflow
retval["workflow"] = init_fmriprep_wf()
File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/fmriprep/workflows/base.py", line 94, in init_fmriprep_wf
single_subject_wf = init_single_subject_wf(subject_id)
File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/fmriprep/workflows/base.py", line 645, in init_single_subject_wf
bold_wf = init_bold_wf(
File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/fmriprep/workflows/bold/base.py", line 251, in init_bold_wf
bold_fit_wf = init_bold_fit_wf(
File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/fmriprep/workflows/bold/fit.py", line 233, in init_bold_fit_wf
orientation = "".join(nb.aff2axcodes(nb.load(bold_file).affine))
TypeError: sequence item 2: expected str instance, NoneType found
rm: cannot remove ‘/scratch/groups/redacted/data/work/fmriprep_23_2_wf/sub_176347_wf’: No such file or directory
More information:
I have verified that this subjects’s folder has 4 3D T1w images under anat/
and 2 runs of BOLD images under func/
. I have also tried deleting any derivatives and temporary work files created but to no avail.
What do you see if you run fslhd
on the BOLD files?
For run-01_bold
, I get:
filename ../sub-redacted/func/sub-redacted_task-rest_run-01_bold.nii.gz
size of header 348
data_type INT16
dim0 3
dim1 64
dim2 64
dim3 2237
dim4 1
dim5 1
dim6 1
dim7 1
vox_units mm
time_units s
datatype 4
nbyper 2
bitpix 16
pixdim0 -1.000000
pixdim1 3.500000
pixdim2 3.500000
pixdim3 3.500000
pixdim4 8.617792
pixdim5 0.000000
pixdim6 0.000000
pixdim7 0.000000
vox_offset 352
cal_max 0.000000
cal_min 0.000000
scl_slope 1.000000
scl_inter 0.000000
phase_dim 1
freq_dim 2
slice_dim 3
slice_name Unknown
slice_code 0
slice_start 0
slice_end 0
slice_duration 0.000000
toffset 0.000000
intent Unknown
intent_code 0
intent_name
intent_p1 0.000000
intent_p2 0.000000
intent_p3 0.000000
qform_name Scanner Anat
qform_code 1
qto_xyz:1 -3.499980 -0.002573 0.011582 117.788200
qto_xyz:2 -0.004247 3.462023 -0.514180 -93.582573
qto_xyz:3 0.011079 0.514191 3.462006 -92.602386
qto_xyz:4 0.000000 0.000000 0.000000 1.000000
qform_xorient Right-to-Left
qform_yorient Posterior-to-Anterior
qform_zorient Inferior-to-Superior
sform_name Scanner Anat
sform_code 1
sto_xyz:1 -3.499924 0.000000 -0.000000 117.788200
sto_xyz:2 -0.006709 3.348920 -0.000000 -93.582573
sto_xyz:3 0.022087 1.017218 0.000000 -92.602386
sto_xyz:4 0.000000 0.000000 0.000000 1.000000
sform_xorient Right-to-Left
sform_yorient Posterior-to-Anterior
sform_zorient Superior-to-Inferior
file_type NIFTI-1+
file_code 1
descrip TE=30;Time=134204.723;phase=1
aux_file
For run-02_bold
, I get:
filename ../sub-redacted/func/sub-redacted_task-rest_run-02_bold.nii.gz
size of header 348
data_type INT16
dim0 3
dim1 64
dim2 64
dim3 7363
dim4 1
dim5 1
dim6 1
dim7 1
vox_units mm
time_units s
datatype 4
nbyper 2
bitpix 16
pixdim0 -1.000000
pixdim1 3.500000
pixdim2 3.500000
pixdim3 3.500000
pixdim4 3.225269
pixdim5 0.000000
pixdim6 0.000000
pixdim7 0.000000
vox_offset 352
cal_max 0.000000
cal_min 0.000000
scl_slope 1.000000
scl_inter 0.000000
phase_dim 1
freq_dim 2
slice_dim 3
slice_name Unknown
slice_code 0
slice_start 0
slice_end 0
slice_duration 0.000000
toffset 0.000000
intent Unknown
intent_code 0
intent_name
intent_p1 0.000000
intent_p2 0.000000
intent_p3 0.000000
qform_name Scanner Anat
qform_code 1
qto_xyz:1 -3.499980 -0.002573 0.011582 117.788200
qto_xyz:2 -0.004247 3.462023 -0.514180 -93.582573
qto_xyz:3 0.011079 0.514191 3.462006 -92.602386
qto_xyz:4 0.000000 0.000000 0.000000 1.000000
qform_xorient Right-to-Left
qform_yorient Posterior-to-Anterior
qform_zorient Inferior-to-Superior
sform_name Scanner Anat
sform_code 1
sto_xyz:1 -3.499924 0.000000 -0.000000 117.788200
sto_xyz:2 -0.006709 3.348920 -0.000000 -93.582573
sto_xyz:3 0.022087 1.017218 0.000000 -92.602386
sto_xyz:4 0.000000 0.000000 0.000000 1.000000
sform_xorient Right-to-Left
sform_yorient Posterior-to-Anterior
sform_zorient Superior-to-Inferior
file_type NIFTI-1+
file_code 1
descrip TE=30;Time=134207.233;phase=1
aux_file
This sform is invalid. Do you have access to the original DICOM data? Once you have corrupted headers, it’s best to start over from scratch, if you can.
Otherwise, you could set the sform_code
to 0, so at least nobody will attempt to use this affine. The qform affine will get copied over.