Ejemplo n.º 1
0

DicomDictionary.update({

    0x00000000: ('UL', '1', "CommandGroupLength", ''),
    0x00000002: ('UI', '1', "Affected SOP class", ''),
    0x00000003: ('UI', '1', "RequestedSOPClassUID", ''),
    0x00000100: ('US', '1', "CommandField", ''),
    0x00000110: ('US', '1', "MessageID", ''),
    0x00000120: ('US', '1', "MessageIDBeingRespondedTo", ''),
    0x00000600: ('AE', '1', "MoveDestination", ''),
    0x00000700: ('US', '1', "Priority", ''),
    0x00000800: ('US', '1', "DataSetType", ''),
    0x00000900: ('US', '1', "Status", ''),
    0x00000901: ('AT', '1', "OffendingElement", ''),
    0x00000902: ('LO', '1', "ErrorComment", ''),
    0x00000903: ('US', '1', "ErrorID", ''),
    0x00001000: ('UI', '1', " AffectedSOPInstanceUID", ''),
    0x00001001: ('UI', '1', "RequestedSOPInstanceUID", ''),
    0x00001002: ('US', '1', "EventTypeID", ''),
    0x00001005: ('AT', '1', "AttributeIdentifierList", ''),
    0x00001008: ('US', '1', "ActionTypeID", ''),
    0x00001020: ('US', '1', "NumberOfRemainingSuboperations", ''),
    0x00001021: ('US', '1', "NumberOfCompletedSuboperations", ''),
    0x00001022: ('US', '1', "NumberOfFailedSuboperations", ''),
    0x00001023: ('US', '1', "NumberOfWarningSuboperations", ''),
    0x00001030: ('AE', '1', "MoveOriginatorApplicationEntityTitle", ''),
    0x00001031: ('US', '1', "MoveOriginatorMessageID", ''),

})

Ejemplo n.º 2
0
import bisect
import copy
import re
import time
import warnings

from dicom._dicom_dict import DicomDictionary
from dicom.datadict import dictionaryVR

with warnings.catch_warnings():
    warnings.filterwarnings('ignore', category=UserWarning)
    import dicom.filebase
    from dicom import read_file
    from dicom.dataset import Dataset, FileDataset

KNOWN_TAGS = set(DicomDictionary.keys())
DICOM_TAGS_MAP = {v[-1]: k for k, v in DicomDictionary.iteritems()}


def get_tag_value(ds, tag_a, tag_b, default=None):
    """
    获取dataset
    :param ds: Dataset 待获取对象dataset
    :param tag_a: int 第一级tag十六进制数
    :param tag_b: int 第二级tag十六进制数
    :param default: object 缺省返回
    :return: object
    """
    val = ds.get((tag_a, tag_b), default=default)
    if hasattr(val, 'value'):
        return val.value
Ejemplo n.º 3
0
from dicom._dicom_dict import DicomDictionary


sortkey =  sorted(DicomDictionary.keys())

for key in sortkey:
    s = '%08x'%(key)
    a,b,c,d,e = DicomDictionary[key]
    print s[:4],',',s[-4:],' ',e#,' ',c
    #DicomDictionary[key]