Qsiprep dwibiascorrect error

Summary of what happened:

Hello,
I am running qsiprep via docker but getting dwibiascorrect error. In my BIDS dataset dwi folder there are dwi.nii.gz, dwi.bval, dwi.bvec. dwi.sjon, sbref.json and sbref.nii.gz.

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

docker run --rm -v /analysis/halilaziz/bids_raw:/data -v /analysis/halilaziz/processout:/output -v /usr/local/local/opt/freesurfer6/license.txt:/usr/local/local/opt/freesurfer6/license.txt pennbbl/qsiprep:latest /data /output participant --participant-label 12121 --nthreads 8 --omp-nthreads 8 --mem-mb 16000 --skip_bids_validation --fs-license-file /usr/local/local/opt/freesurfer6/license.txt --output-resolution 1.2

Version:

I am using qsiprep v0.17.0

Environment (Docker, Singularity, custom installation):

Docker

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

Relevant log outputs (up to 20 lines):

Screenshots / relevant information:

Hi @halil_aziz_velioglu, and welcome to neurostars!

Please provide the log output that describes the error, and whether your data pass BIDS validation.

Best,
Steven

Hello Steven
Thank you your message.
Here is

QSIPrep failed: Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.8/site-packages/nipype/pipeline/plugins/multiproc.py                               ", line 67, in run_node
    result["result"] = node.run(updatehash=updatehash)
  File "/usr/local/miniconda/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py", li                               ne 527, in run
    result = self._run_interface(execute=True)
  File "/usr/local/miniconda/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py", li                               ne 645, in _run_interface
    return self._run_command(execute)
  File "/usr/local/miniconda/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py", li                               ne 771, in _run_command
    raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node biasco                               rr.

Cmdline:
        dwibiascorrect ants -ants.b [150,3] -ants.c [200x200,1e-6] -bias sub-12193_dwi_denois                               ed_bias.nii.gz -fslgrad /data/sub-12193/dwi/sub-12193_dwi.bvec /data/sub-12193/dwi/sub-12193_                               dwi.bval -mask /tmp/work/qsiprep_wf/single_subject_12193_wf/dwi_preproc_wf/pre_hmc_wf/merge_a                               nd_denoise_wf/dwi_denoise_dwi_wf/quick_mask/sub-12193_dwi_denoised_b0_series_mask.nii.gz /tmp                               /work/qsiprep_wf/single_subject_12193_wf/dwi_preproc_wf/pre_hmc_wf/merge_and_denoise_wf/dwi_d                               enoise_dwi_wf/denoiser/sub-12193_dwi_denoised.nii.gz sub-12193_dwi_denoised_N4.nii.gz
Stdout:

Stderr:
        dwibiascorrect:
        dwibiascorrect: Note that this script makes use of commands / algorithms that have re                               levant articles for citation; INCLUDING FROM EXTERNAL SOFTWARE PACKAGES. Please consult the h                               elp page (-help option) for more information.
        dwibiascorrect:
        dwibiascorrect: Generated scratch directory: /tmp/work/qsiprep_wf/single_subject_1219                               3_wf/dwi_preproc_wf/pre_hmc_wf/merge_and_denoise_wf/dwi_denoise_dwi_wf/biascorr/dwibiascorrec                               t-tmp-PAGK26/
        Command:  mrconvert /tmp/work/qsiprep_wf/single_subject_12193_wf/dwi_preproc_wf/pre_h                               mc_wf/merge_and_denoise_wf/dwi_denoise_dwi_wf/denoiser/sub-12193_dwi_denoised.nii.gz /tmp/wor                               k/qsiprep_wf/single_subject_12193_wf/dwi_preproc_wf/pre_hmc_wf/merge_and_denoise_wf/dwi_denoi                               se_dwi_wf/biascorr/dwibiascorrect-tmp-PAGK26/in.mif -fslgrad /data/sub-12193/dwi/sub-12193_dw                               i.bvec /data/sub-12193/dwi/sub-12193_dwi.bval
        Command:  mrconvert /tmp/work/qsiprep_wf/single_subject_12193_wf/dwi_preproc_wf/pre_h                               mc_wf/merge_and_denoise_wf/dwi_denoise_dwi_wf/quick_mask/sub-12193_dwi_denoised_b0_series_mas                               k.nii.gz /tmp/work/qsiprep_wf/single_subject_12193_wf/dwi_preproc_wf/pre_hmc_wf/merge_and_den                               oise_wf/dwi_denoise_dwi_wf/biascorr/dwibiascorrect-tmp-PAGK26/mask.mif -datatype bit
        dwibiascorrect: Changing to scratch directory (/tmp/work/qsiprep_wf/single_subject_12                               193_wf/dwi_preproc_wf/pre_hmc_wf/merge_and_denoise_wf/dwi_denoise_dwi_wf/biascorr/dwibiascorr                               ect-tmp-PAGK26/)
        Command:  dwiextract in.mif - -bzero | mrmath - mean mean_bzero.mif -axis 3

        dwibiascorrect: [ERROR] dwiextract in.mif - -bzero | mrmath - mean mean_bzero.mif -ax                               is 3 (ants.py:64)
        dwibiascorrect: [ERROR] Information from failed command:
        dwibiascorrect:
                        dwiextract: [ERROR] No b=0 volumes present
                        mrmath: [ERROR] no filename supplied to standard input (broken pipe?)
                        mrmath: [ERROR] error opening image "-"
        dwibiascorrect:
        dwibiascorrect: [ERROR] For debugging, inspect contents of scratch directory: /tmp/wo                               rk/qsiprep_wf/single_subject_12193_wf/dwi_preproc_wf/pre_hmc_wf/merge_and_denoise_wf/dwi_deno                               ise_dwi_wf/biascorr/dwibiascorrect-tmp-PAGK26/
        dwibiascorrect: Scratch directory retained; location: /tmp/work/qsiprep_wf/single_sub                               ject_12193_wf/dwi_preproc_wf/pre_hmc_wf/merge_and_denoise_wf/dwi_denoise_dwi_wf/biascorr/dwib                               iascorrect-tmp-PAGK26/

Seems like your DWI image has no b0 images. Is this true, looking at your bval file? Also, what about BIDS validaition?

Actually I looked at the bval file there is no b0. However, I think qsiprep should have used sbref.nii.gz image as b0 right?
I think I need to install npm install -g npm@9.6.4 for the BIDS validation

No, QSIPrep does not substitute the sbref for b0. The b0 is expected to be part of your DWI image. QSIPrep ignores DWI sbrefs entirely. I do not know a priori if your sbref would function well as a b0.

You can remove --skip-bids-validation in your QSIPrep command, or try one of the methods below:


Best,
Steven

Ok Thank you for your help
I will try it