【问题标题】:Unable to save DICOM from PACS using fodicom无法使用 fodicom 从 PACS 保存 DICOM
【发布时间】:2021-10-12 20:00:13
【问题描述】:

我正在使用 FoDicom 示例解决方案中的 QueryRetrieve SCU 项目...

FoDicom Samples

代码从不点击 SaveImage 方法。我正在查询www.dicomserver.co.uk 以获取示例图像...我对此很陌生并且不知所措。我错过了什么?

            var client = DicomClientFactory.Create(_qrServerHost, _qrServerPort, false, _aet, _qrServerAET);
        client.NegotiateAsyncOps();

        // Find a list of Studies

        var request = CreateStudyRequestByPatientName("Cooper");

        var studyUids = new List<string>();
        request.OnResponseReceived += (req, response) =>
        {
            studyUids.Add(response.Dataset?.GetSingleValue<string>(DicomTag.StudyInstanceUID));
        };
        await client.AddRequestAsync(request);
        await client.SendAsync();

        // find all series from a study that previous was returned
        var studyUID = studyUids[0];
        request = CreateSeriesRequestByStudyUID(studyUID);

        var serieUids = new List<string>();
        request.OnResponseReceived += (req, response) =>
        {
            serieUids.Add(response.Dataset?.GetSingleValue<string>(DicomTag.SeriesInstanceUID));
        };
        await client.AddRequestAsync(request);
        await client.SendAsync();

        // now get all the images of a serie with cGet in the same association

        client = DicomClientFactory.Create(_qrServerHost, _qrServerPort, false, _aet, _qrServerAET);

        var cGetRequest = CreateCGetBySeriesUID(studyUID, serieUids.First());
        client.OnCStoreRequest += (DicomCStoreRequest req) =>
        {
            Console.WriteLine(DateTime.Now.ToString() + " recived");
            SaveImage(req.Dataset);
            return Task.FromResult(new DicomCStoreResponse(req, DicomStatus.Success));
        };

        // the client has to accept storage of the images. We know that the requested images are of SOP class Secondary capture, 
        // so we add the Secondary capture to the additional presentation context
        // a more general approach would be to mace a cfind-request on image level and to read a list of distinct SOP classes of all
        // the images. these SOP classes shall be added here.
        var pcs = DicomPresentationContext.GetScpRolePresentationContextsFromStorageUids(
            DicomStorageCategory.Image,
            DicomTransferSyntax.ExplicitVRLittleEndian,
            DicomTransferSyntax.ImplicitVRLittleEndian,
            DicomTransferSyntax.ImplicitVRBigEndian);
        client.AdditionalPresentationContexts.AddRange(pcs);
        await client.AddRequestAsync(cGetRequest);
        await client.SendAsync();

【问题讨论】:

  • 您何时执行此示例? Dicomserver 在此站点上提供服务器日志:dicomserver.co.uk/logs。我正在那里查找带有 Patient "Cooper" 查询的日志,但没有找到。代码看起来不错,所以我需要一些日志来帮助你
  • 我刚刚在东部标准时间 2021 年 10 月 13 日上午 830 点运行它。日志的链接如下。 dicomserver.co.uk/logs/D.O.Net.20211013.130000.80014.0.log我的ae头衔是DICOMSAMURAI
  • 我可以通过患者姓名查看 cfind 请求,然后可以通过 studyinstanceuid 查看系列的 cfind 请求。但随后没有进行进一步的连接。你的完整代码是什么样的?在客户端上添加事件处理程序后将其切断。您是否将 cGetRequest 添加到客户端并调用 client.SendAsync() ?你添加了额外的演示状态吗?
  • 顺便说一句:示例中的代码只是为了演示它是如何工作的。通常您会通过 Patientname 调用关于研究的 cFind,然后立即通过 studyinstanceuid 调用 cGet 以接收整个研究,而不是首先调用 cFind 以获取系列信息
  • 是的,我很愚蠢。我禁用了我需要的部分代码。我添加了我需要它开始的一段代码......//客户端必须接受图像的存储......感谢您的帮助!

标签: c# fo-dicom


【解决方案1】:

我禁用了我需要的部分代码。我添加了一段我需要它启动的代码... // 客户端必须接受图像的存储...

【讨论】:

  • 请让您的答案更加清晰和翔实。这将对社区有很大帮助。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-07-01
相关资源
最近更新 更多