Материал: part05

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам

DICOM PS3.5 2020a - Data Structures and Encoding​

Page 51​

7 The Data Set​

A Data Set represents an instance of a real world Information Object. A Data Set is constructed of Data Elements. Data Elements​ contain the encoded Values of Attributes of that object. The specific content and semantics of these Attributes are specified in Inform-​ ation Object Definitions (see PS3.3).​

Theconstruction,characteristics,andencodingofaDataSetanditsDataElementsarediscussedinthissection.PixelData,Overlays,​ and Curves are Data Elements whose interpretation depends on other related elements.​

7.1 Data Elements​

A Data Element is uniquely identified by a Data Element Tag. The Data Elements in a Data Set shall be ordered by increasing Data​ Element Tag Number and shall occur at most once in a Data Set.​

Note​

A Data Element Tag may occur again within Nested Data Sets (see Section 7.5).​

Two types of Data Elements are defined:​

•​Standard Data Elements have an even Group Number that is not (0000,eeee), (0002,eeee), (0004,eeee), or (0006,eeee).​

Note​

Usage of these groups is reserved for DIMSE Commands (see PS3.7) and DICOM File Formats.​

•​PrivateDataElementshaveanoddGroupNumberthatisnot(0001,eeee),(0003,eeee),(0005,eeee),(0007,eeee),or(FFFF,eeee).​ Private Data Elements are discussed further in Section 7.8.​

Note​

Although similar or related Data Elements often have the same Group Number; a Data Group does not convey any semantic​ meaning.​

A Data Element shall have one of three structures. Two of these structures contain the VR of the Data Element (Explicit VR) but differ​ in the way their lengths are expressed, while the other structure does not contain the VR (Implicit VR). All three structures contain​ the Data Element Tag, Value Length and Value for the Data Element. See Figure 7.1-1.​

Implicit and Explicit VR Data Elements shall not coexist in a Data Set and Data Sets nested within it (see Section 7.5). Whether a​ Data Set uses Explicit or Implicit VR, among other characteristics, is determined by the negotiated Transfer Syntax (see Section 10​ and Annex A).​

Note​

VRs are not contained in Data Elements when using DICOM Default Transfer Syntax (DICOM Implicit VR Little Endian​ Transfer Syntax).​

- Standard -​

Page 52​

DICOM PS3.5 2020a - Data Structures and Encoding​

 

Data Set

 

 

 

 

order of transmission

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Data

Data

Data

Data

...

 

Data

 

Data

 

Element

Element

Element

Element

 

Element

Element

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Tag

VR

Value

Value Field

Length

 

 

 

optional field - dependent on negotiated Transfer Syntax

Figure 7.1-1. DICOM Data Set and Data Element Structures​

7.1.1 Data Element Fields​

A Data Element is made up of fields. Three fields are common to all three Data Element structures; these are the Data Element Tag,​ Value Length, and Value Field. A fourth field, Value Representation, is only present in the two Explicit VR Data Element structures.​ The Data Element structures are defined in Section 7.1.2 and Section 7.1.3. The definitions of the fields are:​

Data Element Tag​

Anorderedpairof16-bitunsignedintegersrepresentingtheGroupNumberfollowedbyElementNumber.​

Value Representation​

Two single byte characters containing the VR of the Data Element. The VR for a given Data Element​

 

Tag shall be as defined by the Data Dictionary as specified in PS3.6. The two byte VR shall be encoded​

 

using only upper case letters from the DICOM default character set.​

Value Length​

Either:​

 

•​a 16 or 32-bit (dependent on VR and whether VR is explicit or implicit) unsigned integer containing​

 

the Explicit Length of the Value Field as the number of bytes (even) that make up the Value. It does​

 

not include the length of the Data Element Tag, Value Representation, and Value Length Fields.​

 

•​a 32-bit Length Field set to Undefined Length (FFFFFFFFH). Undefined Lengths may be used for​

 

Data Elements having the Value Representation (VR) Sequence of Items (SQ) and Unknown (UN).​

 

For Data Elements with Value Representation OW or OB Undefined Length may be used depending​

 

on the negotiated Transfer Syntax (see Section 10 and Annex A).​

 

Note​

 

1.​The decoder of a Data Set should support both Explicit and Undefined Lengths for VRs​

 

of SQ and UN and, when applicable, for VRs of OW and OB.​

 

2.​The 32-bit Value Length Field limits the maximum size of large data values such as Pixel​

 

Data sent in a Native Format (encoded in Transfer Syntaxes that use only the unencapsu-​

 

lated form).​

Value Field​

An even number of bytes containing the Value(s) of the Data Element.​

 

The data type of Value(s) stored in this field is specified by the Data Element's VR. The VR for a given​

 

Data Element Tag can be determined using the Data Dictionary in PS3.6, or using the VR Field if it is​

 

contained explicitly within the Data Element. The VR of Standard Data Elements shall agree with those​

 

specified in the Data Dictionary.​

 

The Value Multiplicity specifies how many Values with this VR can be placed in the Value Field. If the​

 

VM is greater than one, multiple values shall be delimited within the Value Field as defined previously​

 

in Section 6.4. The VMs of Standard Data Elements are specified in the Data Dictionary in PS3.6.​

 

Value Fields with Undefined Length are delimited through the use of Sequence Delimitation Items and​

 

Item Delimitation Data Elements, which are described further in Section 7.5.​

- Standard -​

DICOM PS3.5 2020a - Data Structures and Encoding​

Page 53​

7.1.2 Data Element Structure with Explicit VR​

Whenusing theExplicit VRstructures,theData Elementshallbeconstructed of fourconsecutivefields: Data ElementTag,VR, Value​ Length, and Value. Depending on the VR of the Data Element, the Data Element will be structured in one of two ways:​

•​for VRs of AE, AS, AT, CS, DA, DS, DT, FL, FD, IS, LO, LT, PN, SH, SL, SS, ST, TM, UI, UL and US the Value Length Field is the​ 16-bit unsigned integer following the two byte VR Field (Table 7.1-2). The value of the Value Length Field shall equal the length of​ the Value Field.​

•​for all other VRs the 16 bits following the two byte VR Field are reserved for use by later versions of the DICOM Standard. These​ reserved bytes shall be set to 0000H and shall not be used or decoded (Table 7.1-1). The Value Length Field is a 32-bit unsigned​ integer.​

•​for VRs of OB, OD, OF, OL, OV, OW, SQ and UN, if the Value Field has an Explicit Length, then the Value Length Field shall​ containavalueequaltothelength(inbytes)oftheValueField,otherwise,theValueFieldhasanUndefinedLengthandaSequence​ Delimitation Item marks the end of the Value Field.​

•​for all other VRs with a 32-bit Value Length Field, the Value Length Field shall contain a value equal to the length (in bytes) of​ the Value Field.​

Note​

VRs of SV, UC, UR, UV and UT may not have an Undefined Length, i.e.,a Value Length of FFFFFFFFH.​

Table 7.1-1. Data Element with Explicit VR other than as shown in Table 7.1-2​

Tag​

 

VR​

Value Length​

Value​

Group Number​

Element Number​VR​

Reserved (2​

32-bit unsigned​Even number of bytes containing the​

 

 

 

bytes) set to a​

integer​

Data Element Value(s) encoded​

(16-bit unsigned​(16-bit unsigned​ (2 single byte​ value of 0000H​

 

according to the VR and negotiated​

integer)​

integer)​

characters)​

 

 

Transfer Syntax. Delimited with​

 

 

 

 

 

Sequence Delimitation Item if of​

 

 

 

 

 

Undefined Length.​

2 bytes​

2 bytes​

2 bytes​

2 bytes​

4 bytes​

'ValueLength'bytesifofExplicitLength​

Table 7.1-2. Data Element with Explicit VR of AE, AS, AT, CS, DA, DS, DT, FL, FD, IS, LO, LT, PN, SH,​ SL, SS, ST, TM, UI, UL and US​

 

Tag​

VR​

Group Number​

Element Number​

VR​

(16-bit unsigned​

(16-bit unsigned​

(2 single byte​

integer)​

integer)​

characters)​

2 bytes​

2 bytes​

2 bytes​

Value Length​

Value​

(16-bit unsigned​

Even number of bytes containing the​

integer)​

Data Element Value(s) encoded​

 

according to the VR and negotiated​

 

Transfer Syntax.​

2 bytes​

'Value Length' bytes​

7.1.3 Data Element Structure with Implicit VR​

When using the Implicit VR structure the Data Element shall be constructed of three consecutive fields: Data Element Tag, Value​ Length, and Value (see Table 7.1-3). If the Value Field has an Explicit Length then the Value Length Field shall contain a value equal​ to the length (in bytes) of the Value Field. Otherwise, the Value Field has an Undefined Length and a Sequence Delimitation Item​ marks the end of the Value Field.​

- Standard -​

Page 54​ DICOM PS3.5 2020a - Data Structures and Encoding​

Table 7.1-3. Data Element with Implicit VR​

 

Tag​

Value Length​

Value​

Group Number​

Element Number​

32-bit unsigned integer​Even number of bytes containing the Data Elements​

(16-bitunsignedinteger)​(16-bit unsigned integer)​

Value encoded according to the VR specified in PS3.6​

and the negotiated Transfer Syntax. Delimited with​

 

 

 

Sequence Delimitation Item if of Undefined Length.​

2 bytes​

2 bytes​

4 bytes​

'Value Length' bytes or Undefined Length​

7.2 Group Length​

GroupLength(gggg,0000)DataElementswereimplicitlydefinedforStandardandPrivateDataElementgroupswithaValueRepres-​ entation of UL and a Value Multiplicity of 1, but have been retired. See PS3.5-2007.​

All implementations shall be able to parse Group Length elements, and may discard and not insert or re-insert them; if present they​ shall be consistent with the encoding of the Data Set even if the Transfer Syntax is changed resulting in a change in the actual length​ of a group of elements. No implementation shall require the presence of Group Length elements.​

Note​

1.​Elements in groups 0, 2, 4 and 6 are not Standard Data Elements. Mandatory requirements for Group Length for groups​ 0 and 2 are specified elsewhere in the Standard.​

2.​It is recommended that Group Length elements be removed during storage or transfer in order to avoid the risk of incon-​ sistencies arising during coercion of data element values and changes in Transfer Syntax.​

7.3 Little Endian Byte Ordering​

All nonretired Transfer Syntaxes in DICOM require the use of Little Endian Byte Ordering.​

Little Endian byte ordering is defined as follows:​

•​In a binary number consisting of multiple bytes (e.g., a 32-bit unsigned integer value, the Group Number, the Element Number,​ etc.), the least significant byte shall be encoded first; with the remaining bytes encoded in increasing order of significance.​

•​In a character string consisting of multiple 8-bit single byte codes, the characters will be encoded in the order of occurrence in the​ string (left to right).​

Big Endian byte ordering was previously described but has been retired, See PS3.5 2016b.​

Note​

The packing of bits within values of OB or OW Value Representation for Pixel Data and Overlay Data is described in Section​ 8. The OL and OV Value Representations are not used for Pixel Data or Overlay Data.​

Byte ordering is a component of an agreed upon Transfer Syntax (see Section 10). The default DICOM Transfer Syntax, which shall​ be supported by all AEs, uses Little Endian encoding and is specified in Section A.1. Alternate Little Endian Transfer Syntaxes are​ also specified in Annex A.​

Note​

The Command Set structure as specified in PS3.7 is encoded using the Little Endian Implicit VR Transfer Syntax.​

In the case of Little Endian encoding, Big Endian Machines interpreting Data Sets shall do 'byte swapping' before interpreting or op-​ erating on certain Data Elements. The Data Elements affected are all those having VRs that are multiple byte Values and that are​ not a character string of 8-bit single byte codes. VRs constructed of a string of characters of 8-bit single byte codes are really con-​ structed of a string of individual bytes, and are therefore not affected by byte ordering. The VRs that are not a string of characters​ and consist of multiple bytes are:​

•​2-byte US, SS, OW and each component of AT​

- Standard -​

DICOM PS3.5 2020a - Data Structures and Encoding​

Page 55​

•​4-byte OF, OL, UL, SL, and FL​

•​8 byte OD, OV, FD, SV and UV​

Note​

For the above VRs, the multiple bytes are presented in increasing order of significance when in Little Endian format. For​ example, an 8-byte Data Element with VR of FD, might be written in hexadecimal as 68AF4B2CH, but encoded in Little​ Endian would be 2C4BAF68H.​

7.4 Data Element Type​

An attribute, encoded as a Data Element, may or may not be required in a Data Set, depending on that Attribute's Data Element Type.​

The Data Element Type of an Attribute of an Information Object Definition or an Attribute of a SOP Class Definition is used to specify​ whether that Attribute is mandatory or optional. The Data Element Type also indicates if an Attribute is conditional (only mandatory​ under certain conditions). The Data Element Types of Attributes of Composite IODs are specified in PS3.3. The Data Element Types​ of Attributes of Normalized IODs are specified as Attributes of SOP Classes in PS3.4.​

7.4.1 Type 1 Required Data Elements​

IODs and SOP Classes define Type 1 Data Elements that shall be included and are mandatory elements. The Value Field shall​ contain valid data as defined by the elements VR and VM as specified in PS3.6. The Length of the Value Field shall not be zero.​ Absence of a valid Value in a Type 1 Data Element is a protocol violation.​

Note​

1.​For data elements with a string (CS, SH, LO) rather than binary, text or sequence Value Representation, and for which​ multipleValuesareallowed,thepresenceofasingleValueissufficienttosatisfytheType1requirement,unlessspecified​ otherwise in the Attribute description, and other Values may be empty, unless otherwise specified by the IOD. The​ presence of one or more delimiter (BACKSLASH) characters alone, without any Values, is not sufficient to satisfy the​ Type 1 requirement, since even though the Value Length is greater than zero, there is no valid Value present.​

2.​A Type 1 Sequence Data Element will contain one or more Items, as defined by the IOD (irrespective of the VM of the​ Sequence, which is always one (Section 7.5)). Whether or not those Items may be empty (contain no Data Elements)​ depends on the IOD definition of the Data Set for each Item.​

7.4.2 Type 1C Conditional Data Elements​

IODs and SOP Classes define Data Elements that shall be included under certain specified conditions. Type 1C elements have the​ same requirements as Type 1 elements under these conditions. It is a protocol violation if the specified conditions are met and the​ Data Element is not included.​

When the specified conditions are not met, Type 1C elements shall not be included in the Data Set.​

7.4.3 Type 2 Required Data Elements​

IODs and SOP Classes define Type 2 Data Elements that shall be included and are mandatory Data Elements. However, it is per-​ missible that if a Value for a Type 2 element is unknown it can be encoded with zero Value Length and no Value. If the Value is known​ the Value Field shall contain that value as defined by the elements VR and VM as specified in PS3.6. These Data Elements shall be​ included in the Data Set and their absence is a protocol violation.​

Note​

1.​The intent of Type 2 Data Elements is to allow a zero length to be conveyed when the operator or application does not​ know its value or has a specific reason for not specifying its value. It is the intent that the device should support these​ Data Elements.​

2.​A Type 2 Sequence Data Element will contain zero or more Items, as defined by the IOD (irrespective of the VM of the​ Sequence, which is always one (Section 7.5)). An empty Type 2 Sequence is one with no Items, as opposed to an Item​

- Standard -​