Padding Character

From GDCM Wiki
Jump to: navigation, search

Ref: http://groups.google.com/group/comp.protocols.dicom/msg/bebf6258b54032a5

If you cast your eye to Page 20 in PS 3.5 2004 about 2/3 down the page you'll see the following paragraph

"Two character codes of the single-byte character sets invoked in the GL area of the code table, 02/00 and 05/12, have special significance in the DICOM Standard. The character SPACE, represented by bit combination 02/00, shall be used for the padding of Data Element Values that are character strings. The Graphic Character represented by the bit combination 05/12, "\" (BACKSLASH) in the repertoire ISO-IR 6, shall only be used in character strings with Value Representations of UT, ST and LT (see Section 6.2). Otherwise the character code 05/12 is used as a separator for multiple valued Data Elements (see Section 6.4)."

I have always taken this to be the "global" setting unless specialised (as in the case of VR UI for example).

What is the padding character for let say VR=CS,LO,DS and such. All I could find is in PS 3.5:

... If padding is required to make the Value Field of even length, a single padding character shall be applied to the end of the Value Field (to the last Value), in which case the length of the last Value may exceed the Length of Value by 1. ...




Ref: http://groups.google.com/group/comp.protocols.dicom/msg/0ec91a1497cddb94


PS 3.5-2003 Page 18 6.1.2.3 Encoding of character repertoires ... Two character codes of the single-byte character sets invoked in the GL area of the code table, 02/00 and 05/12, have special significance in the DICOM Standard. The character SPACE, represented by bit combination 02/00, shall be used for the padding of Data Element Values that are character strings. <<<<<<<<<<

The padding on the end of odd length strings should be a SPACE character. However, when I used a SPACE character at the end of my strings, both the AGFA DICOM validator and the Osiris DICOM Viewer choked on the file. Upon further investigation of other DICOM files and trial and error, I found that if I put a NULL char ('\0') at the end of the odd length strings for padding, all of a sudden everything worked right.

My question is, Am I misinterpreting the standard, or are the other tools? If I'm wrong (which seems likely to me frankly) then where in the standard does it say to use '\0' for padding?

If I'm right, is it standard non-standard practice to use '\0' instead of ' '?

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox