Download the MR image from a PACS server and save it in jpeg format.

All other questions regarding DCMTK

Moderator: Moderator Team

Message
Author
omeryildiz
Posts: 15
Joined: Fri, 2023-04-28, 11:41

Re: Download the MR image from a PACS server and save it in jpeg format.

#16 Post by omeryildiz »

Michael Onken wrote: Tue, 2023-05-02, 14:05 Yes, look into dcmnet/apps/getscu.cc how to do that.

BR, Michael
As I understood:

If we use sendCGETRequest() we don't need to run "storescp -v 11112".

is it true?

Michael Onken
DCMTK Developer
Posts: 2051
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: Download the MR image from a PACS server and save it in jpeg format.

#17 Post by Michael Onken »

Correct, you will receive the images on the same connection that is used to deliver the C-GET.

BR,
Michael

omeryildiz
Posts: 15
Joined: Fri, 2023-04-28, 11:41

Re: Download the MR image from a PACS server and save it in jpeg format.

#18 Post by omeryildiz »

Thank you for your interest.

I've tried. But it's not working

what is "0xc000: Failed: Unable to process"?

Code: Select all

D: Configured a total of 4 presentation contexts for SCU
D: Request Parameters:
D: ====================== BEGIN A-ASSOCIATE-RQ =====================
D: Our Implementation Class UID:      1.2.276.0.7230010.3.0.3.6.7
D: Our Implementation Version Name:   OFFIS_DCMTK_367
D: Their Implementation Class UID:
D: Their Implementation Version Name:
D: Application Context Name:    1.2.840.10008.3.1.1.1
D: Calling Application Name:    TEST-SCU
D: Called Application Name:     MOVESCP
D: Responding Application Name:
D: Our Max PDU Receive Size:    16384
D: Their Max PDU Receive Size:  0
D: Presentation Contexts:
D:   Context ID:        1 (Proposed)
D:     Abstract Syntax: =FINDStudyRootQueryRetrieveInformationModel
D:     Proposed SCP/SCU Role: Default
D:     Proposed Transfer Syntax(es):
D:       =LittleEndianExplicit
D:       =BigEndianExplicit
D:       =LittleEndianImplicit
D:   Context ID:        3 (Proposed)
D:     Abstract Syntax: =MOVEStudyRootQueryRetrieveInformationModel
D:     Proposed SCP/SCU Role: Default
D:     Proposed Transfer Syntax(es):
D:       =LittleEndianExplicit
D:       =BigEndianExplicit
D:       =LittleEndianImplicit
D:   Context ID:        5 (Proposed)
D:     Abstract Syntax: =GETStudyRootQueryRetrieveInformationModel
D:     Proposed SCP/SCU Role: Default
D:     Proposed Transfer Syntax(es):
D:       =LittleEndianExplicit
D:       =BigEndianExplicit
D:       =LittleEndianImplicit
D:   Context ID:        7 (Proposed)
D:     Abstract Syntax: =VerificationSOPClass
D:     Proposed SCP/SCU Role: Default
D:     Proposed Transfer Syntax(es):
D:       =LittleEndianExplicit
D:       =BigEndianExplicit
D:       =LittleEndianImplicit
D: Requested Extended Negotiation: none
D: Accepted Extended Negotiation:  none
D: Requested User Identity Negotiation: none
D: User Identity Negotiation Response:  none
D: ======================= END A-ASSOCIATE-RQ ======================
I: Requesting Association
D: setting network send timeout to 60 seconds
D: setting network receive timeout to 60 seconds
D: Constructing Associate RQ PDU
D: PDU Type: Associate Accept, PDU Length: 283 + 6 bytes PDU header
D:   02  00  00  00  01  1b  00  01  00  00  4d  4f  56  45  53  43
D:   50  20  20  20  20  20  20  20  20  20  54  45  53  54  2d  53
D:   43  55  20  20  20  20  20  20  20  20  00  00  00  00  00  00
D:   00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
D:   00  00  00  00  00  00  00  00  00  00  10  00  00  15  31  2e
D:   32  2e  38  34  30  2e  31  30  30  30  38  2e  33  2e  31  2e
D:   31  2e  31  21  00  00  19  01  00  00  00  40  00  00  11  31
D:   2e  32  2e  38  34  30  2e  31  30  30  30  38  2e  31  2e  32
D:   21  00  00  19  03  00  00  00  40  00  00  11  31  2e  32  2e
D:   38  34  30  2e  31  30  30  30  38  2e  31  2e  32  21  00  00
D:   19  05  00  00  00  40  00  00  11  31  2e  32  2e  38  34  30
D:   2e  31  30  30  30  38  2e  31  2e  32  21  00  00  19  07  00
D:   00  00  40  00  00  11  31  2e  32  2e  38  34  30  2e  31  30
D:   30  30  38  2e  31  2e  32  50  00  00  46  51  00  00  04  00
D:   01  00  00  52  00  00  26  31  2e  32  2e  38  32  36  2e  30
D:   2e  31  2e  33  36  38  30  30  34  33  2e  31  2e  32  2e  31
D:   30  30  2e  38  2e  34  38  2e  32  31  39  2e  30  55  00  00
D:   10  44  69  63  6f  6d  4f  62  6a  65  63  74  73  2e  4e  45
D:   54
D: Parsing an A-ASSOCIATE PDU
D: Association Parameters Negotiated:
D: ====================== BEGIN A-ASSOCIATE-AC =====================
D: Our Implementation Class UID:      1.2.276.0.7230010.3.0.3.6.7
D: Our Implementation Version Name:   OFFIS_DCMTK_367
D: Their Implementation Class UID:    1.2.826.0.1.3680043.1.2.100.8.48.219.0
D: Their Implementation Version Name: DicomObjects.NET
D: Application Context Name:    1.2.840.10008.3.1.1.1
D: Calling Application Name:    TEST-SCU
D: Called Application Name:     MOVESCP
D: Responding Application Name: MOVESCP
D: Our Max PDU Receive Size:    16384
D: Their Max PDU Receive Size:  65536
D: Presentation Contexts:
D:   Context ID:        1 (Accepted)
D:     Abstract Syntax: =FINDStudyRootQueryRetrieveInformationModel
D:     Proposed SCP/SCU Role: Default
D:     Accepted SCP/SCU Role: Default
D:     Accepted Transfer Syntax: =LittleEndianImplicit
D:   Context ID:        3 (Accepted)
D:     Abstract Syntax: =MOVEStudyRootQueryRetrieveInformationModel
D:     Proposed SCP/SCU Role: Default
D:     Accepted SCP/SCU Role: Default
D:     Accepted Transfer Syntax: =LittleEndianImplicit
D:   Context ID:        5 (Accepted)
D:     Abstract Syntax: =GETStudyRootQueryRetrieveInformationModel
D:     Proposed SCP/SCU Role: Default
D:     Accepted SCP/SCU Role: Default
D:     Accepted Transfer Syntax: =LittleEndianImplicit
D:   Context ID:        7 (Accepted)
D:     Abstract Syntax: =VerificationSOPClass
D:     Proposed SCP/SCU Role: Default
D:     Accepted SCP/SCU Role: Default
D:     Accepted Transfer Syntax: =LittleEndianImplicit
D: Requested Extended Negotiation: none
D: Accepted Extended Negotiation:  none
D: Requested User Identity Negotiation: none
D: User Identity Negotiation Response:  none
D: ======================= END A-ASSOCIATE-AC ======================
I: Association Accepted (Max Send PDV: 65524)
I: Sending C-ECHO Request
D: ===================== OUTGOING DIMSE MESSAGE ====================
D: Message Type                  : C-ECHO RQ
D: Presentation Context ID       : 7
D: Message ID                    : 1
D: Data Set                      : none
D: ======================= END DIMSE MESSAGE =======================
D: DcmDataset::read() TransferSyntax="Little Endian Implicit"
I: Received C-ECHO Response
D: ===================== INCOMING DIMSE MESSAGE ====================
D: Message Type                  : C-ECHO RSP
D: Presentation Context ID       : 7
D: Message ID Being Responded To : 1
D: Affected SOP Class UID        : VerificationSOPClass
D: Data Set                      : none
D: DIMSE Status                  : 0x0000: Success
D: ======================= END DIMSE MESSAGE =======================
I: Sending C-FIND Request
D: ===================== OUTGOING DIMSE MESSAGE ====================
D: Message Type                  : C-FIND RQ
D: Presentation Context ID       : 1
D: Message ID                    : 2
D: Affected SOP Class UID        : FINDStudyRootQueryRetrieveInformationModel
D: Data Set                      : present
D: Priority                      : medium
D: -----------------------------------------------------------------
D: # Dicom-Data-Set
D: # Used TransferSyntax: Little Endian Explicit
D: (0008,0050) SH (no value available)                     #   0, 0 AccessionNumber
D: (0008,0052) CS [STUDY]                                  #   6, 1 QueryRetrieveLevel
D: (0010,0010) PN (no value available)                     #   0, 0 PatientName
D: (0010,0020) LO (no value available)                     #   0, 0 PatientID
D: (0020,000d) UI (no value available)                     #   0, 0 StudyInstanceUID
D: ======================= END DIMSE MESSAGE =======================
D: DcmDataset::read() TransferSyntax="Little Endian Implicit"
I: Received C-FIND Response
D: ===================== INCOMING DIMSE MESSAGE ====================
D: Message Type                  : C-FIND RSP
D: Presentation Context ID       : 1
D: Message ID Being Responded To : 2
D: Affected SOP Class UID        : FINDStudyRootQueryRetrieveInformationModel
D: Data Set                      : present
D: DIMSE Status                  : 0xff00: Pending: Matches are continuing
D: ======================= END DIMSE MESSAGE =======================
D: DcmDataset::read() TransferSyntax="Little Endian Implicit"
D: Received dataset on presentation context 1
D: Handling C-FIND Response
D: DIMSE status is: Pending
D: DcmDataset::read() TransferSyntax="Little Endian Implicit"
I: Received C-FIND Response
D: ===================== INCOMING DIMSE MESSAGE ====================
D: Message Type                  : C-FIND RSP
D: Presentation Context ID       : 1
D: Message ID Being Responded To : 2
D: Affected SOP Class UID        : FINDStudyRootQueryRetrieveInformationModel
D: Data Set                      : present
D: DIMSE Status                  : 0xff00: Pending: Matches are continuing
D: ======================= END DIMSE MESSAGE =======================
D: DcmDataset::read() TransferSyntax="Little Endian Implicit"
D: Received dataset on presentation context 1
D: Handling C-FIND Response
D: DIMSE status is: Pending
D: DcmDataset::read() TransferSyntax="Little Endian Implicit"
I: Received C-FIND Response
D: ===================== INCOMING DIMSE MESSAGE ====================
D: Message Type                  : C-FIND RSP
D: Presentation Context ID       : 1
D: Message ID Being Responded To : 2
D: Affected SOP Class UID        : FINDStudyRootQueryRetrieveInformationModel
D: Data Set                      : present
D: DIMSE Status                  : 0xff00: Pending: Matches are continuing
D: ======================= END DIMSE MESSAGE =======================
D: DcmDataset::read() TransferSyntax="Little Endian Implicit"
D: Received dataset on presentation context 1
D: Handling C-FIND Response
D: DIMSE status is: Pending
D: DcmDataset::read() TransferSyntax="Little Endian Implicit"
I: Received C-FIND Response
D: ===================== INCOMING DIMSE MESSAGE ====================
D: Message Type                  : C-FIND RSP
D: Presentation Context ID       : 1
D: Message ID Being Responded To : 2
D: Affected SOP Class UID        : FINDStudyRootQueryRetrieveInformationModel
D: Data Set                      : present
D: DIMSE Status                  : 0xff00: Pending: Matches are continuing
D: ======================= END DIMSE MESSAGE =======================
D: DcmDataset::read() TransferSyntax="Little Endian Implicit"
D: Received dataset on presentation context 1
D: Handling C-FIND Response
D: DIMSE status is: Pending
D: DcmDataset::read() TransferSyntax="Little Endian Implicit"
I: Received C-FIND Response
D: ===================== INCOMING DIMSE MESSAGE ====================
D: Message Type                  : C-FIND RSP
D: Presentation Context ID       : 1
D: Message ID Being Responded To : 2
D: Affected SOP Class UID        : FINDStudyRootQueryRetrieveInformationModel
D: Data Set                      : present
D: DIMSE Status                  : 0xff00: Pending: Matches are continuing
D: ======================= END DIMSE MESSAGE =======================
D: DcmDataset::read() TransferSyntax="Little Endian Implicit"
D: Received dataset on presentation context 1
D: Handling C-FIND Response
D: DIMSE status is: Pending
D: DcmDataset::read() TransferSyntax="Little Endian Implicit"
I: Received C-FIND Response
D: ===================== INCOMING DIMSE MESSAGE ====================
D: Message Type                  : C-FIND RSP
D: Presentation Context ID       : 1
D: Message ID Being Responded To : 2
D: Affected SOP Class UID        : FINDStudyRootQueryRetrieveInformationModel
D: Data Set                      : present
D: DIMSE Status                  : 0xff00: Pending: Matches are continuing
D: ======================= END DIMSE MESSAGE =======================
D: DcmDataset::read() TransferSyntax="Little Endian Implicit"
D: Received dataset on presentation context 1
D: Handling C-FIND Response
D: DIMSE status is: Pending
D: DcmDataset::read() TransferSyntax="Little Endian Implicit"
I: Received C-FIND Response
D: ===================== INCOMING DIMSE MESSAGE ====================
D: Message Type                  : C-FIND RSP
D: Presentation Context ID       : 1
D: Message ID Being Responded To : 2
D: Affected SOP Class UID        : FINDStudyRootQueryRetrieveInformationModel
D: Data Set                      : present
D: DIMSE Status                  : 0xff00: Pending: Matches are continuing
D: ======================= END DIMSE MESSAGE =======================
D: DcmDataset::read() TransferSyntax="Little Endian Implicit"
D: Received dataset on presentation context 1
D: Handling C-FIND Response
D: DIMSE status is: Pending
D: DcmDataset::read() TransferSyntax="Little Endian Implicit"
I: Received C-FIND Response
D: ===================== INCOMING DIMSE MESSAGE ====================
D: Message Type                  : C-FIND RSP
D: Presentation Context ID       : 1
D: Message ID Being Responded To : 2
D: Affected SOP Class UID        : FINDStudyRootQueryRetrieveInformationModel
D: Data Set                      : present
D: DIMSE Status                  : 0xff00: Pending: Matches are continuing
D: ======================= END DIMSE MESSAGE =======================
D: DcmDataset::read() TransferSyntax="Little Endian Implicit"
D: Received dataset on presentation context 1
D: Handling C-FIND Response
D: DIMSE status is: Pending
D: DcmDataset::read() TransferSyntax="Little Endian Implicit"
I: Received C-FIND Response
D: ===================== INCOMING DIMSE MESSAGE ====================
D: Message Type                  : C-FIND RSP
D: Presentation Context ID       : 1
D: Message ID Being Responded To : 2
D: Affected SOP Class UID        : FINDStudyRootQueryRetrieveInformationModel
D: Data Set                      : present
D: DIMSE Status                  : 0xff00: Pending: Matches are continuing
D: ======================= END DIMSE MESSAGE =======================
D: DcmDataset::read() TransferSyntax="Little Endian Implicit"
D: Received dataset on presentation context 1
D: Handling C-FIND Response
D: DIMSE status is: Pending
D: DcmDataset::read() TransferSyntax="Little Endian Implicit"
I: Received C-FIND Response
D: ===================== INCOMING DIMSE MESSAGE ====================
D: Message Type                  : C-FIND RSP
D: Presentation Context ID       : 1
D: Message ID Being Responded To : 2
D: Affected SOP Class UID        : FINDStudyRootQueryRetrieveInformationModel
D: Data Set                      : present
D: DIMSE Status                  : 0xff00: Pending: Matches are continuing
D: ======================= END DIMSE MESSAGE =======================
D: DcmDataset::read() TransferSyntax="Little Endian Implicit"
D: Received dataset on presentation context 1
D: Handling C-FIND Response
D: DIMSE status is: Pending
D: DcmDataset::read() TransferSyntax="Little Endian Implicit"
I: Received C-FIND Response
D: ===================== INCOMING DIMSE MESSAGE ====================
D: Message Type                  : C-FIND RSP
D: Presentation Context ID       : 1
D: Message ID Being Responded To : 2
D: Affected SOP Class UID        : FINDStudyRootQueryRetrieveInformationModel
D: Data Set                      : none
D: DIMSE Status                  : 0x0000: Success: Matching is complete
D: ======================= END DIMSE MESSAGE =======================
D: Handling C-FIND Response
D: DIMSE status is: Success
I: There are 11 studies available

# Dicom-Data-Set
# Used TransferSyntax: Little Endian Implicit
(0008,0005) CS (no value available)                     #   0, 0 SpecificCharacterSet
(0008,0050) SH [21345]                                  #   6, 1 AccessionNumber
(0008,0052) CS [STUDY]                                  #   6, 1 QueryRetrieveLevel
(0008,0054) AE [MOVESCP]                                #   8, 1 RetrieveAETitle
(0010,0010) PN [ADDOMEN2^TEST]                          #  14, 1 PatientName
(0010,0020) LO [34256]                                  #   6, 1 PatientID
(0020,000d) UI [1.2.840.113663.1500.1.313721677.1.1.20140708.145420.781] #  56, 1 StudyInstanceUID
I: Sending C-GET Request
D: ===================== OUTGOING DIMSE MESSAGE ====================
D: Message Type                  : C-GET RQ
D: Presentation Context ID       : 5
D: Message ID                    : 3
D: Affected SOP Class UID        : GETStudyRootQueryRetrieveInformationModel
D: Data Set                      : present
D: Priority                      : medium
D: -----------------------------------------------------------------
D: # Dicom-Data-Set
D: # Used TransferSyntax: Little Endian Implicit
D: (0008,0050) SH (no value available)                     #   0, 0 AccessionNumber
D: (0008,0052) CS [STUDY]                                  #   6, 1 QueryRetrieveLevel
D: (0010,0010) PN (no value available)                     #   0, 0 PatientName
D: (0010,0020) LO (no value available)                     #   0, 0 PatientID
D: (0020,000d) UI [1.2.840.113663.1500.1.313721677.1.1.20140708.145420.781] #  56, 1 StudyInstanceUID
D: ======================= END DIMSE MESSAGE =======================
D: DcmDataset::read() TransferSyntax="Little Endian Implicit"
I: Received C-GET Response
D: ===================== INCOMING DIMSE MESSAGE ====================
D: Message Type                  : C-GET RSP
D: Presentation Context ID       : 5
D: Message ID Being Responded To : 3
D: Affected SOP Class UID        : GETStudyRootQueryRetrieveInformationModel
D: Remaining Suboperations       : none
D: Completed Suboperations       : none
D: Failed Suboperations          : none
D: Warning Suboperations         : none
D: Data Set                      : none
D: DIMSE Status                  : 0xc000: Failed: Unable to process
D: ======================= END DIMSE MESSAGE =======================

D: # Dicom-Data-Set
D: # Used TransferSyntax: Little Endian Implicit
D: (0000,0902) LO [Attempt(s) to use Abstract syntax (1.2.840.10008.5.1.4.1.1.7) not in negotiated list] #  84, 1 ErrorComment

Michael Onken
DCMTK Developer
Posts: 2051
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: Download the MR image from a PACS server and save it in jpeg format.

#19 Post by Michael Onken »

You must also propose various Storage SOP Classes to the server which the server can use on the connection to send you the images. Look into getscu.cc how it's done there.

BR Michael

Michael Onken
DCMTK Developer
Posts: 2051
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: Download the MR image from a PACS server and save it in jpeg format.

#20 Post by Michael Onken »

P.S: And remove all but the following attributes from the C-GET request:

Code: Select all

D: (0008,0052) CS [STUDY]                                  #   6, 1 QueryRetrieveLevel
D: (0020,000d) UI [1.2.840.113663.1500.1.313721677.1.1.20140708.145420.781] #  56, 1 StudyInstanceUID
I removed:

Code: Select all

D: (0008,0050) SH (no value available)                     #   0, 0 AccessionNumber
D: (0010,0010) PN (no value available)                     #   0, 0 PatientName
D: (0010,0020) LO (no value available)                     #   0, 0 PatientID
BR MIchael

omeryildiz
Posts: 15
Joined: Fri, 2023-04-28, 11:41

Re: Download the MR image from a PACS server and save it in jpeg format.

#21 Post by omeryildiz »

Thank you for your interest.

it's work.

omeryildiz
Posts: 15
Joined: Fri, 2023-04-28, 11:41

Re: Download the MR image from a PACS server and save it in jpeg format.

#22 Post by omeryildiz »

Hi,

so can i send C-STORE Request with same association?

Michael Onken
DCMTK Developer
Posts: 2051
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: Download the MR image from a PACS server and save it in jpeg format.

#23 Post by Michael Onken »

Yes, the server will send the C-STORE-RQ (to you) with the image on the same association as the C-GET-RQ is sent (from your side, to the server). The C-GET Retrieve SOP Classes will, per design, always re-use the same association and will never use two associations.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest