Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
zoomout = /* istanbul ignore next */ () => {
const cornerstoneElement = this.getImgBlock();
const viewport = cornerstone.getViewport(cornerstoneElement);
if (viewport.scale > 0.1) {
viewport.scale -= 0.1;
cornerstone.setViewport(cornerstoneElement, viewport);
}
};
flipViewportVertical: ({ viewports }) => {
const enabledElement = getEnabledElement(viewports.activeViewportIndex);
if (enabledElement) {
let viewport = cornerstone.getViewport(enabledElement);
viewport.vflip = !viewport.vflip;
cornerstone.setViewport(enabledElement, viewport);
}
},
scaleViewport: ({ direction, viewports }) => {
zoom_changed: function () {
this.viewport.scale = this.model.get('img_scale');
cs.setViewport(this.viewer, this.viewport);
}
});
cornerstone.loadImage(enabledElement.image.imageId).then(image => {
cornerstone.displayImage(viewportElement, image);
cornerstone.setViewport(viewportElement, viewport);
cornerstone.resize(viewportElement, true);
const newWidth = Math.min(width || image.width, MAX_TEXTURE_SIZE);
const newHeight = Math.min(
height || image.height,
MAX_TEXTURE_SIZE
);
resolve({ image, width: newWidth, height: newHeight });
});
}