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

Value representation "Application Entity" is not correclly serialized #275

Closed
bench opened this issue Jun 6, 2023 · 0 comments · Fixed by #276
Closed

Value representation "Application Entity" is not correclly serialized #275

bench opened this issue Jun 6, 2023 · 0 comments · Fixed by #276

Comments

@bench
Copy link
Contributor

bench commented Jun 6, 2023

Some DICOM files containing a VR of type AE are not properly serialized.

For example, the following dicom file is valid. It contains, among other things, the following header.

(0002, 0016) Source Application Entity Title AE: 'CLUNIE1'

By deserializing and serializing the file again, the field (0002, 0016) is modified and takes the value

(0002, 0016) Source Application Entity Title AE: 'CLUNIE1\x00'

According to the official specification, values with VRs constructed of character strings, except in the case of the VR UI, shall be padded with SPACE characters (20H, in the Default Character Repertoire) when necessary to achieve even length.

Also, the value is a string of characters that identifies an Application Entity with leading and trailing spaces (20H) being non-significant. A Value consisting solely of spaces shall not be used.

The binary part of the header defining "Application Entity Title" is detailed below.

image

What ? Meaning
02 group number
16 group number
4145 AE
0800 8 bytes length (must be an even number!)
434c 554e 4945 3120 C L U N I E 1 + SPACE

Once deserialized, the space character should be ignored because it is non-significant but here the space is replaced by a ZERO.

Refs

https://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_6.2.html
https://dicom.nema.org/medical/dicom/current/output/chtml/part05/chapter_7.html#table_7.1-2

bench pushed a commit to bench/dicom that referenced this issue Jun 6, 2023
Signed-off-by: Benjamin Chenebault <benjamin.chenebault@health-data-hub.fr>
suyashkumar pushed a commit that referenced this issue Jun 9, 2023
Co-authored-by: Benjamin Chenebault <benjamin.chenebault@health-data-hub.fr>
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 a pull request may close this issue.

1 participant