[ITK] Color lookup table from dicom metadata

Dženan Zukić dzenanz at gmail.com
Fri Jan 5 09:56:45 EST 2018


Hi Konrad,

the binary values in meta-data dictionary are encoded using base64 scheme.
Once you fetch them from the dictionary, you should decode them. Here
<https://stackoverflow.com/questions/43328520/base64-decoding-in-itk-4-7-for-dicom>
is a similar question.

Regards,
Dženan

On Fri, Jan 5, 2018 at 6:34 AM, Konrad Werys <konradwerys at gmail.com> wrote:

> 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_2DicomImag
> eReadPrintTags_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/>
>
> The ITK community is transitioning from this mailing list to
> discourse.itk.org. Please join us there!
> ________________________________________
> Community mailing list
> Community at itk.org
> https://itk.org/mailman/listinfo/community
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://itk.org/pipermail/community/attachments/20180105/d15e6ab3/attachment.html>


More information about the Community mailing list