Skip to content
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

Allow duplicate entries in ReferencedSeriesSequence #229

Merged
merged 5 commits into from
Jun 22, 2023

Conversation

CPBridge
Copy link
Collaborator

@CPBridge CPBridge commented Jun 4, 2023

I have come across some segmentations where there are duplicate entries in the ReferencedSeriesSequence. Highdicom just crashes with an unhelpful message in this situation. It doesn't really make sense to have duplicate entries here, but it's not explicitly disallowed, so in this PR I deduplicate them and allow them through, and log a warning.

@CPBridge CPBridge requested a review from hackermd June 4, 2023 15:33
@CPBridge CPBridge self-assigned this Jun 9, 2023
Copy link
Collaborator

@hackermd hackermd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor suggestion.

unique_instance_data = list(dict.fromkeys(instance_data))
if len(unique_instance_data) != len(instance_data):
logger.warning(
'Duplicate entries found in the ReferencedSeriesSequence.'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This log message could benefit from a few additional details, such as the SOP Instance UID of the instance and potentially also the duplicate entries. That information may help developers to debug the issue.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 311d2f0

@CPBridge CPBridge merged commit b19cea2 into master Jun 22, 2023
11 checks passed
@CPBridge CPBridge deleted the check_unique_referenced_instances branch June 27, 2024 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants