Skip to content

Error if EchoNumber tag missing with multi-echo sequence #347

Closed
@nicholst

Description

@nicholst

Summary

While PR #345 successfully treats PD+T2 pairs as multi-echo, we now get runtime errors when such acquisitions are missing the EchoNumber tag:

*Runtime**Error**: was asked to copy X but destination already exists: Y

Using the --overwrite option eliminates the error but only leaves us with one echo.

Presently, multi echo support depends on EchoNumber tag, but given there are DICOM files in the wild that lack this tag we need a backup logic, presumably based on EchoTime. I can see that this requires a modification to the logic of save_converted_files in convert.py... something like

EchoNumberBackup = [x+1 for x in sorted(range(len(echo_times)), key=echo_times.__getitem__)]

and then assignment of echo_number will need to check for empty value and use EchoNumberBackup when missing. I can almost see what to do but it's just a bit beyond my very elementary Python.

Platform details:

Choose one:

  • Local environment

Python 3.6.6

  • Heudiconv version:

v0.5.4 + PR #345 patch

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions