Error: Too many NIFTI images with the name

Hello all,

After an update of the MRI, we now have DICOM files in the enhanced mode.
When trying to use dcm2bids on this new format, I have the following errors:

Error: Too many NIFTI images with the name */tmp_dcm2bids/sub-x_ses-x/026_x_x_wip_20221209094910_e1
Error: Too many NIFTI images with the name */tmp_dcm2bids/sub-x_ses-x/026_x_x_wip_20221209094910_e1
Error: Too many NIFTI images with the name */tmp_dcm2bids/sub-x_ses-x/026_x_x_wip_20221209094910_e1
Error: Too many NIFTI images with the name */tmp_dcm2bids/sub-x_ses-x/026_x_x_wip_20221209094910_e1
Error: Too many NIFTI images with the name /tmp_dcm2bids/sub-x_ses-x/026_x_x_wip_20221209094910_e1
Error: Too many NIFTI images with the name
/tmp_dcm2bids/sub-x_ses-x/026_x_x_wip_20221209094910_e1
Error: Converted 69038 of 130530 files
Traceback (most recent call last):
File “/home/elena/anaconda3/bin/dcm2bids”, line 114, in
sys.exit(main())
File “/home/elena/anaconda3/bin/dcm2bids”, line 110, in main
return app.run()
File “/home/elena/anaconda3/lib/python3.8/site-packages/dcm2bids/dcm2bids.py”, line 103, in run
dcm2niix.run(self.forceDcm2niix)
File “/home/elena/anaconda3/lib/python3.8/site-packages/dcm2bids/dcm2niix.py”, line 91, in run
self.execute()
File “/home/elena/anaconda3/lib/python3.8/site-packages/dcm2bids/dcm2niix.py”, line 104, in execute
output = run_shell_command(cmd)
File “/home/elena/anaconda3/lib/python3.8/site-packages/dcm2bids/utils.py”, line 109, in run_shell_command
return check_output(shlex.split(commandLine))
File “/home/elena/anaconda3/lib/python3.8/subprocess.py”, line 411, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File “/home/elena/anaconda3/lib/python3.8/subprocess.py”, line 512, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command ‘[‘dcm2niix’, ‘-b’, ‘y’, ‘-ba’, ‘y’, ‘-z’, ‘y’, ‘-f’, ‘%3s_%f_%p_%t’, ‘-o’, ‘tmp_dcm2bids/sub-x_ses-x’, ‘/DICOM/x/x_x/’]’ returned non-zero exit status 8.

I think the issue is that I have images acquired with multiple echo times (32) and there are not enough alphabet letters to assign a new name to the nifti file (for now in my tmp folder I have from a to y, 26 images and 6 from the error that could not be assigned).

I am trying now to run directly the dcm2niix function adding the echo time in the name to see whether this could solve the issue, as follow:

dcm2niix -b y -ba y -z y -f ‘%3s_%f_%p_%t_%e’ -o … …

Still, if this works, I am not sure how I to add the option when running the dcm2bids command.
Do you have any suggestion?

Thank you very much in advance,
Elena

Hi @ebeanato ,

Check this section of the documentation Use advanced commands - Dcm2Bids

Let us know if it helps you fix your issue.
Best,
Arnaud

Thank you, I managed to add the option I wanted by adding

“dcm2niixOptions”: “-b y -ba y -z y -f ‘%3s_%f_%p_%t_%b’”

to the config file.

Just to notice, the “Error: Too many NIFTI images with the name” was solved by adding %b in the name in order to differentiate the images of the different echo times since %e was just taking into account the echo number which was fixed.

Thank you again!