<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Hi Konrad,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">the binary values in meta-data dictionary are encoded using base64 scheme. Once you fetch them from the dictionary, you should decode them. <a href="https://stackoverflow.com/questions/43328520/base64-decoding-in-itk-4-7-for-dicom">Here</a> is a similar question.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Regards,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Dženan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 5, 2018 at 6:34 AM, Konrad Werys <span dir="ltr"><<a href="mailto:konradwerys@gmail.com" target="_blank">konradwerys@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span style="font-size:12.8px">Hi,</span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I need help in getting the Palette Color Lookup Table Data from dicom using ITK and preferably GDCM.</div><div style="font-size:12.8px"><br>I want an array of values of PaletteColorLookupTableData from dicom (tags 0028,1201 0028,1202 0028,1203 for red, green, blue, see <a href="http://dicom.nema.org/medical/dicom/2016a/output/chtml/part03/sect_C.7.9.html" target="_blank">http://dicom.nema.org/<wbr>medical/dicom/2016a/output/<wbr>chtml/part03/sect_C.7.9.html</a>). 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 (<a href="http://dicom.nema.org/medical/dicom/2016a/output/chtml/part03/sect_C.7.6.3.html#sect_C.7.6.3.1.5" target="_blank">http://dicom.nema.org/medical<wbr>/dicom/2016a/output/chtml/<wbr>part03/sect_C.7.6.3.html#sect_<wbr>C.7.6.3.1.5</a>).</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">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.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I am reading Red Palette Color Lookup Table Data 0028,1201 as in the itk example <a href="https://itk.org/Doxygen/html/Examples_2IO_2DicomImageReadPrintTags_8cxx-example.html" target="_blank">https://itk.org/Doxyge<wbr>n/html/Examples_2IO_2DicomImag<wbr>eReadPrintTags_8cxx-example.<wbr>html</a></div><div style="font-size:12.8px">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.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">How can I get a nice array of values from Palette Color Lookup Table Data?<br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">All help will be appreciated.</div><div style="font-size:12.8px">Kind regards,</div><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><div class="m_-4549636968997332427gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Konrad Werys<div><div><a href="http://mrkonrad.github.io/MRKonrad/" target="_blank">http://mrkonrad.github.io</a><br></div></div></div></div></div></div></div></div>
</font></span></div>
<br>The ITK community is transitioning from this mailing list to <a href="http://discourse.itk.org" rel="noreferrer" target="_blank">discourse.itk.org</a>. Please join us there!<br>
______________________________<wbr>__________<br>
Community mailing list<br>
<a href="mailto:Community@itk.org">Community@itk.org</a><br>
<a href="https://itk.org/mailman/listinfo/community" rel="noreferrer" target="_blank">https://itk.org/mailman/<wbr>listinfo/community</a><br>
<br></blockquote></div><br></div>