Summary of what happened:
I’m running QSIPrep on a single subject/session. The workflow reaches the b0 template mask step and calls mri_synthstrip
on the averaged b0 image, but SynthStrip errors with ValueError: attempt to get argmax of an empty sequence
.
Command used (and if a helper script was used, a link to the helper script or the command generated):
docker run -it --rm \
-v "/mnt/v/qsi_pipeline/bids:/data:ro" \
-v "/mnt/v/qsi_pipeline/qsiprep_out:/out" \
-v "$HOME/qsiprep_work:/work" \
-v "/mnt/c/Users/MY_USER/Desktop/license.txt:/license.txt:ro" \
-e FS_LICENSE=/license.txt \
-e MKL_NUM_THREADS=1 \
-e OPENBLAS_NUM_THREADS=1 \
-e OMP_NUM_THREADS=1 \
--user 0:0 \
pennlinc/qsiprep:unstable \
/data /out participant \
--participant-label 01 \
--anat-modality T1w \
--subject-anatomical-reference sessionwise \
--nprocs 15 \
--omp-nthreads 2 \
--output-resolution 2.0 \
--fs-license-file /license.txt \
--hmc-model 3dSHORE \
--unringing-method rpg \
-w /work \
--separate-all-dwis
Version:
QSIPrep: pennlinc/qsiprep:unstable
FreeSurfer: 8.0.0
Environment (Docker, Singularity / Apptainer, custom installation):
Docker (running through WSL2)
Data formatted according to a validatable standard? Please provide the output of the validator:
1: [WARN] The recommended file /README is missing. See Section 03 (Modality agnostic files) of the BIDS specification. (code: 101 - README_FILE_MISSING)
Please visit https://neurostars.org/search?q=README_FILE_MISSING for existing conversations about this issue.
2: [WARN] The Authors field of dataset_description.json should contain an array of fields - with one author per field. This was triggered because there are no authors, which will make DOI registration from dataset metadata impossible. (code: 113 - NO_AUTHORS)
Please visit https://neurostars.org/search?q=NO_AUTHORS for existing conversations about this issue.
Summary: Available Tasks: Available Modalities:
7 Files, 16MB MRI
1 - Subject
1 - Session
Relevant log outputs (up to 20 lines):
Cmdline:
mri_synthstrip -i /work/qsiprep_1_0_wf/sub_01_ses_01_wf/dwi_preproc_ses_01_wf/qsiprep_hmcsdc_wf/dwi_hmc_wf/b0_template_mask/synthstrip_wf/pad_before_synthstrip_wf/resample_skulled_to_reference/average_trans_trans.nii -o average_trans_trans_brain.nii.gz -m average_trans_trans_mask.nii.gz
Stdout:
Configuring model on the CPU
Running SynthStrip model version 1
Input image read from: /work/qsiprep_1_0_wf/sub_01_ses_01_wf/dwi_preproc_ses_01_wf/qsiprep_hmcsdc_wf/dwi_hmc_wf/b0_template_mask/synthstrip_wf/pad_before_synthstrip_wf/resample_skulled_to_reference/average_trans_trans.nii
Stderr:
RuntimeWarning: invalid value encountered in divide
Traceback (most recent call last):
File "/opt/freesurfer/bin/mri_synthstrip", line 232, in <module>
mask = (components == (np.argmax(bincount) + 1))
File "<__array_function__ internals>", line 180, in argmax
File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/numpy/core/fromnumeric.py", line 1216, in argmax
return _wrapfunc(a, 'argmax', axis=axis, out=out, **kwds)
File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/numpy/core/fromnumeric.py", line 57, in _wrapfunc
return bound(*args, **kwds)
ValueError: attempt to get argmax of an empty sequence
Traceback:
Traceback (most recent call last):
File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 401, in run
runtime = self._run_interface(runtime)
File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/qsiprep/interfaces/freesurfer.py", line 192, in _run_interface
raise Exception('mri_synthstrip failed!')
Exception: mri_synthstrip failed!
Screenshots / relevant information:
My b0 values are:
0 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
I had previously gotten an error with merge-dwis
, which is why I switched to the unstable
tag of QSIPrep. I can reply with the log for this error if it’s helpful.