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") ;
}
return
DcmSCU::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 ?