我正在尝试使用pixelMed库读取DICOM标头。这是代码片段。
try {
DicomInputStream dis = new DicomInputStream
(new ByteArrayInputStream(dicomHeaderBytes));
AttributeList attributeList = new AttributeList();
attributeList.setDecompressPixelData(false);
attributeList.read(dis);
attributeList.removeUnsafePrivateAttributes();
/* Iterating over attribute List */
for(Map.Entry<AttributeTag,Attribute> entry : attributeList.entrySet()){
AttributeTag key = entry.getKey();
Attribute value = entry.getValue();
String vr = value.getVRAsString();
String description = "";
}
} catch (Exception e) {
Log.error("Exception occurred", e);
}
如何阅读dicom标签的描述。
例如:对于标签:0008,0020,描述应为“学习日期”。
最佳答案
使用pixelMed中的'DicomDictionary'类,我能够通过传递AttributeTag来检索标签说明。
String tagDescription = dicomDictionary.getFullNameFromTag(new AttributeTag(int, int));