Error with fmriprep

Hi,

I am a beginner of fmriprep. I encountered an error when I used it the first time.

It shows:

Traceback (most recent call last):
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/plugins/multiproc.py”, line 344, in _send_procs_to_workers
self.procs[jobid].run(updatehash=updatehash)
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py”, line 516, in run
result = self._run_interface(execute=True)
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py”, line 635, in _run_interface
return self._run_command(execute)
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py”, line 741, in _run_command
result = self._interface.run(cwd=outdir)
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py”, line 419, in run
runtime = self._run_interface(runtime)
File “/usr/local/miniconda/lib/python3.7/site-packages/niworkflows/interfaces/bids.py”, line 588, in _run_interface
nii = nb.load(out_file, mmap=False)
File “/usr/local/miniconda/lib/python3.7/site-packages/nibabel/loadsave.py”, line 50, in load
is_valid, sniff = image_klass.path_maybe_image(filename, sniff)
File “/usr/local/miniconda/lib/python3.7/site-packages/nibabel/filebasedimages.py”, line 509, in path_maybe_image
sniff)
File “/usr/local/miniconda/lib/python3.7/site-packages/nibabel/filebasedimages.py”, line 457, in _sniff_meta_for
binaryblock = fobj.read(sniff_nbytes)
File “/usr/local/miniconda/lib/python3.7/site-packages/nibabel/openers.py”, line 159, in read
return self.fobj.read(*args, **kwargs)
File “indexed_gzip/indexed_gzip.pyx”, line 578, in indexed_gzip.indexed_gzip._IndexedGzipFile.readinto
indexed_gzip.indexed_gzip.ZranError: zran_read returned error (-3)

Thanks for your help in advance!

could you provide the fmriprep command that you used?

I have the same problem.The command I used was:“sudo docker run -ti --rm -v /home//my_dataset:/data:ro -v /home//my_dataset/derivatives:/out -v /home/workdir:/work -v /home/software/freesurfer/license.txt:/opt/freesurfer/license.txt nipreps/fmriprep:20.2.1 /data /out --output-spaces T1w MNI152NLin2009cAsym fsaverage6 --use-aroma participant -w /work --nthreads 16 --skip_bids_validation --fs-license-file /opt/freesurfer/license.txt --fs-subjects-dir /out/fs_rerun_11
"
The error shows:” File “/usr/local/miniconda/lib/python3.7/multiprocessing/process.py”, line 297, in _bootstrap
self.run()
File “/usr/local/miniconda/lib/python3.7/multiprocessing/process.py”, line 99, in run
self._target(*self._args, **self._kwargs)
File “/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/cli/workflow.py”, line 84, in build_workflow
retval[“workflow”] = init_fmriprep_wf()
File “/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/workflows/base.py”, line 64, in init_fmriprep_wf
single_subject_wf = init_single_subject_wf(subject_id)
File “/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/workflows/base.py”, line 292, in init_single_subject_wf
func_preproc_wf = init_func_preproc_wf(bold_file)
File “/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/workflows/bold/base.py”, line 161, in init_func_preproc_wf
bold_tlen, mem_gb = _create_mem_gb(ref_file)
File “/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/workflows/bold/base.py”, line 852, in _create_mem_gb
bold_tlen = nb.load(bold_fname).shape[-1]
File “/usr/local/miniconda/lib/python3.7/site-packages/nibabel/loadsave.py”, line 50, in load
is_valid, sniff = image_klass.path_maybe_image(filename, sniff)
File “/usr/local/miniconda/lib/python3.7/site-packages/nibabel/filebasedimages.py”, line 510, in path_maybe_image
sniff)
File “/usr/local/miniconda/lib/python3.7/site-packages/nibabel/filebasedimages.py”, line 458, in _sniff_meta_for
binaryblock = fobj.read(sniff_nbytes)
File “/usr/local/miniconda/lib/python3.7/site-packages/nibabel/openers.py”, line 157, in read
return self.fobj.read(*args, **kwargs)
File “indexed_gzip/indexed_gzip.pyx”, line 572, in indexed_gzip.indexed_gzip._IndexedGzipFile.readinto
indexed_gzip.indexed_gzip.ZranError: zran_read returned error (-3)"

@iwannabebuer, @reallingzh Have you seen the following two fMRIPrep issues: nipreps/fmriprep#1717 and nipreps/fmriprep#2324?

In the first one, the issue was ultimately that (some of) the files in the BIDS dataset had the .gz extension, but were not gzipped. If you run the validator or run fMRIPrep without --skip_bids_validation, the resulting log may help clear that up.

In the second one, the problem appears to be related to the operating system on which fMRIPrep was run. I’d try to check the first possibility before digging too hard into this one.

@tsalo Thank you for your suggestions! I checked the datas and find out that some datas were damaged.Now the command can run without errors.

1 Like