Skip to content

Issue with Measurement Group Name Check in _count_roi_items() #352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
whollervi opened this issue May 19, 2025 · 1 comment
Open

Issue with Measurement Group Name Check in _count_roi_items() #352

whollervi opened this issue May 19, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@whollervi
Copy link

Hi all,

First of all, thanks for highdicom — it really makes working with DICOM SRs (TID 1500) much easier!

However, I ran into a small issue when parsing a TID 1500 SR that was not created with highdicom.

I received the following error:

SR Content Item does not represent a measurement group because it does not have name "Measurement Group".

It seems this might be related to SRs missing the Template ID for a Measurement Group (e.g., TID 1501).
Looking into sr/templates.py, specifically _count_roi_items(), I noticed this logic:

if group_item.name == codes.DCM.MeasurementGroup:
    raise ValueError(
        'SR Content Item does not represent a measurement group '
        'because it does not have name "Measurement Group".'
    )

The check needs to be inverted to raise the error if the name does not match "Measurement Group"?

Thanks again for your great work, and let me know if I can help further with this!

Best,
Wolfgang

@CPBridge
Copy link
Collaborator

Hi @whollervi thanks for the feedback! One-character fixes are my favourite type of bug :)

Unfortunately though it seems that the case of missing template identifiers is never actually tested in the test suite, so I'll work on a more complete PR that also adds regression testing for this problem soon

@CPBridge CPBridge self-assigned this May 19, 2025
@CPBridge CPBridge added the bug Something isn't working label May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants