`
qimo601
  • 浏览: 3445867 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
社区版块
存档分类
最新评论

DCMTK:Receiving Images from PACS using DCMSCU

阅读更多

 

通过DCMTK的DCMSCU,从PACS获取图像,看看人家咋回答的。


Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Receiving Images from PACS using DCMSCU
PostPosted: Fri, 2011-07-22, 09:35 
Offline

Joined: Wed, 2011-07-20, 11:48
Posts: 2
Hi beginner in DICOM here. I'm making a QT app to retrieve images from a PACS and view them. I've set up DCM4Chee on a virtual machine and loaded 1 sample dicom set (BRAINIX) on it. 

I used http://support.dcmtk.org/wiki/dcmtk/how ... cu-example to query and find the set. But am not sure how to retrieve the dataset. 

I subclassed DCMSCU's handleMOVEResponse and tried 

Code:
OFCondition MyDCMSCU::handleMOVEResponse(const T_ASC_PresentationContextID presContextID,MOVEResponse *response, OFBool &waitForNextResponse)
   {

      if(response->m_dataset){
   
         response->m_dataset->saveFile("test1.dcm") ;
       
      }
   
   returnDcmSCU::handleMOVEResponse(presContextID,response,waitForNextResponse);

   }

The test1.dcm only contains the text listing of the 22 images in the dataset without any data. 

The debug output is 

DEBUG - Configured a total of 3 presentation contexts for SCU 
DEBUG - Request Parameters: 
====================== BEGIN A-ASSOCIATE-RQ ===================== 
Our Implementation Class UID: 1.2.276.0.7230010.3.0.3.6.1 
Our Implementation Version Name: OFFIS_DCMTK_361 
Their Implementation Class UID: 
Their Implementation Version Name: 
Application Context Name: 1.2.840.10008.3.1.1.1 
Calling Application Name: TEST-PACS 
Called Application Name: DCM4CHEE 
Responding Application Name: resp. AP Title 
Our Max PDU Receive Size: 16384 
Their Max PDU Receive Size: 0 
Presentation Contexts: 
Context ID: 1 (Proposed) 
Abstract Syntax: =FINDStudyRootQueryRetrieveInformationModel 
Proposed SCP/SCU Role: Default 
Proposed Transfer Syntax(es): 
=LittleEndianImplicit 
Context ID: 3 (Proposed) 
Abstract Syntax: =MOVEStudyRootQueryRetrieveInformationModel 
Proposed SCP/SCU Role: Default 
Proposed Transfer Syntax(es): 
=LittleEndianImplicit 
Context ID: 5 (Proposed) 
Abstract Syntax: =VerificationSOPClass 
Proposed SCP/SCU Role: Default 
Proposed Transfer Syntax(es): 
=LittleEndianImplicit 
Requested Extended Negotiation: none 
Accepted Extended Negotiation: none 
Requested User Identity Negotiation: none 
User Identity Negotiation Response: none 
======================= END A-ASSOCIATE-RQ ====================== 
INFO - Requesting Association 
DEBUG - Constructing Associate RQ PDU 
DEBUG - PDU Type: Associate Accept, PDU Length: 231 + 6 bytes PDU header 
02 00 00 00 00 e7 00 01 00 00 44 43 4d 34 43 48 
45 45 20 20 20 20 20 20 20 20 54 45 53 54 2d 50 
41 43 53 20 20 20 20 20 20 20 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 10 00 00 15 31 2e 
32 2e 38 34 30 2e 31 30 30 30 38 2e 33 2e 31 2e 
31 2e 31 21 00 00 19 01 00 00 00 40 00 00 11 31 
2e 32 2e 38 34 30 2e 31 30 30 30 38 2e 31 2e 32 
21 00 00 19 03 00 00 00 40 00 00 11 31 2e 32 2e 
38 34 30 2e 31 30 30 30 38 2e 31 2e 32 21 00 00 
19 05 00 00 00 40 00 00 11 31 2e 32 2e 38 34 30 
2e 31 30 30 30 38 2e 31 2e 32 50 00 00 2f 51 00 
00 04 00 00 3f e0 52 00 00 11 31 2e 32 2e 34 30 
2e 30 2e 31 33 2e 31 2e 31 2e 31 55 00 00 0e 64 
63 6d 34 63 68 65 2d 31 2e 34 2e 33 30 
DEBUG - Parsing an A-ASSOCIATE PDU 
DEBUG - Association Parameters Negotiated: 
====================== BEGIN A-ASSOCIATE-AC ===================== 
Our Implementation Class UID: 1.2.276.0.7230010.3.0.3.6.1 
Our Implementation Version Name: OFFIS_DCMTK_361 
Their Implementation Class UID: 1.2.40.0.13.1.1.1 
Their Implementation Version Name: dcm4che-1.4.30 
Application Context Name: 1.2.840.10008.3.1.1.1 
Calling Application Name: TEST-PACS 
Called Application Name: DCM4CHEE 
Responding Application Name: DCM4CHEE 
Our Max PDU Receive Size: 16384 
Their Max PDU Receive Size: 16352 
Presentation Contexts: 
Context ID: 1 (Accepted) 
Abstract Syntax: =FINDStudyRootQueryRetrieveInformationModel 
Proposed SCP/SCU Role: Default 
Accepted SCP/SCU Role: Default 
Accepted Transfer Syntax: =LittleEndianImplicit 
Context ID: 3 (Accepted) 
Abstract Syntax: =MOVEStudyRootQueryRetrieveInformationModel 
Proposed SCP/SCU Role: Default 
Accepted SCP/SCU Role: Default 
Accepted Transfer Syntax: =LittleEndianImplicit 
Context ID: 5 (Accepted) 
Abstract Syntax: =VerificationSOPClass 
Proposed SCP/SCU Role: Default 
Accepted SCP/SCU Role: Default 
Accepted Transfer Syntax: =LittleEndianImplicit 
Requested Extended Negotiation: none 
Accepted Extended Negotiation: none 
Requested User Identity Negotiation: none 
User Identity Negotiation Response: none 
======================= END A-ASSOCIATE-AC ====================== 
INFO - Association Accepted (Max Send PDV: 16340) 
INFO - Send C-ECHO Request 
DEBUG - ===================== OUTGOING DIMSE MESSAGE ==================== 
Message Type : C-ECHO RQ 
Presentation Context ID : 5 
Message ID : 1 
Data Set : none 
======================= END DIMSE MESSAGE ======================= 
INFO - Received C-ECHO Response 
DEBUG - ===================== INCOMING DIMSE MESSAGE ====================
Message Type : C-ECHO RSP 
Presentation Context ID : 5 
Message ID Being Responded To : 1 
Affected SOP Class UID : VerificationSOPClass 
Data Set : none 
DIMSE Status : 0x0000: Success 
======================= END DIMSE MESSAGE ======================= 
INFO - Send C-FIND Request 
DEBUG - ===================== OUTGOING DIMSE MESSAGE ==================== 
Message Type : C-FIND RQ 
Presentation Context ID : 1 
Message ID : 2 
Affected SOP Class UID : FINDStudyRootQueryRetrieveInformationModel 
Data Set : present 
Priority : low 
======================= END DIMSE MESSAGE ======================= 
INFO - Received C-FIND Response 
DEBUG - ===================== INCOMING DIMSE MESSAGE ====================
Message Type : C-FIND RSP 
Presentation Context ID : 1 
Message ID Being Responded To : 2 
Affected SOP Class UID : FINDStudyRootQueryRetrieveInformationModel 
Data Set : present 
DIMSE Status : 0xff00: Pending 
======================= END DIMSE MESSAGE ======================= 
DEBUG - C-FIND response has status 0xff00 
DEBUG - Received dataset on presentation context 1 
DEBUG - Handling C-FIND Response 
DEBUG - One or more outstanding C-FIND responses 
INFO - Received C-FIND Response 
DEBUG - ===================== INCOMING DIMSE MESSAGE ====================
Message Type : C-FIND RSP 
Presentation Context ID : 1 
Message ID Being Responded To : 2 
Affected SOP Class UID : FINDStudyRootQueryRetrieveInformationModel 
Data Set : none 
DIMSE Status : 0x0000: Success 
======================= END DIMSE MESSAGE ======================= 
DEBUG - C-FIND response has status 0x0000 
DEBUG - Handling C-FIND Response 
DEBUG - Received final C-FIND response, no more C-FIND responses expected 
INFO - There are 2 studies available 
INFO - Send C-MOVE Request 
DEBUG - ===================== OUTGOING DIMSE MESSAGE ==================== 
Message Type : C-MOVE RQ 
Presentation Context ID : 3 
Message ID : 3 
Affected SOP Class UID : MOVEStudyRootQueryRetrieveInformationModel 
Data Set : present 
Priority : low 
Move Destination : TEST-PACS 
======================= END DIMSE MESSAGE ======================= 
INFO - Received C-MOVE Response 
DEBUG - ===================== INCOMING DIMSE MESSAGE ====================
Message Type : C-MOVE RSP 
Presentation Context ID : 3 
Message ID Being Responded To : 3 
Affected SOP Class UID : MOVEStudyRootQueryRetrieveInformationModel 
Remaining Suboperations : 22 
Completed Suboperations : 0 
Failed Suboperations : 0 
Warning Suboperations : 0 
Data Set : none 
DIMSE Status : 0xff00: Pending 
======================= END DIMSE MESSAGE ======================= 
DEBUG - C-MOVE response has status 0xff00 
DEBUG - Handling C-MOVE Response 
DEBUG - One or more outstanding C-CMOVE responses 
INFO - Received C-MOVE Response 
DEBUG - ===================== INCOMING DIMSE MESSAGE ====================
Message Type : C-MOVE RSP 
Presentation Context ID : 3 
Message ID Being Responded To : 3 
Affected SOP Class UID : MOVEStudyRootQueryRetrieveInformationModel 
Remaining Suboperations : 22 
Completed Suboperations : 0 
Failed Suboperations : 0 
Warning Suboperations : 0 
Data Set : none 
DIMSE Status : 0xff00: Pending 
======================= END DIMSE MESSAGE ======================= 
DEBUG - C-MOVE response has status 0xff00 
DEBUG - Handling C-MOVE Response 
DEBUG - One or more outstanding C-CMOVE responses 
INFO - Received C-MOVE Response 
DEBUG - ===================== INCOMING DIMSE MESSAGE ====================
Message Type : C-MOVE RSP 
Presentation Context ID : 3 
Message ID Being Responded To : 3 
Affected SOP Class UID : MOVEStudyRootQueryRetrieveInformationModel 
Remaining Suboperations : 22 
Completed Suboperations : 0 
Failed Suboperations : 0 
Warning Suboperations : 0 
Data Set : none 
DIMSE Status : 0xff00: Pending 
======================= END DIMSE MESSAGE ======================= 
DEBUG - C-MOVE response has status 0xff00 
DEBUG - Handling C-MOVE Response 
DEBUG - One or more outstanding C-CMOVE responses 
INFO - Received C-MOVE Response 
DEBUG - ===================== INCOMING DIMSE MESSAGE ====================
Message Type : C-MOVE RSP 
Presentation Context ID : 3 
Message ID Being Responded To : 3 
Affected SOP Class UID : MOVEStudyRootQueryRetrieveInformationModel 
Remaining Suboperations : 22 
Completed Suboperations : 0 
Failed Suboperations : 0 
Warning Suboperations : 0 
Data Set : none 
DIMSE Status : 0xff00: Pending 
======================= END DIMSE MESSAGE ======================= 
DEBUG - C-MOVE response has status 0xff00 
DEBUG - Handling C-MOVE Response 
DEBUG - One or more outstanding C-CMOVE responses 
INFO - Received C-MOVE Response 
DEBUG - ===================== INCOMING DIMSE MESSAGE ====================
Message Type : C-MOVE RSP 
Presentation Context ID : 3 
Message ID Being Responded To : 3 
Affected SOP Class UID : MOVEStudyRootQueryRetrieveInformationModel 
Remaining Suboperations : 22 
Completed Suboperations : 0 
Failed Suboperations : 0 
Warning Suboperations : 0 
Data Set : none 
DIMSE Status : 0xff00: Pending 
======================= END DIMSE MESSAGE ======================= 
DEBUG - C-MOVE response has status 0xff00 
DEBUG - Handling C-MOVE Response 
DEBUG - One or more outstanding C-CMOVE responses 
INFO - Received C-MOVE Response 
DEBUG - ===================== INCOMING DIMSE MESSAGE ====================
Message Type : C-MOVE RSP 
Presentation Context ID : 3 
Message ID Being Responded To : 3 
Affected SOP Class UID : MOVEStudyRootQueryRetrieveInformationModel 
Remaining Suboperations : none 
Completed Suboperations : 0 
Failed Suboperations : 22 
Warning Suboperations : 0 
Data Set : present 
DIMSE Status : 0xa702: Error: Refused - Out of resources - Suboperations 
======================= END DIMSE MESSAGE ======================= 
DEBUG - C-MOVE response has status 0xa702 
DEBUG - Received dataset on presentation context 3 
DEBUG - Handling C-MOVE Response 
WARN - Status is 0xa702 (unknown) 
WARN - Will not wait for further C-MOVE responses 
INFO - Received study # 1: 2.16.840.1.113669.632.20.1211.10000357775 
INFO - Releasing Association 
DEBUG - Cleaning up internal association and network structures 


Is the "0xa702: Error: Refused - Out of resources - Suboperations" due to the virtual machine being out of memory ? 
And if the error wasnt there would I be able to save the dataset in this way ?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri, 2011-07-22, 10:06 
Offline
OFFIS DICOM Team
OFFIS DICOM Team

Joined: Fri, 2004-11-05, 14:47
Posts: 1153
Location: Oldenburg, Germany
Hi, 

your code is OK, however it does not do what you expect it should do ;-) 

With C-MOVE you can only tell the PACS to send the data somewhere, to a place you tell the PACS by giving an AE title. This AE Title does not have to be a system that you control yourself, it can be any system on the network! In sendMOVERequest, this is the moveDestinationAETitle you specify. 

When a PACS receives this move request, it internally looks up (in the configuration) the ip adress and port of the system with the AE title you specified (thus, every receiver has to be configured on the PACS) and then opens up a _new_ association to that adress and port. On that second connection, the images are sent with C-STORE then. 

The suboperation error is the PACS reporting to you, that there is a problem on the second connection, i.e. it cannot successfully deliver the images on the second connection. 

This is I guess because you plan to receive the images yourself. As described above, the C-MOVE-Response does not contain the images itself but only short acknowledges that the PACS understood your request and is working (or not;)) on the second connection. These Acknowledgements are stored to a file in your overwritten handleMoveResponse() method. 

What you might want to do is starting your own receiver, for example storescp. Be sure to configure the host and port storescp is running with a specific AE title at the PACS so that the PACS knows where to send the images. 

Michael 

Edit: If you want to receive the images on the same connection, there is another message in DICOM called C-GET that you could use. However, this is (not yet!) implemented in DcmSCU. MOVE is also the more common protocol.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri, 2011-07-22, 16:41 
Offline

Joined: Wed, 2011-07-20, 11:48
Posts: 2
Ah ok thanks :), that worked. 

Just had to use a QProcess in the app to launch the storescp.exe before the call to scu.sendMOVERequest and the images got downloaded..


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Hi reno
PostPosted: Fri, 2011-08-12, 20:11 
Offline

Joined: Tue, 2011-06-28, 14:36
Posts: 28
Location: Chennai
Can you post the code here, which worked for you in downloading the images from PACS server.

_________________
with regards 
Manoj Kumar D
 

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon, 2011-08-15, 09:16 
Offline
OFFIS DICOM Team
OFFIS DICOM Team

Joined: Fri, 2004-11-05, 14:47
Posts: 1153
Location: Oldenburg, Germany
Hi, 

the code is completely in the DcmSCU example. The code tells the PACS to send (all) images to a storage server named by the MOVEAPPLICATIONTITLE constant. 

For receiving the images, you must start an additional storage server and have that configured at the PACS. As a storage server, you might use storescp. 

Michael


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat, 2012-03-31, 08:57 
Offline

Joined: Wed, 2012-01-04, 11:18
Posts: 38
If I fill MoveAETitle as the calling AETitle, then the images get download on the same client which is querying. Is it right? 
Also, how it gets downloaded?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon, 2012-04-02, 17:08 
Offline
OFFIS DICOM Team
OFFIS DICOM Team

Joined: Fri, 2004-11-05, 14:47
Posts: 1153
Location: Oldenburg, Germany
Hi, 

the AE title given as a Move destination must always be configured at the PACS with IP adress and port. From the calling AE title alone the PACS cannot know which port it should address. 

Best, 
Michael


Report this post
Top
 Profile  
Reply with quote  



分享到:
评论

相关推荐

    Dcmtk在PACS开发中的应用.zip

    标题"Dcmtk在PACS开发中的应用"暗示了本文档将深入探讨DCMTK(Digital Imaging and Communications in Medicine Toolkit)在Picture Archiving and Communication Systems(PACS)开发中的具体运用。PACS是一种用于...

    dcmtk在PACS开发中的应用 工作列表 测试文件

    在PACS(Picture Archiving and Communication System)系统开发中,DCMTK扮演着至关重要的角色,因为它提供了丰富的API和实用程序,帮助开发者处理DICOM数据的创建、解析、传输和存储。 工作列表(Worklist)是...

    DICOM图片示例 CT图片 dcmtk在PACS开发中的应用

    5. DICOM网络通信:在PACS开发中,DCMTK的网络功能(如dcmsnd)支持DICOM的C-FIND、C-MOVE和C-GET等服务类,允许在PACS的不同组件间查找、传输和获取图像。这使得医生可以从任何地方访问所需的影像资料,提高了工作...

    利用dcmtk实现C-FIND SCU

    专栏博文“DICOM:基于DCMTK实现C-FIND SCU”中对应的源代码。基于dcmtk开源库中的findscu工程,实现的简单的C-FIND SCU,用于示范如何使用dcmtk操作实现具体的DICOM应用。

    第一个 DCMTK 程序:显示 DICOM 图像(DCMTK 3.6.4 + Qt 5.14.2 + VS2015)源码

    这是博文《第一个 DCMTK 程序:显示 DICOM 图像(DCMTK 3.6.4 + Qt 5.14.2 + VS2015)》的源码,详细内容见博客文章 https://blog.csdn.net/blackwoodcliff/article/details/109481195

    nodejs-dcmtk:基于Nodsjs Alpine和DCMTK的Docker映像

    nodejs-dcmtk 基于Nodsjs Alpine和DCMTK的Docker映像

    dcmtk:“ DICOM”工具包(“ DCMTK”)的包装

    dcmtk dcmtk的目标是包装'DICOM'工具包('DCMTK') 。 移植了医学数字成像和通信('DICOM')工具包的功能集,这是一组处理成像数据的功能。 安装 您可以使用以下方法从安装dcmtk的发行版本: install.packages( ...

    dcmtk在PACS开发中的应用 工作列表dump文件

    dcmtk在PACS开发中的应用 工作列表dump文件

    Dcmtk3.5.5 (20090818)

    1. **DICOM网络通信**:DCMTK包含了PACS(Picture Archiving and Communication System)所需的网络协议实现,如TCP/IP上的DICOM传输服务,支持DICOM C-ECHO、C-FIND、C-MOVE和C-GET等基本操作。 2. **DICOM文件...

    dcmtk-install.zip

    接下来,我们看看如何在VS2017和Qt5环境中集成和使用DCMTK: 1. **环境配置**:安装CMake,创建一个新项目,设置VS2017作为生成器,指定Qt5和DCMTK的路径。 2. **添加依赖**:在CMakeLists.txt文件中链接DCMTK库,...

    DCMTK-已编译的dcmtk

    名称:DCMTK 评级:★★★★★ 开源许可:BSD 功能: 影像处理,影像归档,影像管理,影像传输 标准:DICOM 语言:英语 客户端: 桌面 平台:跨平台 编程语言:C/C++ 官方网站:http://dicom.offis.de/

    DCMTK3.6.4 64位 已编译的源码

    - **数据交换**:利用DCMTK实现PACS与各种医疗设备(如CT、MRI扫描仪)之间的数据交换。 - **存储服务**:构建接收和存储DICOM图像的服务器端,可以基于DCMTK的存储服务类实现。 - **查询/检索服务**:通过DCMTK的Q/...

    dicom.rar_dcmtk_dcmtk3.6_dcmtk3.6.0_dicom

    DCMTK(DICOM Toolkit)是一个开源软件库,它提供了处理DICOM数据所需的工具和API,使得开发者能够创建与DICOM兼容的应用程序。本压缩包“dicom.rar”包含了DCMTK的版本3.6.0,这是一个广泛使用的版本,适用于医疗...

    DCMTK3.6.7-Win11-VS2019-Release/Debug

    在Visual Studio 2019环境下,你可以通过以下步骤集成DCMTK: 1. 解压提供的`Dcmtk-3.6.7`压缩包。 2. 配置项目的属性页,添加DCMTK库的包含目录(头文件)和库目录(链接库)。 3. 链接所需的DCMTK库文件,这些...

    最全DCMTK攻略

    DCMTK攻略 DCMTK(DICOM Toolkit)是德国Offis公司开发的开源项目,旨在提供一个实现DICOM协议的平台,为开发者提供了一个便捷的开发环境。DCMTK提供了所有的源代码、支持库和帮助文档,支持多种操作系统,包括...

    DCMTK 新手使用指南

    本文总结了 DCMTK 新手使用指南,旨在帮助大家快速上手 PACS 事业。 DCMTK 工程配置指南: 要配置 DCMTK 程序,我们首先需要两个文件:DCMTK 工程文件和相关支持的库。下载 DCMTK 工程文件和支持库后,我们可以...

    Dcm.zip_dcm_dcmtk vs2008_img2dcm.exe DCMTK_site:www.pudn.com_显示D

    首先,"DCMTK"是DICOM(Digital Imaging and Communications in Medicine)工具包的缩写,这是一个开源软件库,主要用于医学图像处理,如读取、写入和转换DICOM格式的数据。"vs2008"指的是Visual Studio 2008,这是...

    DCMTK入门指南-编译说明

    DCMTK入门指南-编译说明 DCMTK(DICOM_toolkit)是一个开源软件,使得开发者可以轻松地处理DICOM格式的医学图像。以下是 DCMTK 的编译说明: 环境准备 在编译 DCMTK 之前,需要准备以下环境: * 操作系统:WIN7 ...

    dcmtk-3.6.0官方帮助文档

    DCMTK(Digital Imaging and Communications in Medicine Toolkit)是开源软件库,主要用于开发医学影像通信标准(DICOM)的软件。这个3.6.0版本的官方帮助文档是开发者和使用者理解DCMTK的重要资源,提供了详尽的...

Global site tag (gtag.js) - Google Analytics