微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

当关联突然中止时取回 StudyInstanceUID

如何解决当关联突然中止时取回 StudyInstanceUID

我正在编写一个示例 DICOM SCP 商店。我使用 SCU Store 命令模拟了许多 DCM 文件夹的传输(从另一台连接到我的 LAN 的计算机)。同时模拟 3 次传输。由于未知原因,其中一项传输中止。我试图追踪中止的关联以取回相关的 StudyInstanceUID。这是我的 SCP :

public static long computeMultipleSumsBit(int n) {
    BitSet b= new BitSet();
    int[] factors = {3,5,7};
    for (int f : factors) {
        for (int i = 1; i < (n+(f-1))/f; i++) {
            b.set(f*i); // set the ith position of f
        }
    }
    return b.stream().mapToLong(a->a).sum();
}

我在association.py中找到了相关消息,但有机会获得中止的dataset.StudyInstanceUID:

from pynetdicom import AE,debug_logger,AllStoragePresentationContexts,evt

debug_logger()

def handle_store(event):
    """Handle EVT_C_STORE events."""
    ds = event.dataset
    ds.file_Meta = event.file_Meta

    return 0x0000

handlers = [(evt.EVT_C_STORE,handle_store)]

ae = AE()
# Unlimited PDU size
ae.maximum_pdu_size = 0
#ae.add_supported_context
ae.supported_contexts = AllStoragePresentationContexts
ae.start_server(('',11112),block=True,evt_handlers=handlers)

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。