[ITK] Color lookup table from dicom metadata

Konrad Werys konradwerys at gmail.com
Fri Jan 5 06:34:09 EST 2018


Hi,

I need help in getting the Palette Color Lookup Table Data from dicom using
ITK and preferably GDCM.

I want an array of values of PaletteColorLookupTableData from dicom (tags
0028,1201 0028,1202 0028,1203 for red, green, blue, see
http://dicom.nema.org/medical/dicom/2016a/output/chtml/
part03/sect_C.7.9.html). The fields are OW type and are described by
Palette Color Lookup Table Descriptor (tags 0028,1101 0028,1102 0028,1103
 for red, green, blue) each with 3 pieces of information: how many entries
are in the field/what is the first value mapped/how many bits per entry (
http://dicom.nema.org/medical/dicom/2016a/output/chtml/part03/sect_C.7.6.3.
html#sect_C.7.6.3.1.5).

In dicom files I am working with, Red Palette Color Lookup Table
Descriptor 0028,1101 field equals to 4096/0/16, I can also correctly read
the Red Palette Color Lookup Table Data 0028,1201 in matlab and it has 4096
entries.

I am reading Red Palette Color Lookup Table Data 0028,1201 as in the itk
example https://itk.org/Doxygen/html/Examples_2IO_
2DicomImageReadPrintTags_8cxx-example.html
The length of the result string is 10924. The only explanation of this
length that I can think of is that the dicom field is of OW type (just like
pixel data), and the BitsAllocated 0028,0100 field is 16
and BitsStored 0028,0101 is 12. So 10924*12/16 = 8193 which is close to the
number of bytes I would expect. But when I try to decode the values this
way I am getting completely different numbers than the numbers from matlab.

How can I get a nice array of values from Palette Color Lookup Table Data?

All help will be appreciated.
Kind regards,

-- 
Konrad Werys
http://mrkonrad.github.io <http://mrkonrad.github.io/MRKonrad/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://itk.org/pipermail/community/attachments/20180105/dbab7fbc/attachment.html>


More information about the Community mailing list