首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法使用fodicom从PACS保存DICOM

无法使用fodicom从PACS保存DICOM
EN

Stack Overflow用户
提问于 2021-10-12 20:00:13
回答 1查看 84关注 0票数 1

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

FoDicom Samples

代码永远不会命中SaveImage方法。我正在向www.dicomserver.co.uk查询示例图像……我对此还很陌生,不知所措。我遗漏了什么?

代码语言:javascript
复制
            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();
EN

回答 1

Stack Overflow用户

发布于 2021-10-14 18:48:45

我禁用了所需的部分代码。我添加了我需要的代码,它开始...//客户端必须接受图像的存储....

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69546368

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档