<book xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0">
    <title>CP-1564</title>
    <subtitle>Copying unrecognized VRs</subtitle>
    <chapter>
        <title></title>
        <informaltable rules="all" frame="box">
            <tr>
                <td rowspan="1" colspan="1" valign="top"><para>Status</para></td>
                <td rowspan="1" colspan="1" valign="top"><para>May 2016 Packet</para></td>
            </tr>
            <tr>
                <td rowspan="1" colspan="1" valign="top"><para>Date of Last Update</para></td>
                <td rowspan="1" colspan="1" valign="top"><para>2016/03/18</para></td>
            </tr>
            <tr>
                <td rowspan="1" colspan="1" valign="top"><para>Person Assigned</para></td>
                <td rowspan="1" colspan="1" valign="top"><para>David Clunie</para><para><link
                    xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="mailto:dclunie@dclunie.com"/></para></td>
            </tr>
            <tr>
                <td rowspan="1" colspan="1" valign="top"><para>Submitter Name</para></td>
              <td rowspan="1" colspan="1" valign="top"><para>Mathieu Malaterre</para><para><link
                xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="mailto:mathieu.malaterre@gmail.com"/></para></td>
            </tr>
            <tr>
                <td rowspan="1" colspan="1" valign="top"><para>Submission Date</para></td>
               <td rowspan="1" colspan="1" valign="top"><para>2015/12/18</para></td>
            </tr>
        </informaltable>
        <informaltable rules="all" frame="box">
            <tr>
                <td rowspan="1" colspan="1" valign="top"><para>Correction Number CP-1564</para></td>
            </tr>
            <tr>
                <td rowspan="1" colspan="1" valign="top"><para>Log Summary: Copying unrecognized VRs</para></td>
            </tr>
            <tr>
                <td rowspan="1" colspan="1" valign="top">
                    <para>Name of Standard</para>
                    <para>PS3.5</para>
                </td>
            </tr>
            <tr>
                <td rowspan="1" colspan="1" valign="top">
                    <para>Rationale for Correction:</para>
                    <para>The standard anticipates an existing implementation encountering unrecognized (new standard) Value Representations
                        and describes how they may be ignored since the parsing rules are defined.</para>
                    <para>However, the standard is silent on how such data elements with unrecognized VRs should be copied,
                    and though this may be deduced from first principles, it would be helpful to describe it.</para>
                </td>
            </tr>
            <tr>
                <td rowspan="1" colspan="1" valign="top">Correction Wording:</td>
            </tr>
        </informaltable>
    </chapter>
    <chapter>
        <title></title>

        <section>
            <title></title>
            <informaltable rules="all" frame="box">
                <tr><td><para><emphasis role="italic">Amend DICOM PS3.5 as follows:</emphasis></para></td></tr>
            </informaltable>
        </section>
        
        <section label="6.2" status="2" xml:id="sect_6.2">
            <title>Value Representation (VR)</title>
            <para xml:id="para_3f79e255-1c8e-48b1-811f-97aa468ea546">The Value Representation of a Data Element describes the data type and format of that Data Element's Value(s). <olink targetdoc="PS3.6" targetptr="PS3.6" xrefstyle="select: labelnumber"/> lists the VR of each Data Element by Data Element Tag.</para>
            <para xml:id="para_5365717b-21d7-4c05-853c-9ab38004b2bb">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. Values with a VR of UI shall be padded with a single trailing NULL (00H) character when necessary to achieve even length. Values with a VR of OB shall be padded with a single trailing NULL byte value (00H) when necessary to achieve even length.</para>
            <para xml:id="para_32d49290-4ed4-45ef-bced-0524398a84c1">All new VRs defined in future versions of DICOM shall be of the same Data Element Structure as defined in <xref linkend="sect_7.1.2" xrefstyle="select: label"/> (i.e., following the format for VRs such as OB, OD, OF, OL, OW, SQ and UN).</para>
            <note>
                <orderedlist>
                    <listitem>
                        <para xml:id="para_cfdc9e96-676d-40a7-9db2-a0d88179d889">Since all new VRs will be defined as specified in <xref linkend="sect_7.1.2" xrefstyle="select: label"/>, an implementation may choose to ignore VRs not recognized by applying the rules stated in <xref linkend="sect_7.1.2" xrefstyle="select: label"/>.</para>
                    </listitem>
                    <listitem>
                        <para><emphasis role="bold"><emphasis role="underline">When converting a Data Set from an Explicit VR Transfer Syntax to a different Transfer Syntax, an implementation may copy Data Elements with unrecognized VRs in the following manner:</emphasis></emphasis></para>
                        <itemizedlist>
                            <listitem>
                                <para><emphasis role="bold"><emphasis role="underline">If the endianness of the Transfer Syntaxes is the same, the Value of the Data Element may be copied unchanged and if the target Transfer Syntax is Explicit VR, the VR bytes copied unchanged. In practice this only applies to Little Endian Transfer Syntaxes, since there was only one Big Endian Transfer Syntax defined.</emphasis></emphasis></para>
                            </listitem>
                            <listitem>
                                <para><emphasis role="bold"><emphasis role="underline">If the source Transfer Syntax is Little Endian and the target Transfer Syntax is the (retired) Big Endian Explicit VR Transfer Syntax, then the Value of the Data Element may be copied unchanged and the VR changed to UN, since being unrecognized, whether or not byte swapping is required is unknown. If the VR were copied unchanged, the byte order of the value might or might not be incorrect.</emphasis></emphasis></para>
                            </listitem>
                            <listitem>
                                <para><emphasis role="bold"><emphasis role="underline">If the source Transfer Syntax is the (retired) Big Endian Explicit VR Transfer Syntax, then the Data Element cannot be copied, because whether or not byte swapping is required is unknown, and there is no equivalent of the UN VR to use when the value is big endian rather than little endian.</emphasis></emphasis></para>
                            </listitem>
                        </itemizedlist>
                        <para><emphasis role="bold"><emphasis role="underline">The issues of whether or not the element may be copied, and what VR to use if copying, do not arise when converting a Data Set from Implicit VR Little Endian Transfer Syntax, since the VR would not be present to be unrecognized, and if the data element VR is not known from a data dictionary, then UN would be used.</emphasis></emphasis></para>
                    </listitem>
                </orderedlist>
            </note>
            <para xml:id="para_895fc31c-2dcb-4dde-8e3a-1652fc872b35">An individual Value, including padding, shall not exceed the Length of Value...</para>
        </section>
        
        <section label="7.1.2" status="3" xml:id="sect_7.1.2">
            <title>Data Element Structure with Explicit VR</title>
            <para xml:id="para_fdb2bf98-c448-4d0b-bea4-d41171c8b883">When using the Explicit VR structures, the Data Element shall be constructed of four consecutive fields: Data Element Tag, VR, Value Length, and Value. Depending on the VR of the Data Element, the Data Element will be structured in one of two ways:</para>
            <itemizedlist>
                <listitem>
                    <para xml:id="para_5feaf34b-29ce-486d-98f9-5fe7ef4ec0ee">for VRs of OB, OD, OF, OL, OW, SQ and UN the 16 bits following the two character 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 (<xref linkend="table_7.1-1" xrefstyle="select: label"/>). The Value Length Field is a 32-bit unsigned integer. 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.</para>
                </listitem>
                <listitem>
                    <para xml:id="para_e70550e8-0a4e-40f4-b64b-f82cdf5b1aa8">for VRs of UC, UR and UT the 16 bits following the two character 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. The Value Length Field is a 32-bit unsigned integer. The Value Field is required to have an Explicit Length, that is the Value Length Field shall contain a value equal to the length (in bytes) of the Value Field.</para>
                    <note>
                        <para xml:id="para_f27d1af5-7ecf-4e2a-9ce6-e2edd366e258">VRs of UC, UR and UT may not have an Undefined Length, i.e.,a Value Length of FFFFFFFFH.</para>
                    </note>
                </listitem>
                <listitem>
                    <para xml:id="para_1dadedad-a61e-4cf1-bafd-ab5efe1d2a85">for all other VRs the Value Length Field is the 16-bit unsigned integer following the two character VR Field (<xref linkend="table_7.1-2" xrefstyle="select: label"/>). The value of the Value Length Field shall equal the length of the Value Field.</para>
                </listitem>
            </itemizedlist>
            <table frame="box" label="7.1-1" rules="all" xml:id="table_7.1-1">
                <caption>Data Element with Explicit VR of OB, OD, OF, OL, OW, SQ, UC, UR, UT or UN</caption>
                <thead>
                    <tr valign="top">
                        <th align="center" colspan="2" rowspan="1">
                            <para xml:id="para_5c5ad357-5ca0-426d-9865-f96cd7372cf8">
                                <emphasis role="bold">Tag</emphasis>
                            </para>
                        </th>
                        <th align="center" colspan="2" rowspan="1">
                            <para xml:id="para_d07cc899-88c8-49a7-8826-465468330321">
                                <emphasis role="bold">VR</emphasis>
                            </para>
                        </th>
                        <th align="center" colspan="1" rowspan="1">
                            <para xml:id="para_a8e75faf-8faa-458b-b436-4ed959a9c254">
                                <emphasis role="bold">Value Length</emphasis>
                            </para>
                        </th>
                        <th align="center" colspan="1" rowspan="1">
                            <para xml:id="para_83fa249e-cf05-499b-aff6-160757b11410">
                                <emphasis role="bold">Value</emphasis>
                            </para>
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <tr valign="top">
                        <td align="left" colspan="1" rowspan="1">
                            <para xml:id="para_ee90a7e5-f567-4a37-b171-b8fa3024d164">Group Number</para>
                            <para xml:id="para_5ad2a84f-232b-4637-9b80-af5bb5a5cac0">(16-bit unsigned integer)</para>
                        </td>
                        <td align="left" colspan="1" rowspan="1">
                            <para xml:id="para_ac26739c-eb74-4601-a0d3-f6f54868c75f">Element Number</para>
                            <para xml:id="para_c2f0141c-22ec-4b7e-ba67-df23b7f6391d">(16-bit unsigned integer)</para>
                        </td>
                        <td align="left" colspan="1" rowspan="1">
                            <para xml:id="para_5e67423f-26ad-4664-888a-d5a4cf4c53d9">VR</para>
                            <para xml:id="para_cdf30654-9bf2-4383-ac19-8bda04ba1eeb">(2 byte character string) of "OB", "OD", "OF", "OL", "OW", "SQ", "UC", "UR", "UT" or "UN"</para>
                        </td>
                        <td align="left" colspan="1" rowspan="1">
                            <para xml:id="para_354dbd6a-0245-4914-97b9-2225646113ce">Reserved (2 bytes) set to a value of 0000H</para>
                        </td>
                        <td align="left" colspan="1" rowspan="1">
                            <para xml:id="para_e64594f9-8acb-4a2b-b9ea-782bf6e2b3b1">32-bit unsigned integer</para>
                        </td>
                        <td align="left" colspan="1" rowspan="1">
                            <para xml:id="para_a53b0e4b-5b68-4d5a-9591-200d8ae3abc9">Even number of bytes containing the Data Element Value(s) encoded according to the VR and negotiated Transfer Syntax. Delimited with Sequence Delimitation Item if of Undefined Length.</para>
                        </td>
                    </tr>
                    <tr valign="top">
                        <td align="left" colspan="1" rowspan="1">
                            <para xml:id="para_3f18f8c4-7f1c-4ed1-b3fb-38e072260cd5">2 bytes</para>
                        </td>
                        <td align="left" colspan="1" rowspan="1">
                            <para xml:id="para_9d6aa1cc-9694-420b-9d33-6ab3e44818b1">2 bytes</para>
                        </td>
                        <td align="left" colspan="1" rowspan="1">
                            <para xml:id="para_ff0841f5-3906-482c-82db-d1981604d9f6">2 bytes</para>
                        </td>
                        <td align="left" colspan="1" rowspan="1">
                            <para xml:id="para_fb19a35a-25de-4cda-aedc-47e1dd1db4fc">2 bytes</para>
                        </td>
                        <td align="left" colspan="1" rowspan="1">
                            <para xml:id="para_4027e039-1394-4231-9b52-06919761468e">4 bytes</para>
                        </td>
                        <td align="left" colspan="1" rowspan="1">
                            <para xml:id="para_9900d97f-b57f-4b03-88a2-402c651764a9">'Value Length' bytes if of Explicit Length</para>
                        </td>
                    </tr>
                </tbody>
            </table>
            <table frame="box" label="7.1-2" rules="all" xml:id="table_7.1-2">
                <caption>Data Element with Explicit VR other than as shown in <xref linkend="table_7.1-1" xrefstyle="select: label"/>
                </caption>
                <thead>
                    <tr valign="top">
                        <th align="center" colspan="2" rowspan="1">
                            <para xml:id="para_ad2d3b39-2ea8-4b24-8540-95e37e0fb21c">
                                <emphasis role="bold">Tag</emphasis>
                            </para>
                        </th>
                        <th align="center" colspan="1" rowspan="1">
                            <para xml:id="para_ee362013-806f-4d13-bfd8-0245210fef63">
                                <emphasis role="bold">VR</emphasis>
                            </para>
                        </th>
                        <th align="center" colspan="1" rowspan="1">
                            <para xml:id="para_ad36ffc0-f2c5-4637-8764-fe72622501b1">
                                <emphasis role="bold">Value Length</emphasis>
                            </para>
                        </th>
                        <th align="center" colspan="1" rowspan="1">
                            <para xml:id="para_1f93df22-8ea5-4568-930a-bcbd51e95e12">
                                <emphasis role="bold">Value</emphasis>
                            </para>
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <tr valign="top">
                        <td align="left" colspan="1" rowspan="1">
                            <para xml:id="para_92250758-eabb-4b24-a764-028ac1bdc04b">Group Number</para>
                            <para xml:id="para_fa3f177a-5d75-4327-85c2-19cc4a3436b9">(16-bit unsigned integer)</para>
                        </td>
                        <td align="left" colspan="1" rowspan="1">
                            <para xml:id="para_e8d7506f-3ac4-46b9-b2de-4d287319a15b">Element Number</para>
                            <para xml:id="para_a7f244ad-eb79-492a-a929-5bd1898d3fac">(16-bit unsigned integer)</para>
                        </td>
                        <td align="left" colspan="1" rowspan="1">
                            <para xml:id="para_7a3eefaa-aca8-4111-97f3-36bd031a6561">VR</para>
                            <para xml:id="para_f882be30-4d27-4b95-8e01-8db7636fc250">(2 byte character string)</para>
                        </td>
                        <td align="left" colspan="1" rowspan="1">
                            <para xml:id="para_2cdaa98e-0fd7-4b66-9a6a-cda7067890f6">(16-bit unsigned integer)</para>
                        </td>
                        <td align="left" colspan="1" rowspan="1">
                            <para xml:id="para_20dbff14-4c3b-45bc-b2d9-655e0b189a0b">Even number of bytes containing the Data Element Value(s) encoded according to the VR and negotiated Transfer Syntax.</para>
                        </td>
                    </tr>
                    <tr valign="top">
                        <td align="left" colspan="1" rowspan="1">
                            <para xml:id="para_6f4e3ee4-f1bb-4f3e-9d12-1d2122476787">2 bytes</para>
                        </td>
                        <td align="left" colspan="1" rowspan="1">
                            <para xml:id="para_34516a1e-4997-4e7e-8f9d-123e4798ddbe">2 bytes</para>
                        </td>
                        <td align="left" colspan="1" rowspan="1">
                            <para xml:id="para_d166e696-3f30-4f85-aad8-e23111049698">2 bytes</para>
                        </td>
                        <td align="left" colspan="1" rowspan="1">
                            <para xml:id="para_a55777ef-7b09-4760-8668-c8ae69c1a25e">2 bytes</para>
                        </td>
                        <td align="left" colspan="1" rowspan="1">
                            <para xml:id="para_a9deb200-9a39-4e25-bae7-641aae45893a">'Value Length' bytes</para>
                        </td>
                    </tr>
                </tbody>
            </table>
        </section>
        
       
    </chapter>
</book>
