Dear all,
I’m currently using Orthanc as a DICOM anonymization system running two Orthanc instances. Orthanc A has only C-STORE enabled to receive DICOM instances, once a Patient becomes stable the data is anonymized and then forwarded to a Orthanc B. Afterwards both the original DICOMs and the anonymized DICOMs are deleted from Orthanc A. From Orthanc B the anonymized data can be retrieved using C-FIND, C-GET, etc. I’m using this two Orthanc Instances approach to make sure that the original non-anonymized data can never be retrieved as Orthanc A only enables storage.
My question is if there is any way how I can avoid the intermediate step of saving the anonymized DICOMs on Orthanc A before forwarding them to Orthanc B. This intermediate step is quite time consuming and HDD intensive and I would love to be able to instruct orthanc to anonymize a patient and then forward the data directoy to another Orthanc instance without saving it first.
best wishes
Martin Krämer
Hi Martin,
If it is ok for you to anonymize instance by instance, you could avoid one read-write cycle by:
- calling /anonymize at the instance level → the response is an anonymized DICOM file (not stored on disk)
- call /modalities/…/store-straight with the anonymized instance as the body (avoid reading from disk)
If you are using python and ok to anonymize instance by instance, there’s a “power user” solution in which you can use the ReceivedInstanceCallback to:
- perform anonymization by yourself (using pydicom)
- call /modalities/…/store-straight with the anonymized instance as the body
- return ReceivedInstanceAction.DISCARD to tell Orthanc not to store the file at all
This solution involves no writing/reading on disk at all.
Hope this helps,
Alain.
I guess it should be possible to react on a StablePatient by getting a list of all associated instances and then iterating over all instances to anonymize and forward instance by instance. It will require a lot of additional scripting and logic to keep anonymized IDs and UIDs, etc. consistent between associated studies and series though. I will look into it at and see if it makes sense for my application. Thanks!
I tried this, ReceivedInstanceCallback, for my own purpose and that works great.
Just wondering if there is a way to get the Incoming AET in the callback, similar to what is done for origin:
e.g. if origin == orthanc.InstanceOrigin.REST_API:
- origin is apparetnlty 1-6.
UNKNOWN = 1
DICOM_PROTOCOL = 2
REST_API = 3
PLUGIN = 4
LUA = 5
WEB_DAV = 6
I would like to be able to detect the AET or some other parameter specific to the device so that I can pre-process the instance a little before it is actually stored.
This tag: 0008,1010 (StationName): G-scan Brio MRI, 0008,1010*,* which is available from the data.StationName ? might actually work as well, so I could try that if the AET is no readily available.
Very useful feature though.
Hi,
No, the AET is not available in this callback.
Indeed you should be able to use StationName, Manufacturer, ModelName, … to “detect” where the image is coming from and perform custom processing.
HTH
Alain.