Cornerstone and non-image DICOM contents

1,396 views
Skip to first unread message

José Antonio Pérez

unread,
Jul 8, 2015, 3:45:37 PM7/8/15
to cornerston...@googlegroups.com
Hi Chris,

I am considering the possibility to use the cornerstone platform to
display DICOM contents other than images. As you know, DICOM contents
are not limited to simple images (there are also multiframe images,
video, waveforms, structured reports, encapsulated PDFs, ...).

The architectural design of your platform (which I consider is
excellent) seems to be oriented to display exclusively images, and I
was wondering if another type of elements could also be displayed
using the cornerstone platform.

I have already seen on the "cornerstone demo" page that in the case of
multiframe images (the ultrasound doppler sample) the problem is
solved displaying the frames as a stack of images, the same as if it
were a CT series, but I'm afraid this solution is not applicable to
other contents.

The key objects who participate on the loading and rendering of the
images seem to be these ones:

ImageId - ImageLoader - ImageObject - Viewport - enabled element

What I was wondering is if the Viewport object could be modified (or
maybe a different object should be created) in such a way that the DOM
element could be able to represent any other kind of contents. What I
am thinking about is the possibility to use your platform to display
DICOM waveforms (in particular, 12-lead ECG). May be I am missing
something and these contents can already be represented using the
cornerstone platform without need of any further modifications?

Thanks in advance,

 José A. Pérez
 LinkedIn: http://goo.gl/lW17d

Chris Hafey

unread,
Jul 8, 2015, 4:44:15 PM7/8/15
to cornerston...@googlegroups.com, josea...@gmail.com

Hello José,


While the 'cornerstone platform" is focused on image display right now, my vision is for it to fully support all media types including PDF, MPEG, etc.  I have already implemented support for DICOM encapsulated PDF and MPEG in my viewer and the way I did it is by having the layout engine create a different viewport for these non image types (by viewport I mean a DOM structure, not the cornerstone viewport object.).  The PDF and MPEG viewports used the dicomParser library to extract the data it needed but then used the browser native PDF and MPEG display capabilities (e.g. HTML5 video element).  I think this strategy worked out very well because the browser is already very good at handling these other types so I didn't see a need for cornerstone itself to get involved here.  A layout engine will eventually be added to the cornerstone platform along with viewports for cornerstone, PDF, MPEG and other types.


I haven't worked with DICOM waveforms before and don't know anything about the data model, user expectations or UI design.  If they can be displayed as an image, you can of course use cornerstone and create a custom image loader or a dynamic image.  If visualizing the data as an image is not the best fit - you can look at a visualization library like D3 to plot it for you (e.g. plotting each lead as a graph over the time dimension).

Message has been deleted

José Antonio Pérez

unread,
Jul 8, 2015, 6:03:05 PM7/8/15
to cornerston...@googlegroups.com
Waveforms should not be displayed as an ordinary (bitmap) image. In
fact, they could be rendered as a bitmap, but I do not consider that
to be an acceptable solution. It makes much more sense to display them
as a vector image, since the final result is just a set of graphs
representing a magnitude (volts in this case) over time.

In order to parse the waveforms, the DICOM file has to be loaded and
some attributes have to be read, more or less in the same manner as
for any DICOM image. So, I will have to write a custom loader for the
SOP classes associated to waveform data. I do not expect the difficult
part to be the custom loader, but rather the creation of a "vector
image" object able to fit and match in the cornerstone platform.

I am trying to write some code in the next days just to do a kind of
proof of concept. I will post the progress (if any) on this thread,

 José Antonio

Chris Hafey

unread,
Jul 8, 2015, 7:29:32 PM7/8/15
to cornerston...@googlegroups.com, josea...@gmail.com
You should check out one of the popular vector graphing libraries for javascript:


Given a URL to the waveform, you should be able to load it using HTTP get, parse it using dicomParser, grab the data and plot it using D3 or C3.  You could have something up and going within an hour or so.  I would be happy to help if you get stuck on this (especially if you contribute a waveform module back to cornerstone :) )

Chris

José Antonio Pérez

unread,
Jul 17, 2015, 7:38:27 AM7/17/15
to cornerston...@googlegroups.com, josea...@gmail.com, Chris Hafey
Hi,

I have made a first proof of concept. This is just a less than minimal implementation to check the viability of the project.

The code is available on github:

There is also an online demo:

The current grid is only orientative. Both scales (time and Volts) still have to be properly scaled according to the corresponding values in the DICOM file.

After loading the DICOM file, an "InstanceObject" is created instead of an "ImageObject". The idea is to have a higher level object to deal with any kind of DICOM contents. After loading the file, depending on the type of contents (SOP Class UID) the code will create the necessary object (ImageObject, WaveformObject, ...)

Comments are welcome,

 José Antonio

Leonardo M. Ramé

unread,
Jul 17, 2015, 7:54:39 AM7/17/15
to cornerston...@googlegroups.com, josea...@gmail.com
Wow, looks great!.

JF Pambrun

unread,
Jul 17, 2015, 9:53:32 AM7/17/15
to Leonardo M. Ramé, cornerston...@googlegroups.com, josea...@gmail.com
It looks awesome! The result is clean and professional.

However, on my workstation, it takes 6 seconds to display anything and the cursor is misaligned. 
I think D3 issue #172[1] is related since you have 20,000+ data points on the page. It seems ~500 is the about upper limit for good performance. 



--
You received this message because you are subscribed to the Google Groups "cornerstone platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cornerstone-plat...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cornerstone-platform/5a28e188-a7bd-4ce6-8746-1dc968c6373a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chris Hafey

unread,
Jul 17, 2015, 12:15:56 PM7/17/15
to cornerston...@googlegroups.com, josea...@gmail.com, josea...@gmail.com
Nice work!!!

José Antonio Pérez

unread,
Jul 20, 2015, 3:12:32 AM7/20/15
to cornerston...@googlegroups.com, marti...@gmail.com
Hello,

You are right. The current version loads the whole set of samples for the 12 leads. In some of the waveform samples that I am working with, this means about 150000 samples.
This translates in a slow initialization when the C3 library loads these big amounts of data to display.

May I have to consider implementing some type of subsampling in the future, but at the moment I still have many issues and functionalities to implement previously to this one.

 José Antonio

Vivek Patel

unread,
Dec 31, 2016, 5:11:14 AM12/31/16
to cornerstone platform
How can i load non dicom image to cornerstone dicom image viewer

Or is there any way to save dicom image in dicom format from canvas in cornerstone

Please do the needfully. 

Thanks in advance
Vivek Patel

Ludwig Moreno

unread,
Jul 12, 2020, 4:16:26 PM7/12/20
to cornerstone platform
Hi!
I just found this repo and thought it could be helpful to list it here

Reply all
Reply to author
Forward
0 new messages