Check if no associations are being used.

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
ruben.cruz
Posts: 43
Joined: Fri, 2019-05-03, 15:06

Check if no associations are being used.

#1 Post by ruben.cruz »

Hi,

first of all thank for the help in previous questions, we encounter a problem that we could not find a way to solve it properly.
So we are creating an application using c++/cli and in previous question you help us pointing to use "handleIncomingCommand" and "handleSTORERequest" from "DcmThreadSCP" that we needed to manage the receiving files.

At this point we can't figure it out where we can retrive some information:
- How can we find that the Association has been released?
- How can we find were all/no associations are in use?
- Where can we retrive the Status Summary like we receive on dcmsend?

We have a couple more questions, but since we think this ones are related if you can help first would be immensly helpful

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

Re: Check if no associations are being used.

#2 Post by Michael Onken »

Hi,
How can we find that the Association has been released?
Overwrite the method notifyAssociationTermination() in your DcmSCP-derived class and you will notice an association release.
There was a bug that prevented that method for being called, that has been fixed in a recent commit.
How can we find were all/no associations are in use?
Right now there is no API to find out, how many associations are available or in use. That could be added easily to the pool, though (I think).
Where can we retrive the Status Summary like we receive on dcmsend?
You must compute it yourself in your C-STORE-Handler, i.e. collect information on all files received and sum up the information. Note that DcmSCP (and the pool) is not made for storage specifically but to serve as a general SCP class that also can handle all other DICOM services. That's why it does not make sense to implement such a handler in the base classes.

You can test and see in DcmStorageSCP used by dcmrecv how this can be accomplished.

Best regards,
Michael

ruben.cruz
Posts: 43
Joined: Fri, 2019-05-03, 15:06

Re: Check if no associations are being used.

#3 Post by ruben.cruz »

Hi,
Thank you for your answer but we can't reach any solution on owr side.

So, to do a overwrite of notifyAssociationTermination we would like to know what is inside of that function previously?


What we really want to do is in the end of the association to create a file (report) with info similar to the Status Summary:

Code: Select all

I: Releasing Association
I:
I: Status Summary
I: --------------
I: Number of associations   : 1
I: Number of pres. contexts : 2
I: Number of SOP instances  : 727
I: - sent to the peer       : 727
I:   * with status SUCCESS  : 727
that we could had the timers (start/finish)

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

Re: Check if no associations are being used.

#4 Post by Michael Onken »

notifyAssociationTermination() is called by the code once the association is ending. The original implementation does nothing but logging a short message (see DcmSCP, it's no secret...).

For such a report file you have to collect the number of SOP instances in your C-STORE handler, as said earlier, along with the status (success, error or warning). Also, the number of associations should be equal to the number of calls to notifyAssociationTermination(), i.e. count those, too. The number of presentation contexts is usually not so important I would say, but if you want them look at this is done in DcmStorageSCP (which also demonstrates the other stuff, too, as said earlier).

Best regards,
Michael

J. Riesmeier
DCMTK Developer
Posts: 2503
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Check if no associations are being used.

#5 Post by J. Riesmeier »

The "status summary" is a feature of the DcmStorageSCU class (and not one of the DcmStorageSCP class): http://git.dcmtk.org/?p=dcmtk.git;a=blo ... =HEAD#l949

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

Re: Check if no associations are being used.

#6 Post by Michael Onken »

Ah thanks Jörg, sure. I implemented something similar for a customer based on DcmSCP that's why I was mistaken.

Best,
Michael

ruben.cruz
Posts: 43
Joined: Fri, 2019-05-03, 15:06

Re: Check if no associations are being used.

#7 Post by ruben.cruz »

The "status summary" is a feature of the DcmStorageSCU
Yes, and we are trying to make something similar into our DcmSCP-derived.

can we somehow get something like "TransferList.size" on SCP to know how many files we will receive?
sorry if it is a simple question but we can't find it in the "incomingMsg" in "handleIncomingCommand"

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

Re: Check if no associations are being used.

#8 Post by Michael Onken »

Hi,

you have your own code in place that receives the image(s) right? Why not counting them using a class member variable?

Best regards,
Michael

Post Reply

Who is online

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