<book xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0">
    <title>CP-2302</title>
    <subtitle>Clarify absence of padding between frames applies to single BitsStored multi-frame images encoded in Native format</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>Assigned</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>2023/06/30</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
                    xl: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>David Clunie</para><para><link
                 xl:href="mailto:dclunie@dclunie.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>2023/04/18</para></td>
            </tr>
        </informaltable>
        <informaltable rules="all" frame="box">
            <tr>
                <td rowspan="1" colspan="1" valign="top"><para>Correction Number CP-2302</para></td>
            </tr>
            <tr>
                <td rowspan="1" colspan="1" valign="top"><para>Log Summary: Clarify absence of padding between frames applies to single BitsStored multi-frame images encoded in Native format</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>It is already explicit that there is no padding between frames encoded as Native (not Encapsulated) and that Pixel Cells are packed successively across byte or word boundaries, but it may not be obvious that this means that when BitsAllocated is 1 (e.g., a BINARY Segmentation) that frames may span byte or word boundaries, since there is no provision to allow padding between frames.</para>
                </td>
            </tr>
            <tr>
                <td rowspan="1" colspan="1" valign="top">Correction Wording:</td>
            </tr>
        </informaltable>
    </chapter>
    <chapter>
        <title/>

      <informaltable rules="all" frame="box">
        <tr>
          <td>
            <para><emphasis role="italic">Amend DICOM PS3.5 as follows (changes to existing text
              are bold and <emphasis role="bold"><emphasis role="underline"
                  >underlined</emphasis></emphasis> for additions and <emphasis role="bold"
                  ><emphasis role="strikethrough">struckthrough</emphasis></emphasis> for
              removals):</emphasis></para>
          </td>
        </tr>
      </informaltable>
        
        <section label="8" status="1" xml:id="chapter_8">
    <title>Encoding of Pixel, Overlay and Waveform Data</title>
    <section label="8.1" status="2" xml:id="sect_8.1">
      <title>Pixel and Overlay Data, and Related Data Elements</title>
      <para xml:id="para_55a4d726-165f-4db4-9994-5943fec5e49b">...</para>
      <section label="8.1.1" status="3" xml:id="sect_8.1.1">
        <title>Pixel Data Encoding of Related Data Elements</title>
        <para xml:id="para_ab605359-6207-40cd-ae3b-71c880eb664f">Encoded Pixel Data of various bit depths shall be accommodated. The following three Data Elements shall define the Pixel structure:</para>
        <itemizedlist>
          <listitem>
            <para xml:id="para_b377af08-67df-453b-96cd-5c04a0bdb569">Bits Allocated (0028,0100)</para>
          </listitem>
          <listitem>
            <para xml:id="para_0ab917ae-65ea-4456-96d8-73a1576f921d">Bits Stored (0028,0101)</para>
          </listitem>
          <listitem>
            <para xml:id="para_f4e18bb1-2722-4709-a83b-f437034eb8b4">High Bit (0028,0102)</para>
          </listitem>
        </itemizedlist>
        <para xml:id="para_4681e9e2-8cb1-428f-8011-0e624437e351">Each Pixel Cell shall contain a single Pixel Sample Value. The size of the Pixel Cell shall be specified by Bits Allocated (0028,0100). Bits Stored (0028,0101) defines the total number of these allocated bits that will be used to represent a Pixel Sample Value. Bits Stored (0028,0101) shall never be larger than Bits Allocated (0028,0100). High Bit (0028,0102) specifies where the high order bit of the Bits Stored (0028,0101) is to be placed with respect to the Bits Allocated (0028,0100) specification. Bits Allocated (0028,0100) shall either be 1, or a multiple of 8. High Bit (0028,0102) shall be one less than Bits Stored (0028,0101).</para>
        <note>
          <orderedlist>
            <listitem>
              <para xml:id="para_457cf9ae-46b5-42a7-8096-9f5673d96c07">For example, in Pixel Data with 16 bits (2 bytes) allocated, 12 bits stored, and bit 11 specified as the high bit, one pixel sample is encoded in each 16-bit word, with the 4 most significant bits of each word not containing Pixel Data. See <xref linkend="chapter_D" xrefstyle="template:Annex %n"/> for other examples of the basic encoding schemes.</para>
            </listitem>
            <listitem>
              <para xml:id="para_7ef27e5b-1166-49be-b782-688deb51aa97">Formerly, bits not used for Pixel Sample
              Values were described as being usable for overlay planes, but this usage has
              been retired. See PS3.5-2004.</para>
            </listitem>
            <listitem>
              <para xml:id="para_f777ac20-cdc7-41ba-9e81-128c7eba5bf8">Formerly, High Bit
                (0028,0102) was not restricted to be one less than Bits Stored (0028,0101)
                in this Part, or in the general case, though almost all Information Object
                Definitions in PS3.3 imposed such a restriction. See PS3.5
                2014c.</para>
            </listitem>
            <listitem>
              <para xml:id="para_752250e9-20fd-460e-b2c3-823bded25a57">Receiving applications may not assume
                anything about the contents of unused bits, and in particular may not assume
                that they are zero, or that they contain sign extension
                bits.</para>
            </listitem>
          </orderedlist>
        </note>
        <para xml:id="para_0486e172-df22-40c4-a38f-9286022646c3">...</para>
        <para xml:id="para_5ac3a1cc-12f7-4303-86fc-33bf4c34f3c1">Also, the Value Field containing Pixel Data, like all other Value Fields in DICOM, shall be an even number of bytes in length. This means that the Value Field may need to be padded with data that is not part of the image and shall not be considered significant. If needed, the padding bits shall be appended to the end of the Value Field, and shall be used only to extend the data to the next even byte increment of length.</para>
          <note>
              <para xml:id="para_23a52e85-e9ea-41b8-9cd5-5c6eeec077bc">The 32-bit Value Length Field limits the maximum size of large data Value Fields such as Pixel Data sent in a Native Format (encoded in Transfer Syntaxes that use only the unencapsulated form).</para>
          </note>
          <para xml:id="para_3e55e85c-a189-418d-a160-3837b41c7240">In a multi-frame object that is transmitted in Native Format, the individual frames are not padded. The individual frames shall be concatenated and padding bits (if necessary) applied to the complete Value Field. At least one frame shall be present.</para>
        <note>
            <orderedlist>
                <listitem>
                    <para xml:id="para_362cebd6-ea8c-4a91-a674-3cd2a3097ad2">Receiving applications should be aware that some older applications may send Pixel Data with excess padding, which was not explicitly prohibited in earlier versions of the Standard. Applications should be prepared to accept such Pixel Data Data Elements, but may delete the excess padding. In no case should a sending application place private data in the padding data.</para>
                </listitem>
                <listitem>
                    <para><emphasis role="bold"><emphasis role="underline">In a multi-frame object with a Bits Allocated (0028,0100) of 1 that is transmitted in Native Format, the individual frames are not padded, therefore successive bits are packed into bytes or words as described in <xref linkend="sect_8.2" xrefstyle="select: labelnumber"/>. I.e., a frame other than the first frame may start in the middle of a byte or word. This is consistent with the historical encoding of Multi-frame Overlays described in <xref linkend="sect_8.1" xrefstyle="select: labelnumber"/>.</emphasis></emphasis></para>
                </listitem>
            </orderedlist>
        </note>
        <para xml:id="para_25fc57a8-3784-49d6-97be-4eabf94b65fc">...</para>
      </section>
      <section label="8.1.2" status="3" xml:id="sect_8.1.2">
        <title>Overlay Data Encoding of Related Data Elements</title>
        <para xml:id="para_af5777c4-44f0-48a0-9af6-5754e7f56489">...</para>
        <para xml:id="para_e5bcf268-0b7d-4b21-b495-84b330046490">Overlay Data is encoded as the direct concatenation of the bits of a single Overlay Plane, where the first bit of an Overlay Plane is encoded in the least significant bit, immediately followed by the next bit of the Overlay Plane in the next most significant bit.
            For a Multi-frame Overlay, the individual frames are not padded.
            The individual frames shall be concatenated and padding bits (if necessary) applied to the complete Value Field. 
            When the Overlay Data crosses a word boundary in the OW case, or a byte boundary in the OB case, it shall continue to be encoded, least significant bit to most significant bit, in the next word, or byte, respectively (see <xref linkend="chapter_D" xrefstyle="template:Annex %n"/>). For Overlay Data encoded with the Value Representation OW, the byte ordering of the resulting 2-byte words is defined by the Little Endian Transfer Syntaxes negotiated at the Association Establishment (see <xref linkend="chapter_A" xrefstyle="template:Annex %n"/>).</para>
                    <para>...</para>
      </section>
    </section>
    <section label="8.2" status="2" xml:id="sect_8.2">
      <title>Native or Encapsulated Format Encoding</title>
      <para xml:id="para_f9b54410-31ad-4044-9be0-651dd86c84b3">...</para>
      <para xml:id="para_cdbe477b-a4f5-417d-bee0-82e5a0b1a9ad">If Pixel Data (7FE0,0010) is sent in a Native Format, the Value Representation OW is most often required. The Value Representation OB may also be used for Pixel Data (7FE0,0010) in cases where Bits Allocated has a Value less than or equal to 8, but only with Transfer Syntaxes where the Value Representation is explicitly conveyed (see <xref linkend="chapter_A" xrefstyle="template:Annex %n"/>).</para>
      <note>
          <orderedlist>
              <listitem>
                  <para xml:id="para_ec814ff7-cbc9-4530-a0b6-a580a48d6cf4">The DICOM Default Little Endian Transfer Syntax (Implicit VR Little Endian) does not explicitly convey Value Representation and therefore the VR of OB may not be used for Pixel Data (7FE0,0010) when using the Default Transfer Syntax.</para>
              </listitem>
              <listitem>
                  <para xml:id="para_a7e1bfa6-d021-48eb-bbe7-4bbe16f873a4">The 32-bit Value Length Field limits the maximum size of large data Value Fields such as Pixel Data sent in a Native Format.</para>
              </listitem>
          </orderedlist>
      </note>
      <para xml:id="para_dec19bac-823e-44b1-ba85-3bc875c2010d">...</para>
      <para xml:id="para_d6734089-67bc-433e-87f7-40f00a859a9d">Native format Pixel Cells are encoded as the direct concatenation of the bits of each Pixel Cell, the least significant bit of each Pixel Cell is encoded in the least significant bit of the encoded word or byte, immediately followed by the next most significant bit of each Pixel Cell in the next most significant bit of the encoded word or byte, successively until all bits of the Pixel Cell have been encoded, then immediately followed by the least significant bit of the next Pixel Cell in the next most significant bit of the encoded word or byte. The number of bits of each Pixel Cell is defined by the Bits Allocated (0028,0100) Data Element Value. When a Pixel Cell crosses a word boundary in the OW case, or a byte boundary in the OB case, it shall continue to be encoded, least significant bit to most significant bit, in the next word, or byte, respectively (see <xref linkend="chapter_D" xrefstyle="template:Annex %n"/>). For Pixel Data (7FE0,0010) encoded with the Value Representation OW, the byte ordering of the resulting 2-byte words is
  defined by the Little Endian Transfer Syntaxes negotiated at the Association Establishment (see <xref linkend="chapter_A" xrefstyle="template:Annex %n"/>).</para>
      <note>
        <orderedlist numeration="arabic">
          <listitem>
            <para xml:id="para_1e6dec20-1376-4b1e-b909-255ba6abcf59">For Pixel Data (7FE0,0010) encoded with the Value Representation OB, the Pixel Data (7FE0,0010) encoding is unaffected by byte ordering.</para>
          </listitem>
          <listitem>
            <para xml:id="para_754c31cf-0a9a-484e-bfba-2130fc81252e">If encoding Pixel Data (7FE0,0010) with a Value for Bits Allocated (0028,0100) not equal to 16 be sure to read and understand <xref linkend="chapter_D" xrefstyle="template:Annex %n"/>.</para>
          </listitem>
        </orderedlist>
      </note>
                <para>...</para>
    </section>
  </section>
        
        
        
        
        
    </chapter>
</book>
