heudiconv icon indicating copy to clipboard operation
heudiconv copied to clipboard

KeyError: 'CoilString'

Open butellyn opened this issue 3 years ago • 0 comments

Summary

I ran heudiconv with the following call:

singularity run --writable-tmpfs --cleanenv --containall \
  -B /projects/b1108/studies/mwmh/data/raw/neuroimaging:/base \
  -B /projects/b1108/studies/mwmh/scripts/curation/heuristic.py:/base/heuristic.py \
  /home/erb9722/heudiconv_0.9.0.sif \
  -d /base/dicoms/sub-{subject}/*/*/*/*/*.dcm \
  -o /base/bids/ \
  -f /base/heuristic.py -s MWMH219 -c dcm2niix -b --overwrite

and got the following error: "KeyError: 'CoilString'". I suspect that there is some field that is missing from my dicom header (based off of my read of convert.py). I searched for "coil" and "string", and only found "ACQ Transmitting Coil//Body", which seems irrelevant. Is the CoilString field necessary? If not, is there a way/could there be a way to override this requirement in heudiconv?

Traceback:

220419-14:44:55,264 nipype.workflow INFO:
	 [Node] Finished "convert".
INFO: [Node] Finished "convert".
Traceback (most recent call last):
  File "/opt/miniconda-latest/bin/heudiconv", line 33, in <module>
    sys.exit(load_entry_point('heudiconv', 'console_scripts', 'heudiconv')())
  File "/src/heudiconv/heudiconv/cli/run.py", line 24, in main
    workflow(**kwargs)
  File "/src/heudiconv/heudiconv/main.py", line 351, in workflow
    grouping=grouping,)
  File "/src/heudiconv/heudiconv/convert.py", line 216, in prep_conversion
    dcmconfig=dcmconfig,)
  File "/src/heudiconv/heudiconv/convert.py", line 481, in convert
    overwrite=overwrite)
  File "/src/heudiconv/heudiconv/convert.py", line 749, in save_converted_files
    bids_meta, this_prefix_basename, channel_names
  File "/src/heudiconv/heudiconv/convert.py", line 376, in update_uncombined_name
    channel_number = ''.join([c for c in metadata['CoilString'] if c.isdigit()])
KeyError: 'CoilString'

Platform details:

Choose one:

  • [ ] Local environment
  • [X] Container
  • Heudiconv version: 0.9.0

butellyn avatar Apr 19 '22 19:04 butellyn