Cornerstone + Orthanc instance frames

636 views
Skip to first unread message

Toshko Andreev

unread,
Feb 26, 2016, 2:20:41 AM2/26/16
to Orthanc Users
Greetings again,

I got a nice viewer going with Cornerstone and Orthanc, however one thing puzzles me that is potentially a problem. There are instances which contain multiple frames, in the cornerstoneDemo project the PACS server is ClearCanvas and it has an option to render/retrieve? data per frame, however in Orthanc there are cases where /instances/{id}/frames/{frameNum}/preview cannot return a valid image (unsupported).

I don't know if this is more of a cornerstone question or orthanc, but any suggestions what to do in this case?

Chris Hafey

unread,
Feb 26, 2016, 7:31:34 AM2/26/16
to Orthanc Users
The cornerstoneDemo multi-frame instances are read using the cornerstoneWADOImageLoader which loads the full DICOM P10.  The orthanc preview endpoint returns a rendered image (JPEG or PNG?) which cornerstoneWADOImageLoader will not understand.  Note that the cornerstoneWADOImageLoader strips the ?frame=X parameter from the imageId before making the XHR request (the frame parameter is used by cornerstoneWADOImageLoader to extract the right frame once the multi-frame instance is loaded and cached in the browsers memory).  You might find the following example helpful:

http://rawgit.com/chafey/cornerstoneWADOImageLoader/master/examples/wadourimultiframe/index.html

Chris

PS - If you really want to use rendered images, you can use the cornerstoneWebImageLoader, but you will lose out on some functionality which depends on the full DICOM P10 instance

Toshko Andreev

unread,
Feb 26, 2016, 9:33:05 AM2/26/16
to Orthanc Users
So the ?frame is actually for the WADO loader and not for ClearCanvas? If so it makes perfect sense now. I was concerned that I couldn't specify which frame to load FROM the .dcm file but now it makes sense.

Chris Hafey

unread,
Feb 26, 2016, 9:41:37 AM2/26/16
to Orthanc Users
Yes, ?frame is a cornerstoneWADOImageLoader specific feature.  The imageId format is cornerstone image loader specific so the image loader can completely control what happens.  In this case, it uses the ?frame query parameter to allow frame level access (which is not something WADO-URI supports).

Toshko Andreev

unread,
Feb 26, 2016, 9:58:43 AM2/26/16
to Orthanc Users
On a related note, is there any chance to get the frames count in an instance in /study/{id}/instances

Sébastien Jodogne

unread,
Feb 27, 2016, 9:23:38 AM2/27/16
to Orthanc Users
Hello,


I got a nice viewer going with Cornerstone and Orthanc, however one thing puzzles me that is potentially a problem. There are instances which contain multiple frames, in the cornerstoneDemo project the PACS server is ClearCanvas and it has an option to render/retrieve? data per frame, however in Orthanc there are cases where /instances/{id}/frames/{frameNum}/preview cannot return a valid image (unsupported).

I think that Chris has already answered about Cornerstone. On the Orthanc side of things, if you receive an "unsupported image", this most probably means that your image is encoded as JPEG2k.

If you want the "/instances/{id}/frames/{frameNum}/preview" call work even for JPEG2k, you will have to install the Web viewer plugin. This plugin will replace the built-in DICOM of Orthanc by that of GDCM, that happens to support JPEG2k:

 
On a related note, is there any chance to get the frames count in an instance in /study/{id}/instances

This is already the case: You can get the number of frames in one instance by counting the number of items that are returned by a call to "/instances/{id}/frames".

HTH,
Sébastien-

Toshko Andreev

unread,
Feb 29, 2016, 2:45:07 AM2/29/16
to Orthanc Users
I wanted to avoid the call to /instances/{id}/frames as it can get quite expensive if there are lots of instances,

Sébastien Jodogne

unread,
Feb 29, 2016, 3:01:24 AM2/29/16
to Orthanc Users
If you are dealing with 3D or 2D+t images, you could call "/series/{id}/ordered-slices" to speed up things.

On Monday, February 29, 2016 at 8:45:07 AM UTC+1, Toshko Andreev wrote:
I wanted to avoid the call to /instances/{id}/frames as it can get quite expensive if there are lots of instances,

Francisco Maria Calisto

unread,
Jan 18, 2018, 6:01:20 AM1/18/18
to Orthanc Users
Just a question over your question. I am developing a prototype using both Orthanc and Cornerstone. Each time I want to put an image I need to create and link to a JSON file related to the patient ID. So manually I need to insert this information.

Is any way to do this automatically? How are you doing this?

Alain Mazy

unread,
Jan 19, 2018, 12:34:36 PM1/19/18
to Francisco Maria Calisto, Orthanc Users
Not sure to understand what you exactly mean.  You probably want to use the attachment feature: http://book.orthanc-server.com/faq/features.html#metadata-attachments
--

Alain Mazy / CTO 
a...@osimis.io / +32 494 31 67 27

Osimis

OSIMIS S.A. 
Rue bois Saint-Jean 15/1BE-4102 Seraing 
www.osimis.io

Twitter LinkedIn


Message has been deleted

Alain Mazy

unread,
Jan 23, 2018, 2:51:32 AM1/23/18
to Francisco Maria Calisto, Orthanc Users
Sorry, still not clear.  Which JSON file do you need to write into ?

On Fri, Jan 19, 2018 at 7:34 PM, Francisco Maria Calisto <francisco...@gmail.com> wrote:
By using the cornerstoneDemo we need to write directly to the JSON file.
Reply all
Reply to author
Forward
0 new messages