我如何在正在创建的服务器上设置AE标题?

问题描述 投票:0回答:1

我正在制作一个非常简单的STORE服务器,除了回声和接收数据外,它不打算做任何类似DICOM的事情。我继承自DicomCEchoProvider并让父类为我完成大部分工作:到目前为止,仅有计划使用的唯一方法是DicomCStoreResponse()接口中的OnCStoreRequestException()IDicomCStoreProvider

我的测试机似乎根本不关心AET,但是我不能认为其他所有机器都那么适应。如何将AE标题设置为我选择的内容?

c# uwp fo-dicom
1个回答
0
投票

服务器(SCP)不发送AETitle。相反,SCU通过关联请求(在握手时)发送主叫AET和被叫AET。 SCP的工作是检查此数据,然后接受或拒绝关联。如果您未明确编写代码,则默认情况下,SCP会接受每个关联。

看看示例项目(https://github.com/fo-dicom/fo-dicom-samples/blob/master/Desktop/C-Store%20SCP/Program.cs)。您必须创建一个继承自DicomService的类,并且在方法OnReceiveAssociationRequestAsync中您必须编写类似的代码:

        public Task OnReceiveAssociationRequestAsync(DicomAssociation association)
        {
            // here you can check for the AETitle. You can also handle various AETitles and implement different behaviour depending on the AETitle (thats common in real PACS systems), like storing the files on different drives depending on the called AETitle...
            if (association.CalledAE != "STORESCP")
            {
                return SendAssociationRejectAsync(
                    DicomRejectResult.Permanent,
                    DicomRejectSource.ServiceUser,
                    DicomRejectReason.CalledAENotRecognized);
            }

            foreach (var pc in association.PresentationContexts)
            {
                if (pc.AbstractSyntax == DicomUID.Verification) pc.AcceptTransferSyntaxes(AcceptedTransferSyntaxes);
                else if (pc.AbstractSyntax.StorageCategory != DicomStorageCategory.None) pc.AcceptTransferSyntaxes(AcceptedImageTransferSyntaxes);
            }

            return SendAssociationAcceptAsync(association);
        }
© www.soinside.com 2019 - 2024. All rights reserved.