ohif-viewer/Packages/viewerbase/lib/switchToImageRelative.js
2015-12-09 15:48:24 +01:00

14 lines
503 B
JavaScript

/**
* This function switches to an image given an element and
* the relative distance from the current image in the stack
*
* e.g. switchToImageRelative(element, -1) to switch to currentImageIdIndex - 1
*
* @param element
* @param {number} [distanceFromCurrentIndex] The image index in the stack to switch to.
*/
switchToImageRelative = function(distanceFromCurrentIndex) {
var element = getActiveViewportElement();
cornerstoneTools.scroll(element, distanceFromCurrentIndex);
};