When reading mammography images there are several Dicom tags relevant to be able to display the image correctly as described in the dicom standard. These are stored in the VOILUTFunction
and VOILUTSequence
. The first is a low-level tag, and can be easily read, however, the second does not.
For instance, dcmdump
gives this for my file:
(base) ➜ pngs dcmdump mammogram.dcm | grep -i lut
(0028,1055) LO [linear LUT] # 10, 1 WindowCenterWidthExplanation
(0028,3010) SQ (Sequence with explicit length #=4) # 32974, 1 VOILUTSequence
(0028,3002) US 4096\0\12 # 6, 3 LUTDescriptor
(0028,3003) LO [Flavor3_35_280] # 14, 1 LUTExplanation
(0028,3006) US 0\6\6\6\6\6\6\6\6\7\7\7\7\7\7\7\7\7\7\7\7\7\7\7\7\7\7\7\7\7\7\7\7\7... # 8192,4096 LUTData
(0028,3002) US 4096\0\12 # 6, 3 LUTDescriptor
(0028,3003) LO [Flavor3_37_250] # 14, 1 LUTExplanation
(0028,3006) US 0\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\11\11\11\11\11\11\11... # 8192,4096 LUTData
(0028,3002) US 4096\0\12 # 6, 3 LUTDescriptor
(0028,3003) LO [Flavor3_37_230] # 14, 1 LUTExplanation
(0028,3006) US 0\11\11\11\11\11\11\11\11\11\12\12\12\12\12\12\12\12\12\12\12\12\12... # 8192,4096 LUTData
(0028,3002) US 4096\0\12 # 6, 3 LUTDescriptor
(0028,3003) LO [Flavor3_LUT1] # 12, 1 LUTExplanation
(0028,3006) US 0\17\17\17\17\17\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\19... # 8192,4096 LUTData
While with SimpleITK I get:
sitk_image.GetMetaData('0028|3010')
RuntimeError: Exception thrown in SimpleITK Image_GetMetaData: /Users/runner/runners/2.160.0/work/1/sitk-build/ITK/Modules/Core/Common/src/itkMetaDataDictionary.cxx:88:
itk::ERROR: Key '0028|3010' does not exist
Is there a way of doing this currently with SimpleITK or would it be better to use pydicom
for this? It would be a little bit unfortunate, as this would mean I need to read the header twice (and have another dependency).