send a list of dicom files from server

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Yamini_Krishna
Posts: 8
Joined: Mon, 2017-10-09, 10:44

send a list of dicom files from server

#1 Post by Yamini_Krishna »

How the sever respond to a client request and send the list of dicom files from server? which member function can be used from DcmSCP class to list the dicom files from the server?

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

Re: send a list of dicom files from server

#2 Post by Michael Onken »

Hi,

it depends on the DICOM service (SOP Cllass) is using to contact your server. You then have to configure DcmSCP to accept those services. Additionally, the request is sent in a message called DIMSE, probably, in your case, a C-FIND-RQ message. You must build a handler into DcmSCP that answers with one or more C-FIND-RSP messages. To do that you should derive from DcmSCP and then overwrite the method (at least) handleFINDRequest().

Best,
Michael

Yamini_Krishna
Posts: 8
Joined: Mon, 2017-10-09, 10:44

Re: send a list of dicom files from server

#3 Post by Yamini_Krishna »

I have added a condition to process C-FIND request inside the function handleIncomingCommand() in scp.cc

OFCondition DcmSCP::handleIncomingCommand(T_DIMSE_Message *incomingMsg,
const DcmPresentationContextInfo &presInfo, DcmDataset *&reqMessage)
{
OFCondition cond;
if (incomingMsg->CommandField == DIMSE_C_ECHO_RQ)
{
// Process C-ECHO request
cond = handleECHORequest(incomingMsg->msg.CEchoRQ, presInfo.presentationContextID);
}
else if (incomingMsg->CommandField == DIMSE_C_FIND_RQ)
{
// Process C-FIND request
cond = receiveFINDRequest(incomingMsg->msg.CFindRQ, presInfo.presentationContextID, reqMessage);
}
else {
// We cannot handle this kind of message. Note that the condition will be returned
// and that the caller is responsible to end the association if desired.
OFString tempStr;
DCMNET_ERROR("Cannot handle this kind of DIMSE command (0x"
<< STD_NAMESPACE hex << STD_NAMESPACE setfill('0') << STD_NAMESPACE setw(4)
<< OFstatic_cast(unsigned int, incomingMsg->CommandField) << ")");
DCMNET_DEBUG(DIMSE_dumpMessage(tempStr, *incomingMsg, DIMSE_INCOMING));
cond = DIMSE_BADCOMMANDTYPE;
}

and I used the findscu command as
findscu -v -d -S -k StudyInstanceUID="*" -aet FINDSCU --call SERVER 127.0.0.1 11112

[quote][/quote]
$dcmtk: findscu v3.6.2 2017-07-14 $

D: Request Parameters:
D: ====================== BEGIN A-ASSOCIATE-RQ =====================
D: Our Implementation Class UID: 1.2.276.0.7230010.3.0.3.6.2
D: Our Implementation Version Name: OFFIS_DCMTK_362
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: FINDSCU
D: Called Application Name: SERVER
D: Responding Application Name: SERVER
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: 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: 186 + 6 bytes PDU header
D: 02 00 00 00 00 ba 00 01 00 00 53 45 52 56 45 52
D: 20 20 20 20 20 20 20 20 20 20 46 49 4e 44 53 43
D: 55 20 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 1b 01 00 00 00 40 00 00 13 31
D: 2e 32 2e 38 34 30 2e 31 30 30 30 38 2e 31 2e 32
D: 2e 31 50 00 00 3a 51 00 00 04 00 00 40 00 52 00
D: 00 1b 31 2e 32 2e 32 37 36 2e 30 2e 37 32 33 30
D: 30 31 30 2e 33 2e 30 2e 33 2e 36 2e 32 55 00 00
D: 0f 4f 46 46 49 53 5f 44 43 4d 54 4b 5f 33 36 32
D:
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.2
D: Our Implementation Version Name: OFFIS_DCMTK_362
D: Their Implementation Class UID: 1.2.276.0.7230010.3.0.3.6.2
D: Their Implementation Version Name: OFFIS_DCMTK_362
D: Application Context Name: 1.2.840.10008.3.1.1.1
D: Calling Application Name: FINDSCU
D: Called Application Name: SERVER
D: Responding Application Name: SERVER
D: Our Max PDU Receive Size: 16384
D: Their Max PDU Receive Size: 16384
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: =LittleEndianExplicit
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: 16372)
I: Sending Find Request
D: ===================== OUTGOING DIMSE MESSAGE ====================
D: Message Type : C-FIND RQ
D: Presentation Context ID : 1
D: Message ID : 1
D: Affected SOP Class UID : FINDStudyRootQueryRetrieveInformationModel
D: Data Set : present
D: Priority : low
D: ======================= END DIMSE MESSAGE =======================
I: Request Identifiers:
I:
I: # Dicom-Data-Set
I: # Used TransferSyntax: Little Endian Explicit
I: (0020,000d) UI [*] # 2, 1 StudyInstanc
eUID
I:
E: Find Failed, query keys:
E:
E: # Dicom-File-Format
E:
E: # Dicom-Meta-Information-Header
E: # Used TransferSyntax: Little Endian Explicit
E:
E: # Dicom-Data-Set
E: # Used TransferSyntax: Little Endian Explicit
E: (0020,000d) UI [* ] # 2, 1 StudyInstanceUID
E:
E: 0006:0317 Peer aborted Association (or never connected)
I: Peer Aborted Association

Is there any wrong with my query? and what should be added in the function handleIncomingCommand() ?

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

Re: send a list of dicom files from server

#4 Post by Michael Onken »

The query is not correct ("*") but it does not matter here. Use a debugger to see what happens on the server side. It's hard to debug your code remotely.

Best,
Michael

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 1 guest