Skip to content

Conversation

CPBridge
Copy link
Contributor

No description provided.

@CPBridge CPBridge requested review from fedorov and dclunie July 22, 2025 17:42
@fedorov
Copy link
Member

fedorov commented Aug 4, 2025

Chris will review again if tag length should be checked https://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_A.4.html#table_A.4-2

@CPBridge
Copy link
Contributor Author

CPBridge commented Aug 4, 2025

@fedorov @dclunie I believe this is resolved now. Now the code:

  • Uses dcmread with stop_before_pixels=True to read until the start of the pixel data tag
  • Read the 4 byte pixel data tag, check it has the expected value
  • Skip 8 bytes total for the VR (2 bytes), 2 reserved bytes, and pixel data length (4 bytes)
  • Read 4 byte item tag, check it has the expected value
  • Read next 4 bytes (offset table item length), check whether it is non-zero to determine the presence of a BOT

@CPBridge CPBridge requested a review from fedorov August 4, 2025 18:47
@CPBridge
Copy link
Contributor Author

Just wanted to nudge on this @fedorov @dclunie so it doesn't get lost. If the above approach for determining whether an image has an offset table is correct, we can merge

@fedorov
Copy link
Member

fedorov commented Aug 18, 2025

Thanks for the nudge! I added to the agenda to discuss tomorrow.

@fedorov
Copy link
Member

fedorov commented Aug 19, 2025

Chris, @dclunie did not have any questions about this.

Can you add pointers to the samples that cover each of the cases so we can have it for the reference and make testing easier?

@CPBridge
Copy link
Contributor Author

@fedorov I added three examples to the snippet, one with no offset table, one with a basic offset table, and one with an extended offset table

@fedorov fedorov merged commit 7b64fde into prod Sep 18, 2025
2 of 3 checks passed
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.

2 participants