getDefaultViewportForImage api - cornerstonejs/cornerstone GitHub Wiki

The getDefaultViewportForImage api call is used to calculate the default Viewport if an image were to be displayed in an enabled element. The default Viewport will set the ww/wc to the default values from the image object and reset the transform so the image is fit to window.

function getDefaltViewportForImage(element, image);

Parameters:

  • element - the DOM element that is enabled
  • image - the image to use to calculate the default viewport

Returns: Viewport object