gpt4 book ai didi

c# - 与 fo-dicom 的存储 promise

转载 作者:行者123 更新时间:2023-11-30 16:45:22 25 4
gpt4 key购买 nike

我正在尝试使用 FO-DICOM 框架实现存储 promise ,但没有结果。我能够创建 N-ACTION 请求。我能够收到 N-ACTION 响应。但是我不知道如何接收EVENTREPORT。任何人都可以帮助我并以正确的方式称呼我?

private DicomStatus _responseStatus;

public void SendRequestForCommitment(string scImageUid)
{
var client = new DicomClient();

var nAction = new DicomNActionRequest(DicomUID.StorageCommitmentPushModelSOPClass,
new UIDGenerator().PrivatelyDefinedSoapInstanceUid(), 1);

var ds = new DicomDataset();
nAction.Dataset = ds;
nAction.Dataset.Add(DicomTag.TransactionUID, new UIDGenerator().uid);

var sps = new DicomDataset();
nAction.Dataset.Add(new DicomSequence(DicomTag.ReferencedSOPSequence, sps));

sps.Add(DicomTag.ReferencedSOPClassUID, DicomUID.SecondaryCaptureImageStorage);
sps.Add(DicomTag.ReferencedSOPInstanceUID, scImageUid);

DicomNActionRequest.ResponseDelegate nActionResponseDelegate = NActionResponse;
nAction.OnResponseReceived = nActionResponseDelegate;

client.AddRequest(nAction);
client.Send("127.0.0.1", 105, false, "myAE", "DVTK_STRC_SCP");


}

private void NActionResponse(DicomNActionRequest request, DicomNActionResponse response)
{
_responseStatus = response.Status;
}

最佳答案

Disclaimer: I never used FO-DICOM. The code below is just a pseudo code and is NOT FO-DICOM syntax. I hope looking at pseudo code, you will able to figure out exact members (properties, methods, and events) in toolkit.

在您的代码中,您已经在构建请求数据集。然后,您调用 client.AddRequest(nAction);,然后调用 client.Send(......);。我假设这将在内部建立连接、关联并发送 NAction 请求。

那么你已经订阅了 private void NActionResponse(....) 事件。我假设此事件已被触发并且您正在收到 NAction 响应。

同样,您应该订阅 NEventReport 事件(在工具包中查找确切的语法),如下所示:

private void NEventReportReceived(DicomNEventReport request, ......)
{
//Parse the request here.
//Check what files were archived and what were failed.
//Do your stuff accordingly.
//Send NEventReport response conveying the status.

client.SendReleaseRequest();
}

订阅另一个事件来处理释放响应。

private void ReleaseResponseReceived(......)
{
//Close connection
}

正如我在 other 中所说的那样回答,你的SCU应该有处理NEventReport的能力。您已通过编写 client.AddRequest(nAction); 行将 NAction 添加到您的客户端。检查工具包文档,看看您是否还需要为 NEventReport 添加类似的。我强烈认为不需要这样做;你只需要订阅一个事件。

关于c# - 与 fo-dicom 的存储 promise ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42285941/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com