Hello guys !
I want to create a DICOM server using the Docker image. This server will use S3 integration to send files directly to S3. However, I would like to know if it is mandatory to define PostgreSQL as storage or if I can use only S3. Another question: Is it possible to filter the images based on the AETITLE so that they are stored in different folders in my BUCKET?
I want only use the ORTHANC to receive the IMAGES and send to S3.
Another question is : When I create the Server with the S3 integration, how do I send the equipment images directly to ORTHANC? Can I test sending the images using DCMTK?
Hello
You do not need to use Postgres with S3 : you can still use the default SQLite if you wish.
As far as I know, it is not possible to use several different buckets in the same Orthanc instance.
However, you should not hesitate to use several “routing” Orthanc instances for this purpose : you can maybe use a central dispatcher Orthanc that contains logic that dispatches the study to a different Orthanc based on the originating AET. These difference Orthanc instances would be configured with the different buckets you want to use.
Something like this maybe?:
import orthanc
import json
import pprint
def OnChange(changeType, level, resourceId):
if changeType == orthanc.ChangeType.STABLE_STUDY:
print('Stable study: %s' % resourceId)
instances_ids = json.loads(orthanc.RestApiGet(f"/studies/{resourceId}/instances"))
instance_metadata = json.loads(orthanc.RestApiGet(f"/instances/{instances_ids[0]['ID']}/metadata?expand"))
pprint.pprint(instance_metadata)
if "CalledAET" in instance_metadata and "RemoteAET" in instance_metadata:
print(f"This study orginates from {instance_metadata['RemoteAET']} and was addressed to {instance_metadata['CalledAET']}")
orthanc.RestApiPost(f'/modalities/{instance_metadata['RemoteAET']}_modality/store', resourceId)
# delete the study once it has been transferred
# TODO: make this more robust and deal with failures during transfer.
orthanc.RestApiDelete(f'/studies/{resourceId}')
else:
# if not a DICOM-based transfer, do something?...
...
(there’s also an example of a C-Store filter that examines the incoming AET here.)