C.7.9 Palette Color Lookup Table Module

Table C.7-22 specifies the Attributes that describe the Lookup table data for images with Palette Color photometric interpretation.

When the Palette Color Lookup Table Module is present in an Image IOD, the conditional requirements for the use of Palette Color Lookup Table Data (0028,1201-1203) and Segmented Palette Color Lookup Table Data (0028,1221-1223), described in Table C.7.9, shall take precedence over the conditional requirements described in the Image Pixel Module (See Section C.7.6.3). When the Palette Color Lookup Table Module is present in a Presentation State IOD or Color Palette IOD, the Palette Color Lookup Table Data (0028,1201-1203) attributes are mandatory and the Segmented Palette Color Lookup Table Data (0028,1221-1223) shall not be present.

When the Palette Color Lookup Table Module is present in a Color Palette 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.

Table C.7-22 PALETTE COLOR LOOKUP MODULE

Attribute Name Tag Type Attribute Description
Include ‘Palette Color Lookup Macro’ Table C.7-22a

Table C.7-22a PALETTE COLOR LOOKUP MACRO

Attribute Name Tag Type Attribute Description
Red Palette Color Lookup Table Descriptor (0028,1101) 1 Specifies the format of the Red Palette Color Lookup Table Data (0028,1201). See C.7.6.3.1.5 for further explanation.
Green Palette Color Lookup Table Descriptor (0028,1102) 1 Specifies the format of the Green Palette Color Lookup Table Data (0028,1202). See C.7.6.3.1.5 for further explanation.
Blue Palette Color Lookup Table Descriptor (0028,1103) 1 Specifies the format of the Blue Palette Color Lookup table Data (0028,1203). See C.7.6.3.1.5 for further explanation.
Palette Color Lookup Table UID (0028,1199) 3 Palette Color Lookup Table UID. See C.7.9.1 for further explanation.
Red Palette Color Lookup Table Data (0028,1201) 1C Red Palette Color Lookup Table Data. Required if segmented data is NOT used in an Image IOD, or if the IOD is a Presentation State IOD or Color Palette IOD. See C.7.6.3.1.6 for further explanation.
Green Palette Color Lookup Table Data (0028,1202) 1C Green Palette Color Lookup Table Data. Required if segmented data is NOT used in an Image IOD, or if the IOD is a Presentation State IOD or Color Palette IOD. See C.7.6.3.1.6 for further explanation.
Blue Palette Color Lookup Table Data (0028,1203) 1C Blue Palette Color Lookup Table Data. Required if segmented data is NOT used in an Image IOD, or if the IOD is a Presentation State IOD or Color Palette IOD. See C.7.6.3.1.6 for further explanation.
Segmented Red Palette Color Lookup Table Data (0028,1221) 1C Segmented Red Palette Color Lookup Table Data. Required if segmented data is used in an Image IOD; shall not be present in a Presentation State IOD or Color Palette IOD. See C.7.9.2 for further explanation.
Segmented Green Palette Color Lookup Table Data (0028,1222) 1C Segmented Green Palette Color Lookup Table Data. Required if segmented data is used in an Image IOD; shall not be present in a Presentation State IOD. or Color Palette IOD See C.7.9.2 for further explanation.
Segmented Blue Palette Color Lookup Table Data (0028,1223) 1C Segmented Blue Palette Color Lookup Table Data. Required if segmented data is used in an Image IOD; shall not be present in a Presentation State IOD or Color Palette IOD. See C.7.9.2 for further explanation.

C.7.9.1 Palette Color Lookup Table UID

This data element uniquely identifies a palette color lookup table set (red, green, blue).

Note: This can be used to avoid reloading a palette if a system already has that palette loaded without examining all the data entries in the palette.

If this Attribute is present in a Color Palette IOD, it shall have the same value as the SOP Instance UID.

C.7.9.2 Segmented Palette Color Lookup Table Data

The Segmented Palette Color Lookup Table Data (0028,1221-1223) is stored as a series of segments, see Table C.7-23. When the segments are expanded into the actual lookup table data, it shall have the number of table entries specified by the first value of the Palette Color Lookup Table Descriptors (0028,1101-1103), Number of Table Entries.

These lookup tables shall be used only when segmented lookup table data use is desriable and there is a single sample per pixel (single image plane) in the image.

Table C.7-23COMPRESSED PALETTE COLOR LOOKUP TABLE DATA

Segment 0
Segment 1
...
Segment n

There are currently three types of segments: discrete, linear, and indirect. The segments type is identified by the opcodes in Table C.7-24:

Table C.7-24SEGMENT TYPES

Opcode Segment type
0 Discrete
1 Linear
2 Indirect
3 & above reserved

C.7.9.2.1 Discrete Segment Type

The discrete segment is used to represent a series of palette components which are not monotonic with respect to their predecessors or successors. The SegmentLength indicates the number of lookup table entries.

The format of the Discrete Segment Type shall be as in Table C.7-25:

Table C.7-25DISCRETE SEGMENT TYPE

Segment Opcode = 0
Segment Length
Segment Length number of lookup table entries

C.7.9.2.2 Linear Segment Type

The linear segment represents a series of palette components whose values may be represented by a straight line.

X = palette address, Y = Value contained in the palette.

(Xo, Yo) = end of the previous segment

(Xo + SegmentLength, Y1) = end of this linear segment

Where: Y1 is contained in the data portion of this segment.

During expansion, the application should “connect” the previous segment’s endpoint, (Xo, Yo), with this segment’s endpoint, (Xo + SegmentLength, Y1) using a straight line, by computing the values for each point between the endpoints.

Note: Because the linear segment uses the end point from the previous segment, a linear segment can not be the first segment.

The linear segment’s format shall be as as in Table C.7-26:

Table C.7-26LINEAR SEGMENT TYPE

Segment Opcode = 1
SegmentLength
Y1

C.7.9.2.3 Indirect Segment Type

The indirect segment allows the re-use of repetitive regions within lookup table without respecifying the segment. The opcode is followed by the number of segments to copy and one offset pointer to the first segment to copy. The byte offset is relative to the beginning of the lookup table. For example, if an indirect segment wants to point to the first segment, then the offset will be zero. The offset is a 32 bit value but is stored in the segment as a least significant 16 bit value followed by a most significant 16 bit value. An indirect segment shall not point to or copy another indirect segment. This avoids the need for recursion and also avoids the possibility of infinite loops.

The indirect segment’s format shall be as follows:

Table C.7-27INDIRECT SEGMENT TYPE

Segment Opcode = 2
Number of segments to copy
Least significant 16 bits of byte offset to first segment to copy
Most significant 16 bits of byte offset to first segment to copy