What is the difference between a CornerstoneJS viewport and an image object?

111 views Asked by At

CornerstoneJS is a JavaScript library for displaying medical images in web browsers. We are using this tool within our Deep Learning (DL) projects, and have some specific questions. The CornerstoneJS documentation does not provide a clear relationship between the viewports and the image object.

In addition, the viewports can be created by simply:

const element = document.createElement('div');

document.body.appendChild(element);

const viewport = cornerstone.getDefaultViewportForImage(element, image);

cornerstone.displayImage(element, image, viewport);

On the contrary, the image object can be defined by:

var imageId = 'https://example.com/image.dcm';
var image = new conerstone.Image();

image.imageId = imageId;

Therefore, the following question arises:

What is the difference between a CornerstoneJS viewport and an image object?

We tried to understand the particular use cases to use an image object with and without the viewports of the CornerstoneJS library. From here, we could not understand the benefits of using the CornerstoneJS viewports instead of using the image object only with our self-developed "viewports" option. Therefore, we would like to understand the relationship between both of them so that we could consider using them instead our solution.

0

There are 0 answers