dynamic storage directory

is there any way to have dynamic storage directory in orthanc?

You might want to go into a little bit more detail about what the use case is there. Do you want to basically have ‘bins’ based upon some DICOM tag in instances ?

e.g. InstitutionName, Modality, etc.

and why do you need that.

It would probably also depend upon how you are using the Index DB (e.g MySQLite, MySQL, Postgres, etc.) and the Storage DB (presumably you are not storing instances in a DB, but on the file system).

I don’t think it is baked into Orthanc currently.

Stephen D. Scotti, M.D.


What do you mean exactly by “dynamic storage directory”?


For example, my storage directory looks like this: “StorageDirectory”: “D:\Orthanc”. If the directory becomes full, I want to send the remaining DICOM images to another directory, such as “Z:\Orthanc”. Is there an option to do this?

Another challenge we have is that we have a SQL Server database. In this database, we have patients with their patient IDs and the addresses of the directories where the patient images are stored. Is there any way to display these images in Orthanc’s viewer?

I managed to implement “dynamic storage directory” with the idea of making symbolic link. You can implement a plugin StorageArea which is making symbolic link whenever it receives dicom file.

Actually, I don’t know how to implement this plugin. Can you help? any reference?

You can study existing orthanc plugins for your reference of how to implement plugin. I recommend you read this first : https://book.orthanc-server.com/plugins/indexer.html . You, then, create your own plugin by implementing interfaces: StorageCreate, StorageReadWhole, StorageReadRange.

OrthancPluginRegisterStorageArea2(context, StorageCreate, StorageReadWhole, StorageReadRange, StorageRemove);

You can also read the SDK from https://sdk.orthanc-server.com/group__Callbacks.html#ga801b92161b0bfbfa6a3dd8862b09036a