2017-01-16 18:30:54 +01:00
|
|
|
import { viewportUtils } from './viewportUtils';
|
|
|
|
|
|
2015-12-09 15:48:24 +01:00
|
|
|
/**
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
2017-01-16 18:30:54 +01:00
|
|
|
export function switchToImageRelative(distanceFromCurrentIndex) {
|
|
|
|
|
var element = viewportUtils.getActiveViewportElement();
|
2015-12-09 15:48:24 +01:00
|
|
|
cornerstoneTools.scroll(element, distanceFromCurrentIndex);
|
2017-01-16 18:30:54 +01:00
|
|
|
}
|