Release requested

92 views
Skip to first unread message

Marc Ramos

unread,
Aug 29, 2014, 11:35:10 AM8/29/14
to pynet...@googlegroups.com
Hi there,
I would like to know when a request ends. In the end of a request there is this message: "Release requested"
In the AE file I found it inside the AE class:

# check for release request
                if self.ACSE.CheckRelease():
                    print "Release requested"
                    self.Kill()


Is there a way to communicate the server that the transfer has finished from there? I am quite new with these dicom servers and I try to understand how it works really. I don't get this functions in the examples:
MyAE.OnAssociateRequest = OnAssociateRequest
MyAE.OnAssociateResponse = OnAssociateResponse
MyAE.OnReceiveStore = OnReceiveStore
MyAE.OnReceiveEcho = OnReceiveEcho

I have searched them in the AE class but didn't find it. How do they work?

Thanks,
M

Hrishikesh K.B

unread,
Sep 19, 2014, 11:10:51 AM9/19/14
to pynet...@googlegroups.com
Hello Marc, 

Have you found a way to achieve this? I am also looking for the same. 

Patrice Munger

unread,
Sep 21, 2014, 10:45:25 AM9/21/14
to pynet...@googlegroups.com


Le vendredi 29 août 2014 11:35:10 UTC-4, Marc Ramos a écrit :
Hi there,
I would like to know when a request ends. In the end of a request there is this message: "Release requested"
In the AE file I found it inside the AE class:

# check for release request
                if self.ACSE.CheckRelease():
                    print "Release requested"
                    self.Kill()
 
The OnAssociateRequest, OnAssociateResponse,  OnReceiveStore and OnReceiveEcho are callback functions which are called by your AE when the corresponding events occur. The user (you) have to write them. For what you request, I would suggest the following:

  1. In the blocks that check for association release or abort, I would add a call to a new user-defined callback function, i.e.

  1. # check for release request
    if self.ACSE.CheckRelease():
  1.     if 'OnRelease' in self.AE.__dict__:
            self.AE.OnRelease()
        self.Kill()

    # check for abort
    if self.ACSE.CheckAbort():
        if 'OnAbort' in self.AE.__dict__:
            self.AE.OnAbort()
  2.     self.Kill()


  3. In your user code, define the OnRelease and OnAbort callbacks (in a way similar to other callbacks). They will be called when the association is about to get released or is aborted. 

Tell me if this approach works for you. If it does, I will add the new callbacks in the next release.


Patrice

Marc Morcos

unread,
Jun 16, 2016, 11:07:52 PM6/16/16
to pynetdicom
Hi Patrice,

I'm trying to implement what you suggested so that I can run a function after the transfer is complete. But no luck.

I have tried the following:
In applicationentity.py:
# check for release request
if self.ACSE.CheckRelease():
    print "Release requested"
    self.AE.OnRelease(self)
Then in my storescp.py:
I added MyAE.OnRelease=OnRelease and a OnRelease function.

I get the following an error about trying to sum an int and a list.

I feel like I'm going about this entirely wrong.

-Marc

Patrice Munger

unread,
Jun 20, 2016, 11:51:03 AM6/20/16
to pynet...@googlegroups.com
 Hi Marc, 

What error do you get exactly? Also, can you post your code so I can have a look?

--
You received this message because you are subscribed to the Google Groups "pynetdicom" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pynetdicom+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Patrice Munger
Reply all
Reply to author
Forward
0 new messages