DICOM instances modification through the REST Api

510 views
Skip to first unread message

Piotr Piasecki

unread,
Apr 20, 2016, 5:15:33 PM4/20/16
to Orthanc Users
Dear All.

I am a student in Biomedical Engineering at the Silesian University of Technology. During my studies I worked with Orthanc. I want to use it in my current project and I'm looking for the simplest way to download, modify and send back dicom instance, or only pixel-data, without saving it on my local disc. I need o call REST Api of Orthanc in C# but I have two important questions.

First question: is it possible to receive pixel-data of DICOM instance through Orthanc REST Api? Path /instances/{id}/file gives mi whole .dcm file, not only pixel data, and I do not have the possibility to extract only pixel-data from this. I also tried /instances/{id}/simplified-tags, but PixelData tag contains null.

The second question is: can I modify pixel-data of single instance through REST Api, as it is written here: https://orthanc.chu.ulg.ac.be/book/users/anonymization.html ?

I will be very grateful for any answer.

Best regards.

Peter.

Sébastien Jodogne

unread,
Apr 22, 2016, 4:30:31 AM4/22/16
to Orthanc Users, p.a.p.pi...@gmail.com
Hello,

Thanks for your interest in Orthanc.

The two features you are requesting are already supported in the mainline version of Orthanc, and will be part of forthcoming release 1.0.1.

Answer to your first question: This is the role of the new URI "/instances/{...}/frames/{...}/raw". It gives access the raw frames, bypassing the image decompression.

Answer to your second question: Yes, this is possible using a syntax similar to the following call (i.e. provide a PNG/JPEG image using Data URI Scheme [1]):

# curl -X POST http://localhost:8042/instances/ff3e11c5-e38d6e70-111c8481-bb2b39aa-e9404db9/modify -d '{"Replace":{"PixelData":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="}}'

HTH,
Sébastien-

Piotr Piasecki

unread,
Apr 26, 2016, 5:12:39 PM4/26/16
to Orthanc Users
Thank you very much for your response.

In connection with your answer, I have another questions. Do both of these features will become available in the next version of Orthanc, or only the first, and the second is already available?

The next question is, when a new version 1.0.1 release is planned? I want to know if I can wait, or I have to come up with something using the current version.

Yours sincerely,

Peter

Sébastien Jodogne

unread,
Apr 27, 2016, 4:12:05 AM4/27/16
to Orthanc Users, p.a.p.pi...@gmail.com
Both features will be part of Orthanc 1.0.1, and none of them is available in Orthanc 1.0.0.

The release of Orthanc 1.0.1 is scheduled during May, 2016.

Note that these features are already available using Docker (as the Docker images use the mainline version of Orthanc):

Piotr Piasecki

unread,
Apr 29, 2016, 8:54:44 AM4/29/16
to Orthanc Users
Thank you. I will continue my work on the current version of Orthanc, but as soon as the new version will appear, I will start to use it and its functionality.

I have another question which is interesting for me. Will the second feature work only with series of 2D images stored each in single instance in .dcm file, or whether it will be possible to change pixelData of 3D volume saved in single .dcm file?

Best regards.

Peter.

Sébastien Jodogne

unread,
May 21, 2016, 4:38:23 AM5/21/16
to Orthanc Users, p.a.p.pi...@gmail.com
Sorry for the delay.

The second feature will work on a series of 2D images if you modify each instance one by one.

It is not possible to change the PixelData of a multi-frame image (e.g. 3D or cine/2D+t). I kindly invite you to submit a feature request on the following Trello board:

Sébastien-
Reply all
Reply to author
Forward
0 new messages