Cancel C-MOVE following an event? #795
Replies: 3 comments 1 reply
-
Hi, |
Beta Was this translation helpful? Give feedback.
-
Hey @djbower, We're having the exact same usecase and problem. But on top, we can't query our PACS on image level as @stefanoostwegel had suggested. Would you be able to share your code for that problem with me? I also have zero experience with pynetdicom unfortunately. |
Beta Was this translation helpful? Give feedback.
-
Hi @lmdulz, I followed the example here for Storage SCP: https://pydicom.github.io/pynetdicom/stable/examples/storage.html Then I added the following at the end of handle_store:
where cancel_c_move() looks like:
That's it. I literally just send a cancel signal and then wait until the request is registered by the PACS. Then control switches back to the main loop over series and the whole process is repeated (export one image, send a cancel request, wait, ...). It also helps to look at the pynetdicom source code to get clarification on the default message ids for requests. I hope this helps. Dan |
Beta Was this translation helpful? Give feedback.
-
I'm experienced with python but new to DICOM and pynetdicom. I would like to retrieve only the first instance (image) of a series from PACS. Currently, I've added a hook to the C_STORE service request (EVT_C_STORE, as per some of the code examples) to call cancel_c_move. I then time.sleep(15) to allow time for the C-MOVE to cancel before proceeding (otherwise images continue to download). Of course, having to wait is not optimal, but it seems like the cleanest approach to allow C-MOVE to exit cleanly without leaving orphaned or zombie processes running. Unfortunately, the PACs system I am working with does not support C-GET.
The above approach seems to work, although I'm not sure it is optimal. Any suggestions for improvements? Many thanks.
Beta Was this translation helpful? Give feedback.
All reactions