How to set the UID that contains trailing null character. #1686
-
MWL SCP sent Study Instance UID that is padded with a single trailing null character to make even number of bytes in length. When my app set Study Instance UID, then DicomValidation.ValidateUI throws the exception (value contains invalid characters other than '0'-'9' and '.), so my app couldn't set the Study Instance UID value. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
If you set the UID value (without the trailing null), the trailing null will be automatically added during encoding, and the opposite (e.g. the trailing null is stripped) shall happen if you get the value using fo-dicom. I'm not sure if it would be a good idea to adapt fo-dicom to accept such a value - there are certainly pros and cons to this. |
Beta Was this translation helpful? Give feedback.
Yes - as the message says: "components must not have leading zeros", but they have in this case. Admittedly, this kind of DICOM standard violation happens often enough, and if you are just copying tags from elsewhere (opposed to creating your owns) it is probably best to switch off validation to avoid this: