LUT Encoding Dave Heaney A L I Technologies

  • Slides: 23
Download presentation
LUT Encoding Dave Heaney A. L. I. Technologies, Inc. 12/1/2020 1

LUT Encoding Dave Heaney A. L. I. Technologies, Inc. 12/1/2020 1

Image Module US Image Module Modality LUT Module VOI LUT Presentation LUT 12/1/2020 2

Image Module US Image Module Modality LUT Module VOI LUT Presentation LUT 12/1/2020 2

Palette Color Table w. As used for 8 and 16 bit Color Images w.

Palette Color Table w. As used for 8 and 16 bit Color Images w. A highlight of significant points and commonly raised issues 12/1/2020 3

Requirements For Use w Image Pixel Module w Palette Color Lookup Table (For Ultrasound)

Requirements For Use w Image Pixel Module w Palette Color Lookup Table (For Ultrasound) 12/1/2020 4

Image Pixel Module 12/1/2020 5

Image Pixel Module 12/1/2020 5

Image Pixel Module (continued) 12/1/2020 6

Image Pixel Module (continued) 12/1/2020 6

Palette Color Data Encoding w. Depending on IOD, can be done using the Image

Palette Color Data Encoding w. Depending on IOD, can be done using the Image Pixel Module or the Palette Color Lookup Table Module. w. This presentation will discuss the Palette Color Lookup Table Module as it contains all the same Elements and thus both Modules are covered. 12/1/2020 7

Each Table (Red, Green, Blue) has a Lookup Table Descriptor with 3 Values 1.

Each Table (Red, Green, Blue) has a Lookup Table Descriptor with 3 Values 1. Number of Entries in Lookup Table (Note that if the number of table entries is equal to 2^16 then this shall be 0. A common error is to not handle this case). 2. First Stored Pixel Value Mapped (Specifies which pixel value is mapped to the first entry in the Lookup Table. Do not assume for example that value 100 maps to the 100 th or 101 entry, you must offset from this second entry) This value can be signed as it has the same VR as the Pixel Representation. 3. Specifies the number of bits for each entry in the Lookup Table Data (if the Palette Color Lookup Module is used, as for Ultrasound, then this must be 16). Note that the Lookup Table values must map across the full intensity range. There is no padding of the values so zero intensity must map to 0 and maximum intensity must map to 2^max bits - 1. A common error is to try and put 8 bit values into 16 bit table entries, padding the extra bits with 0. This is invalid and means that the decoder will not map across the full pixel intensity range. 12/1/2020 8

Two Types of Tables • Contiguous Data Tables (only type in Image Pixel Module)

Two Types of Tables • Contiguous Data Tables (only type in Image Pixel Module) • Segmented Data Tables as in the Palette Color Lookup Table Module 12/1/2020 9

Contiguous Data Tables • Each Image pixel value (7 FE 0, 0010) maps to

Contiguous Data Tables • Each Image pixel value (7 FE 0, 0010) maps to a value in each of the Red, Green, and Blue Palette Tables using the second descriptor entry value for the offset. • The Palette Color Table Entries are intensity values as explained earlier. There is no padding so, to use the full possible range of intensities, values must be scaled across the full range of possible values. Must values use the data representation indicated by the Pixel Representation? Supplement 33 proposes that all LUT output must be unsigned. This requires a formal change to Part 3 for clarification. (i. e. for 2’s complement Pixel Representation and an 8 bit LUT is the minimum output value -128 or 0? ). 12/1/2020 10

Contiguous Palette Table Example 1 (0028, 0002) Samples per Pixel: (0028, 0004) Photometric Interpretation:

Contiguous Palette Table Example 1 (0028, 0002) Samples per Pixel: (0028, 0004) Photometric Interpretation: (0028, 0100) Bits Allocated: (0028, 0101) Bits Stored: (0028, 0103) Pixel Representation: (0028, 1101) Red Palette Color Descriptor: 1 PALETTE COLOR 16 16 0000 H unsigned 256 entries 0 first value mapped 16 bits per entry (0028, 1102) Green Palette Color Descriptor: same as red (0028, 1103) Blue Palette Color Descriptor: same as red (7 FE 0, 0010) Pixel Data: 0000 H|0001 H|0000 H|0005 H|0002 H (0028, 1201) Red Palette: 0000 H|0101 H|0202 H|0303 H|0404 H|0505 H (0028, 1202) Green Palette: 0000 H|0101 H|0202 H|0303 H|0404 H|0505 H (0028, 1203) Blue Palette: 12/1/2020 0000 H|0101 H|0202 H|0303 H|0404 H|0505 H 11

Contiguous Palette Table Example 2 Non-Ultrasound Palette Color Image: Complex Example (0028, 0002) Samples

Contiguous Palette Table Example 2 Non-Ultrasound Palette Color Image: Complex Example (0028, 0002) Samples per Pixel: (0028, 0004) Photometric Interpretation: (0028, 0100) Bits Allocated: (0028, 0101) Bits Stored: (0028, 0103) Pixel Representation: (0028, 1101) Red Palette Color Descriptor: 1 PALETTE COLOR 16 16 0001 H signed 256 entries -100 first value mapped 8 bits per entry (0028, 1102) Green Palette Color Descriptor: same as red (0028, 1103) Blue Palette Color Descriptor: same as red (7 FE 0, 0010) Pixel Data: -103 | -100 | -99 | -98 | -96 | -97 | -96 (0028, 1201) Red Palette: FFFFH | FFFAH | FFF 5 H | FFF 0 H | FFEBH (0028, 1202) Green Palette: FFFFH | FFFFH 12/1/2020 (0028, 1203) Blue Palette: FFFFH | FFFFH BUT ARE OUTPUT VALUES UNSIGNED OR 2’S COMPLEMENT? 12

Segmented Palette Color Tables w. Data is stored in each Table as a series

Segmented Palette Color Tables w. Data is stored in each Table as a series of segments w. 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 respective Descriptor, Number of Table Entries w. Shall be used only when segmented lookup table data use is desirable and there is a single sample per pixel in the image When To Use? Segmented Palette Color Tables are useful if the Palette Color Data includes repeated blocks of values and/or blocks of values which are related linearly. By repeatedly referencing a single block of values rather than repeating the entire block and/or representing linearly related values by their mathematical relationship significant resource savings can be made. Segmented Palette Color Tables are a means of implementing non-lossy compression for Palette Color Data but is only possible with very specific data sets. Note that they may not be widely supported by viewing systems. 12/1/2020 13

Segmented Palette Color Tables Compresses Palette Color Lookup Table Data: Segment 0 | Segment

Segmented Palette Color Tables Compresses Palette Color Lookup Table Data: Segment 0 | Segment 1 | Segment 2 | Segment 3 | … | Segment N Currently there are 3 types of segments: discrete, linear, and indirect. The segments type is identified by opcodes. Segment Types: Opcode 0 1 2 3 & Above 12/1/2020 Segment Type Discrete Linear Indirect Reserved 14

Discrete Segment Type Used to represent a series of palette components which are not

Discrete Segment Type Used to represent a series of palette components which are not monotonic with respect to their predecessors or successors. i. e. Use this type of segment for data which is non-linear with respect to preceding or following values. These values cannot be compressed but can be repeated so if there are repeating non-linear blocks then make them into separate Discrete Segments. Discrete Segment Type Data Format 12/1/2020 15

Linear Segment Type The linear segment represents a series of palette components whose values

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. (X 0, Y 0) = end of the previous segment (X 0 + Segment. Length, Y 1) = end of this linear segment Where Y 1 is contained in the data portion of this segment. During expansion the application should “connect” the previous segment’s endpoint (X 0, Y 0) with this segment’s endpoint, (X 0 + Segment. Length, Y 1) 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. Linear Segment Type Data Format 12/1/2020 16

Indirect Segment Type The indirect segment allows the re-use of repetitive regions within the

Indirect Segment Type The indirect segment allows the re-use of repetitive regions within the 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, to avoid recursion and infinite loops. Indirect Segment Type Data Format 12/1/2020 17

Modality LUT The Modality LUT allows the manipulation of the image data in two

Modality LUT The Modality LUT allows the manipulation of the image data in two different manners. In both cases it is implied that the manipulation can only occur for grayscale data. 1. The data can be manipulated by the application of a single LUT. The LUT is similar to one used for Palette Color Data. The LUT has a descriptor (0028, 3002) with the same elements as for a color LUT: w. Number of Entries in Lookup Table. w. First Stored Pixel Value Mapped (Note: Has same VR as Pixel Representation). w. Specifies the number of bits for each entry in the Lookup Table Data (8 or 16). The LUT data itself (0028, 3006) has output values defined by the Modality LUT Type (0028, 3004). Currently the only defined type is OD, the number in the LUT represents thousands of optical density. 12/1/2020 18

Modality LUT (Cont. ) Optical density is always positive so a question arises as

Modality LUT (Cont. ) Optical density is always positive so a question arises as to whether this defined type indicates that the LUT values are unsigned regardless of the Pixel Representation? * * The issue of output type is an important one when one or more LUTs are applied to the original image data. It would be optimal if each LUT descriptor indicated the representation of the expected output values. Currently the Standard is ambiguous in regards to this issue. A proposal is to treat all output values as unsigned. Another possibility is to always conform to the Pixel Representation unless the conversion is clear based on the output Type (i. e. Hounsfeld Units are signed, Optical Density is unsigned). For now, I suggest to those encoding the data that they choose options to encode data unambiguously if possible. For example, 16 bit values may have to be used instead of just 8 bits because of this interpretation issue (the encoder wants output values which use the full 8 bit unsigned output range, 0 to 255, but Pixel Representation is 2’s complement. Thus 16 bits are allocated to unambiguously define the unsigned values 0 to 255. ). 12/1/2020 19

Modality LUT (Cont. ) A second type of data manipulation can be specified in

Modality LUT (Cont. ) A second type of data manipulation can be specified in the Modality LUT Module 2. The data can be manipulated by applying a linear LUT represented by two values, Slope and Intercept. Output Units = Slope * Image Value + Intercept These values can be signed or unsigned regardless of the specified Pixel Representation. Because the Rescale Types are not defined or enumerated care must be taken to ensure proper interpretation of the modified values and one must ensure that underflow or overflow does not occur due to a change in data representation. For CT image data Slope and Intercept are used to convert to Hounsfeld Units which are signed values. 12/1/2020 20

VOI LUT Another LUT module is the VOI LUT Module. This Module also allows

VOI LUT Another LUT module is the VOI LUT Module. This Module also allows the specification of how the data should be manipulated in 2 different manners. This manipulation must always occur after the application of the Modality LUT if one exists. 1. The data can be manipulated using a single LUT similar to the Modality LUT. This type of LUT contains a description element as specified for the other types of LUT. In addition, there is a LUT explanation but there are no defined or enumerated values. Again, the issue of output value type is raised. As the purpose of this LUT is to usually map a certain range of data to the viewable intensities I currently treat all output values as unsigned. This may cause compatibility issues however. 12/1/2020 21

VOI LUT 2. The data can be manipulated by applying a linear LUT represented

VOI LUT 2. The data can be manipulated by applying a linear LUT represented by two values, Window Center and Window Width. Window Center (0028, 1050) and Window Width (0028, 1051) specify a linear conversion of data values by specifying a visible ‘Window’ of values which are to be mapped to the range of intensities. All those values less than the minimum value in the Window are to be mapped to minimum intensity while all those greater than the maximum value in the Window are to be mapped to maximum intensity. The values in between are mapped linearly to the full available range of intensities. Window Center contains the pixel value that is the center of the Window and Window Width contains the width of the window. If multiple pairs are specified then they should be applied independently. 12/1/2020 22

Presentation LUT The objective of the Presentation LUT is to realize tailored image display.

Presentation LUT The objective of the Presentation LUT is to realize tailored image display. It is used to prepare image pixel data for devices that conform to the Grayscale Standard Display Function defined in PS 3. 14. The output of the Presentation LUT is Presentation Values (P-Values) which are approximately related to human perceptual responses. They are intended to facilitate common input for hardcopy and softcopy devices. This is the final LUT to be applied to the pixel data. The modality LUT being applied first if present, followed by the VOI LUT and finally the Presentation LUT. The data can be manipulated using a single LUT similar to the Modality LUT or a single Palette Color LUT. This type of LUT contains a description element containing the 3 values as specified for the other types of LUT. The values encoded in the LUT are always P-Values and thus the output data representation is always unsigned, regardless of Pixel Representation. A further element of this Module is the Presentation LUT Shape which indicates the type of input to the Presentation LUT: w IDENTITY = input is in P-Values, no further translation is required. w LIN OD = input is in linear optical density over the range of Min Density (2010, 0120) and Max Density (2010, 1030) - as from Modality LUT. 12/1/2020 23