Dcm2bids re-order slice out-of-volume error

Hi,
I’m unable to identify what file is making the conversion process from DICOM to Nii to crash, is there a way to print this information so I can address the corrupted DICOM file?.
The outcome error is
INFO | Running: dcm2niix -b y -ba y -z y -f %3s_%f_%p_%t -o /Users/andrea/BIDS_TEST2/tmp_dcm2bids/helper sourcedata/CHRM2016

Error: Re-ordered slice out-of-volume 112
Error: Re-ordered slice out-of-volume 116
Error: Re-ordered slice out-of-volume 120
Error: Re-ordered slice out-of-volume 124
Error: Re-ordered slice out-of-volume 128
Error: Re-ordered slice out-of-volume 132
and goes on…

Error: Converted 12 of 13 files.

File “/opt/anaconda3/envs/neuro/lib/python3.12/subprocess.py”, line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command ‘[‘dcm2niix’, ‘-b’, ‘y’, ‘-ba’, ‘y’, ‘-z’, ‘y’, ‘-f’, ‘%3s_%f_%p_%t’, ‘-o’, PosixPath(’/Users/andrea/BIDS_TEST2/tmp_dcm2bids/helper’), ‘sourcedata/CHRM2016’]’ returned non-zero exit status 8.

Hi @Andrea_18 ,

I will let @neurolabusc, @Chris_Rorden to answer you since it seems to be a dcm2niix issue.
Once fixed, if you have any issue with dcm2bids don’t hesitate.

Best,
Arnaud

1 Like

@Andrea_18 The error you are reporting is coming from a wrapper, not dcm2niix, so I am not sure how much advice I can provide.

To trouble shoot this, you can attempt to use dcm2niix in isolation. I would suggest running dcm2niix directly from the command line, rather than a wrapper.

  1. Make sure you are running the latest version of dcm2niix. So running dcm2niix without any arguments should report v1.0.20240202.
  2. Convert your images with dcm2niix directly from the command line and inspect the errors and warnings it reports. Assuming you have write permission to the folder with your images, this would look like dcm2niix /path/to/DICOMs.
  3. DICOM images tend to have a huge number of files without helpful filenames. To isolate your problem, you may want to rename your DICOMs so that they are organized in separate folders by series. To do this, you can use the r y argument, so dcm2niix -r y /path/to/DICOMs. You can then attempt to convert each of the series separately to get better insight into your problem.
1 Like

Hi @Andrea_18 ,

My fault, our soon new dcm2bids version will highlight potentials errors coming from the dcm2niix conversion. For now, follow @neurolabusc instructions then dcm2bids should run smoothly.

Best,
Arnaud

1 Like

Thank you! I will try those suggestions.