Skip to content

Process DICOMs that raise exception on validation #656

Description

@stefpiatek

What happened?

We receive DICOM instances which immediately fail validation to the point that an error is thrown. This stops us from being able to anonymise the DICOMs

Relevant log output (optional)

orthanc-anon-1  |   File "/.venv/lib64/python3.13/site-packages/dicom_validator/validator/iod_validator.py", line 333, in _validate_attributes
orthanc-anon-1  |     raise RuntimeError(f"Not a sequence: {data_elem}")
orthanc-anon-1  |                                           -> (0008, 9215) Derivation Code Sequence            OB: Array of 62 elements
orthanc-anon-1  |
orthanc-anon-1  | RuntimeError: Not a sequence: (0008, 9215) Derivation Code Sequence            OB: Array of 62 elements

What did you expect? (optional)

We should try and process these DICOMs. Might be worth still trying to validate after anonymisation and letting the error stop the export of the DICOMs to at least see if these tags are actually wanted by the researchers. The example above is not in our allowlist

Acceptance

  • If runtime error during first validation, still continue on to anonymisation - making an empty dict for initial validation errors
  • still validate DICOM after anonymisation and warn for any issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions