CTK icon indicating copy to clipboard operation
CTK copied to clipboard

DICOM tag string handling issues

Open Punzo opened this issue 9 months ago • 0 comments

Reference commits and discussions

  1. Discourse thread
  2. https://github.com/commontk/CTK/commit/84187713304e4ed5a457ee9758de1af4a22d8dbd
  3. https://github.com/commontk/CTK/pull/1154
  4. https://github.com/commontk/CTK/pull/1203

Description

The current DICOM tag string handling implementation may have sneaky errors due to the storage of DICOM tags as strings. This can lead to various manifestations of bugs, especially when comparing tag strings. While storing these tags as int could address these issues, the codebase might need to support private tags in the future, necessitating a string representation.

Proposed Solution

Given these considerations, we need to:

  1. String Handling:

    • Keep the tag representation as a string to support potential private tags.
    • Ensure consistent conversion methods across the codebase to avoid string comparison issues, such as capitalization and zero-padding.
    • Add normalization for tag strings to ensure consistency in tagcache methods.
  2. Documentation:

    • Improve documentation for tagcache to describe how tag strings are formatted.
    • Update dicomTagToString method documentation to clarify string formatting expectations (and just have only one static method in the ctkDICOMDatabase class).
    • Include thorough documentation in get/set methods describing input formatting and output formats.
  3. Unit Testing:

    • Create robust unit tests for DICOM tag handling to prevent regressions.

Reference Information

A regression related to https://github.com/commontk/CTK/pull/1154 was identified in this Discourse thread and a simple fix was proposed in https://github.com/commontk/CTK/pull/1203.

Punzo avatar May 10 '24 17:05 Punzo