Hello Chris,
Thanks for your interest in Orthanc!
I am working on integrating an image viewer with Orthanc and need all the DICOM fields for each SOP Instance in a study so I can sort/organize the images correctly. Right now I am iterating over each SOP Instance and getting the DICOM fields using the simplified-tags endpoint for each one but this can take several seconds to do when there are many SOP Instances in a study. Is there “batch” interface that would allow me to request all DICOM fields for all instances in a series or a study in JSON format?
Yes. You can use the following URIs:
/patients/{id}/module
/studies/{id}/module
/series/{id}/module
These URIs will respectively give you the DICOM tags of the patient, study and series levels, according to the so-called “modules” of the DICOM standard. This avoids you to go down to the instance level using the REST API.
I know WADO-RS is in the roadmap, any idea on when it will be coming and how? Will it be provided as a plug-in or as a native API?
For the time being, our focus is on the release of Orthanc 1.0.0 (scheduled for Q4 2014). Because of the huge lack of public funding in Belgium for open-source products, my team at the University Hospital of Liège does not enough man-power to work on WADO-RS right now, at least until the release of Orthanc 1.0.0. This is the reason why the plugin mechanism was introduced: To avoid bottleneck on the Orthanc core.
It would be great if someone in the Orthanc community could work on a user-contributed plugin to support WADO-RS. I think that all the primitives are available in the plugin SDK [1], but do not hesitate to contact me if something is missing.
Another useful feature would be to obtain the pixel data for an image frame as it is stored in the DICOM P10 instance (e.g. compressed) as well as one that returns the pixel data uncompressed. I am aware of the image-uint16 endpoint which returns a PNG and that is close, but I would like a bit more control. Something like:
/instances/{id}/frames/{frameNumber}/raw- Returns the raw pixel data for the frame as it is stored in the SOP Instance with MIME type application/octet-stream
Orthanc already allows you to access the raw “Pixel Data” (0x7fe0, 0x0010) values:
/instances/{id}/content/7fe0-0010/{block}
In the case of uncompressed images, there is a single data block, so “block” will always be “0”. In the case of compressed images (JPEG, JPEG-LS…), there may be more than one data block. This explains the “block” parameter.
/instances/{id}/frames/{frameNumber}/uncompressed - Returns the raw uncompressed pixel data for the frame as it is stored in the SOP Instance with MIME type application/octet-stream
I do not understand this request: Please would you kindly explain the difference between it and the already-existing “image-uint16” and “content/7fe0-0010” URIs? For instance, in the case of a JPEG image, your “uncompressed” URIs would correspond to the result of “image-uint16”.
A related question is what happens when you request a image-uint16 and the underlying image frame is signed 16 bit data? Does it apply some kind of offset?
No offset is applied: The integer value stored in the DICOM image is cropped to the “uint16” data range (0->65535). For instance, “-42” would be set to “0”.
The same mechanism applies to “image-uint8” (0->255) and “image-int16” (-32768->32767). On the other hand, the “preview” URI would compute the minimum/maximum values and shift/rescale this range to the 0->255 range.
Please also note that the “RescaleSlope” and “RescaleIntercept” tags are never taken into account. The image extraction mechanism of Orthanc transmits the values that are directly stored in the “PixelData” tag.
Orthanc is a great project and I would be willing to help implement these features if you will take the help. Thanks!
Great news! I you are willing to contribute to extending Orthanc, I definitely suggest you to create user-contributed plugins, using the plugin SDK [1]. Once again, do not hesitate to contact me if some primitive is missing for your needs.
Thanks,
Sébastien-
[1] http://www.codeproject.com/Articles/797118/Implementing-a-WADO-Server-using-Orthanc