Reject instances based on AE Title in Python callback

232 views
Skip to first unread message

Diego Victor de Jesus

unread,
Jun 13, 2022, 5:47:45 PM6/13/22
to Orthanc Users
Hello!

I know it is possible to reject C-STORE from certain modalities if we configure orthanc.json like this:

{ "DicomModalities" : { "untrusted" : { "AET" : "CT", "Port" : 104, "Host" : "192.168.0.10", "AllowEcho" : false, "AllowFind" : false, "AllowMove" : false, "AllowGet" : false, "AllowStore" : false } } }

It is also possible to see the remote AET of an instance by using orthanc.RegisterOnStoredInstanceCallback like this:

def OnStoredInstance(dicom, instanceId):
    print(dicom.GetInstanceRemoteAet())

What I would like to do is use the AET to decide whether to accept or reject an instance in the orthanc.RegisterReceivedInstanceCallback. How can I retrieve the AET of an incoming instance?

Alain Mazy

unread,
Jun 15, 2022, 10:35:37 AM6/15/22
to Diego Victor de Jesus, Orthanc Users
Hi Diego,

I'm afraid this is not possible.

Have you looked at RegisterIncomingCStoreInstanceFilter ?  However, note that it happens after the ReceivedInstanceCallback.

HTH

Alain.


--
You received this message because you are subscribed to the Google Groups "Orthanc Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orthanc-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/orthanc-users/3129112e-5ef3-495c-93a8-bb446aa52517n%40googlegroups.com.

Diego Victor de Jesus

unread,
Jun 16, 2022, 9:05:56 PM6/16/22
to Orthanc Users
Hi Alain! Is this a new feature? Definitely worth taking a look. I'll try and let you know.

Alain Mazy

unread,
Jun 17, 2022, 1:12:43 AM6/17/22
to Diego Victor de Jesus, Orthanc Users
It was part of python 4.0 but we forgot to document it :-)

Ludwig Moreno

unread,
Jun 17, 2022, 8:19:05 AM6/17/22
to Alain Mazy, Diego Victor de Jesus, Orthanc Users

Diego Victor de Jesus

unread,
Jun 22, 2022, 7:52:31 AM6/22/22
to Orthanc Users
Hi Ludwig!

Would be nice to do it at the TCP/NGINX level, but since I want to block based on AET I don't think it will be possible. I will check the RegisterIncomingCStoreInstanceFilter but since it happens after ReceivedInstanceCallback I guess the DICOM instances are stored in Orthanc, then removed. My understanding is that the ReceivedInstanceCallback goes a step further and does not allow the instances to even get into Orthanc (like a rejected POST request), so I would say it is the optimal event for DICOM denial logics.
Reply all
Reply to author
Forward
0 new messages