简体   繁体   中英

DICOM Header parsing using pixelMed

Am trying to read DICOM Header using pixelMed Library. Here's the code snippet.

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);
}

How to read the description of dicom tags. Ex: For tag: 0008,0020, the description should be "Study Date".

使用 pixelMed 的“DicomDictionary”类,我能够通过传递 AttributeTag 来检索标签描述。

String tagDescription = dicomDictionary.getFullNameFromTag(new AttributeTag(int, int));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM