DICOM @ OFFIS

Discussion Forum for OFFIS DICOM Tools - For registration, send email with desired user name to the OFFIS DICOM team
It is currently Mon, 2017-12-18, 17:17

All times are UTC + 1 hour




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: DCMTK server code
PostPosted: Wed, 2017-10-18, 13:48 
Offline

Joined: Tue, 2017-10-10, 09:44
Posts: 8
I tried running a simple sever code

DcmSCP scp;
scp.setAETitle("SERVER");
scp.setPort(11112);
scp.listen();
As far as i know, the builtin listen() function of DCMScp class comes with the capability to handle C-ECHO. But when i try

echoscu -aec "SERVER" -aet "ECHO" 127.0.0.1 11112

i get the following output for echoscu

F: Association Request Failed: 0006:0317 Peer aborted Association (or never connected)


and at scp i get

I: Association Received TA-DT-110: ECHO -> SERVER
I: Incoming Association Request:
I: ====================== BEGIN A-ASSOCIATE-RQ =====================
I: Our Implementation Class UID: 1.2.276.0.7230010.3.0.3.6.2
I: Our Implementation Version Name: OFFIS_DCMTK_362
I: Their Implementation Class UID: 1.2.276.0.7230010.3.0.3.6.2
I: Their Implementation Version Name: OFFIS_DCMTK_362
I: Application Context Name: 1.2.840.10008.3.1.1.1
I: Calling Application Name: ECHO
I: Called Application Name: SERVER
I: Responding Application Name:
I: Our Max PDU Receive Size: 16384
I: Their Max PDU Receive Size: 16384
I: Presentation Contexts:
I: Context ID: 1 (Proposed)
I: Abstract Syntax: =VerificationSOPClass
I: Proposed SCP/SCU Role: Default
I: Proposed Transfer Syntax(es):
I: =LittleEndianImplicit
I: Requested Extended Negotiation: none
I: Accepted Extended Negotiation: none
I: Requested User Identity Negotiation: none
I: User Identity Negotiation Response: none
I: ======================= END A-ASSOCIATE-RQ ======================
E: 0006:042d profile key undefined: DEFAULT

what am i missing here?


Top
 Profile  
 
 Post subject: Re: DCMTK server code
PostPosted: Wed, 2017-10-18, 15:57 
Offline
DCMTK Developer

Joined: Fri, 2004-11-05, 13:47
Posts: 1650
Location: Oldenburg, Germany
Hi,

which version of DCMTK are you using?

Best,
Michael


Top
 Profile  
 
 Post subject: Re: DCMTK server code
PostPosted: Wed, 2017-10-18, 17:04 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1882
Location: Oldenburg, Germany
Looking at the Implementation Version Name, I would say DCMTK 3.6.2 :-)


Top
 Profile  
 
 Post subject: Re: DCMTK server code
PostPosted: Thu, 2017-10-19, 04:48 
Offline

Joined: Tue, 2017-10-10, 09:44
Posts: 8
J. Riesmeier wrote:
Looking at the Implementation Version Name, I would say DCMTK 3.6.2 :-)

Yes I am using DCMTK 3.6.2 :)
I think that the default profile is missing profile key.


Top
 Profile  
 
 Post subject: Re: DCMTK server code
PostPosted: Thu, 2017-10-19, 07:07 
Offline

Joined: Tue, 2017-10-10, 09:44
Posts: 8
adding the following to the code helped solve it.

scp.addPresentationContext(UID_VerificationSOPClass, UID_LittleEndianImplicitTransferSyntax);

And thank you guys for always helping out. :)

Regards
Hafiz


Top
 Profile  
 
 Post subject: Re: DCMTK server code
PostPosted: Thu, 2017-10-19, 07:42 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1882
Location: Oldenburg, Germany
I checked the classes: DcmSCP does provide a C-ECHO handler but does not add the Verification SOP Class to the (default) list of accepted Presentation Contexts; this is different from the DcmStorageSCP class, which is derived from DcmSCP and which accepts the Verification SOP Class by default.

Excerpt from the DcmStorageSCP documentation:
Code:
 *    [...] If no association negotiation profile is loaded,
 *    the SCP will only support the Verification SOP Class (with Default Transfer Syntax,
 *    i.e. C-ECHO with Implicit VR Little Endian), which is required for all DICOM
 *    Service Class Providers.


Top
 Profile  
 
 Post subject: Re: DCMTK server code
PostPosted: Thu, 2017-10-19, 13:03 
Offline
DCMTK Developer

Joined: Fri, 2004-11-05, 13:47
Posts: 1650
Location: Oldenburg, Germany
Not sure what the best behavior of DcmSCP would be, but I tend to keep it as is. However, at least the current documentation should be much clearer. I will change it in the next days. Thanks for the hint Hafiz.

Best regards,
Michael


Top
 Profile  
 
 Post subject: Re: DCMTK server code
PostPosted: Thu, 2017-10-19, 13:04 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1882
Location: Oldenburg, Germany
Also the error message ("E: 0006:042d profile key undefined: DEFAULT") could be clearer, i.e. when the default profile is empty.


Top
 Profile  
 
 Post subject: Re: DCMTK server code
PostPosted: Thu, 2017-10-19, 13:14 
Offline
DCMTK Developer

Joined: Fri, 2004-11-05, 13:47
Posts: 1650
Location: Oldenburg, Germany
Yes, I'll fix that too.


Top
 Profile  
 
 Post subject: Re: DCMTK server code
PostPosted: Mon, 2017-11-27, 13:34 
Offline
DCMTK Developer

Joined: Fri, 2004-11-05, 13:47
Posts: 1650
Location: Oldenburg, Germany
Dear Hafiz,

here is the follow up:

I extended DcmSCP with an option for allowing to handle Verification SOP class. Also the existing documentation has been extended to explain the default behavior (i.e. not to support Verification at all). See this commit.

Also I added a better error message in case the user forgot to add any presentation contexts, or added invalid ones. In that case, the code now also returns a dedicated error code (new OFCondition consant). See this commit.

Thanks for reporting! :)

Best regards,
Michael


Top
 Profile  
 
 Post subject: Re: DCMTK server code
PostPosted: Tue, 2017-11-28, 12:46 
Offline

Joined: Tue, 2017-10-10, 09:44
Posts: 8
Dear Michael,

Thanks for updating the library and thanks for the mention. You guys are really doing a great job maintaining such a wonderful tool. Hope this proves useful to people who use this tool in the future. :)

Best Regards
Hafiz


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group