<book xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0">
    <title>CP-2481</title>
    <subtitle>Clarify odd number of 8-bit palette color LUT entries</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>Final Text</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>2025/09/08</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>Chris Bridge</para><para><link
                    xl:href="mailto:cbridge@mgh.harvard.edu"/></para></td>
            </tr>
            <tr>
                <td rowspan="1" colspan="1" valign="top"><para>Submission Date</para></td>
                <td rowspan="1" colspan="1" valign="top"><para>2024/11/14</para></td>
            </tr>
        </informaltable>
        <informaltable rules="all" frame="box">
            <tr>
                <td rowspan="1" colspan="1" valign="top"><para>Correction Number CP-2481</para></td>
            </tr>
            <tr>
                <td rowspan="1" colspan="1" valign="top"><para>Log Summary: Clarify odd number of 8-bit palette color LUT entries</para></td>
            </tr>
            <tr>
                <td rowspan="1" colspan="1" valign="top">
                    <para>Name of Standard</para>
                    <para>PS3.3 2025c</para>
                </td>
            </tr>
            <tr>
                <td rowspan="1" colspan="1" valign="top"><para>Rationale for Correction:</para>
                    <para>When there is an odd number of 8-bit palette color LUT entries, the length of the OW or US data element is still required to be even so a single padding byte is needed.</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.3 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="C.7.6.3.1.5" status="6" xml:id="sect_C.7.6.3.1.5">
            <title>Palette Color Lookup Table Descriptor</title>
            <para xml:id="para_6b6cdcbd-e86a-46fc-a9c9-b97ea1701519">The three values of Palette Color Lookup Table Descriptor (0028,1101-1104) describe the format of the Lookup Table Data in the corresponding Data Element (0028,1201-1204) or (0028,1221-1223). In this section, the term "input value" is either the Palette Color Lookup Table input value described in the Enhanced Palette Color Lookup Table Sequence (0028,140B) or if that Attribute is absent, the stored pixel value.</para>
            <para xml:id="para_0207e64e-0957-4f88-810e-9eb2be3aa632">The first Palette Color Lookup Table Descriptor value is the number of entries in the lookup table. When the number of table entries is equal to 2<superscript>16</superscript> then this value shall be 0. The first value shall be identical for each of the Red, Green, Blue and Alpha Palette Color Lookup Table Descriptors.</para>
            <para xml:id="para_ef58b19b-f72e-4f49-b292-30b956a74547">The second Palette Color Lookup Table Descriptor value is the first input value mapped. This input value is mapped to the first entry in the Lookup Table Data. All input values less than the first value mapped are also mapped to the first entry in the Lookup Table Data if the Photometric Interpretation is PALETTE COLOR.</para>
            <note>
                <para xml:id="para_da6b7a18-9473-4945-b3af-fb94e498b417">In the case of the Supplemental Palette Color LUT, the stored pixel values less than the second descriptor value are grayscale values.</para>
            </note>
            <para xml:id="para_e8b978aa-4fa0-4b0e-8fd6-d30b26506cc7">An input value one greater than the first value mapped is mapped to the second entry in the Lookup Table Data. Subsequent input values are mapped to the subsequent entries in the Lookup Table Data up to an input value equal to number of entries + first value mapped - 1, which is mapped to the last entry in the Lookup Table Data. Input values greater than or equal to number of entries + first value mapped are also mapped to the last entry in the Lookup Table Data. The second value shall be identical for each of the Red, Green, Blue and Alpha Palette Color Lookup Table Descriptors.</para>
            <para xml:id="para_e7c2c21b-0010-4351-9bad-27e84ef7bddd">The third Palette Color Lookup Table Descriptor value specifies the number of bits for each entry in the Lookup Table Data. It shall take the value of 8 or 16. The LUT Data shall be stored in a format equivalent to 8 bits allocated when the number of bits for each entry is 8, and 16 bits allocated when the number of bits for each entry is 16, where in both cases the high bit is equal to bits allocated-1. The third value shall be identical for each of the Red, Green and Blue Palette Color Lookup Table Descriptors.</para>
            <note>
                <para xml:id="para_bdc8c43c-0691-4969-8213-402311653ba7">Some implementations have encoded 8 bit entries with 16 bits allocated, padding the high bits; this can be detected by comparing the number of entries specified in the LUT Descriptor with the actual value length of the LUT Data entry. The value length in bytes should equal the number of entries if bits allocated is 8<emphasis role="bold"><emphasis role="underline"> (accounting for the need for an additional single padding byte to even length if the number of entries is odd)</emphasis></emphasis>, and be twice as long if bits allocated is 16.</para>
            </note>
            <para xml:id="para_eb14e4e9-2ca8-43b6-9296-3d3c1479a1a5">When the Red, Green, or Blue Palette Color Lookup Table Descriptor (0028,1101-1103) are used as part of the <xref linkend="sect_C.7.9" xrefstyle="select: title"/> or the <xref linkend="sect_C.7.6.19" xrefstyle="select: title"/> in an Image or Presentation State IOD, the third value shall be equal to 16. When the Alpha Palette Color Lookup Table Descriptor (0028,1104) is used, the third value shall be equal to 8.</para>
            <para xml:id="para_a614c81f-e874-4f62-a0e2-916d3c153311">When the Red, Green, or Blue Palette Color Lookup Table Descriptor (0028,1101-1103) are used as part of the <xref linkend="sect_C.7.9" xrefstyle="select: title"/> in a <xref linkend="sect_A.58" xrefstyle="select: title"/>, the 3rd value of Palette Color Lookup Table Descriptor (0028,1101-1103) (i.e, the number of bits for each entry in the Lookup Table Data) shall be 8.</para>
            <para xml:id="para_b5fa854d-da59-4c81-9c32-ece1f401f0b3">When the Red, Green, or Blue Palette Color Lookup Table Descriptor (0028,1101-1103) are used as part of the <xref linkend="sect_C.7.9" xrefstyle="select: title"/> in the Segmentation IOD, the 3rd value of Palette Color Lookup Table Descriptor (0028,1101-1103) (i.e, the number of bits for each entry in the Lookup Table Data) shall be 8 or 16.</para>
            <note>
                <orderedlist numeration="arabic">
                    <listitem>
                        <para xml:id="para_a4e67be1-02b6-48b4-89e3-70bb105d7ab1">A value of 16 indicates the Lookup Table Data will range from (0,0,0) minimum intensity to (65535,65535,65535) maximum intensity.</para>
                    </listitem>
                    <listitem>
                        <para xml:id="para_8f3a1178-e335-4395-bed6-64a6f5811da2">Since the Palette Color Lookup Table Descriptor (0028,1101-1104) Attributes are multi-valued, in an Explicit VR Transfer Syntax, only one value representation (US or SS) may be specified, even though the first and third values are always by definition interpreted as unsigned. The explicit VR actually used is dictated by the VR needed to represent the second value, which will be consistent with Pixel Representation (0028,0103).</para>
                    </listitem>
                </orderedlist>
            </note>
        </section>
        <section label="C.7.6.3.1.6" status="6" xml:id="sect_C.7.6.3.1.6">
            <title>Palette Color Lookup Table Data</title>
            <para xml:id="para_ec954e64-50ac-4f38-9fc9-0c4eac04286e">Palette Color Lookup Table Data (0028,1201-1204) contain the lookup table data corresponding to the Lookup Table Descriptor (0028,1101-1104).</para>
            <para xml:id="para_69dc3373-aa60-41ae-896c-9a6e617bbb78">Palette color values must always be scaled across the full range of available intensities. This is indicated by the fact that there are no bits stored and high bit values for palette color data.</para>
            <note>
                <para xml:id="para_28bc4966-d994-4aef-b310-465729e8dc24">For example, if there are 16 bits per entry specified and only 8 bits of value are truly used then the 8 bit intensities from 0 to 255 must be scaled to the corresponding 16 bit intensities from 0 to 65535. To do this for 8 bit values, simply replicate the value in both the most and least significant bytes.</para>
            </note>
            <para xml:id="para_943fc0e4-4e10-4aaf-a387-29f7cdd08070">These lookup tables shall be used only when there is a single sample per pixel (single image plane) in the image.</para>
        </section>
        
</chapter>
</book>
