Downloading studies -restful API - don't know study ID

Hello all,

Apologies if this is a basic question!

I am creating a pipeline that requires me to download a series from my Orthanc dicom server. I hope to download the series using the Restful API.

I understand it should be something like:

curl http://localhost:8042/series/SERIES-IDENTIFIER/media > series.zip

This works when I input a series identifier. However, in the automated pipeline, i will not know the series-identifier (I understand that this is an orthanc identifier?).

My orthanc server receives a pushed MRI series. Once that is pushed successfully from the MR server, my program will use the resful api to download the data to the workstation and perform some operations on it. I was hoping I would be able to use the patient ID or some other known attribute. Is there a way to download data without knowing the orthanc URI? Or a way to use restful API to query to get the relevant URI?

Thank you!

You might want to look into leveraging this:

https://book.orthanc-server.com/faq/features.html?highlight=stable#stable-resources

You could possible rig up a ‘web-hook’ or even e-mail within a Python Plug-in script to do what you are looking for, particularly if you are pretty certain that a series will be completed after the StableAge setting in the configuration:

There are some examples here on how to use a script for auto-routing for a stable study here:

https://book.orthanc-server.com/plugins/python.html#auto-routing-studies

You might be able to implement something similar for the Series you are talking about, but just then just e-mail the series directly, or use a web-hook to let you know that there is a new one to process, with the ID. You could do all of that in Python.

Stephen D. Scotti

Hello,
You can use /tools/find API to find the series indentifier. Checkout the orthanc book for more information

Depending upon your setup, you might also just consider using a Lua script to store-and-forward if you workstation is a Orthanc Instance or a DICOM node:

See:

If you have your own instance of Orthanc on your workstation, or even just a DICOM node, you might want to just store-and-forward the studies or series of interest to your workstation. You can do that even with a Lua Script.

https://book.orthanc-server.com/users/lua.html#auto-routing-of-dicom-images