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

362 views
Skip to first unread message

Zoe O'Brien-Moran

unread,
Jul 21, 2022, 10:49:56 AM7/21/22
to Orthanc Users
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!



Stephen Douglas Scotti

unread,
Jul 21, 2022, 11:08:51 AM7/21/22
to Orthanc Users
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

Tran Phong

unread,
Jul 21, 2022, 11:48:08 AM7/21/22
to Zoe O'Brien-Moran, Orthanc Users
Hello,
You can use /tools/find API to find the series indentifier. Checkout the orthanc book for more information 

--
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/7afe0575-99e8-4ccd-be15-d0f5f742f3cen%40googlegroups.com.

Stephen Douglas Scotti

unread,
Jul 21, 2022, 11:58:12 AM7/21/22
to Orthanc Users
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.

Reply all
Reply to author
Forward
0 new messages