Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function resetRenderer() {
if (!model.container) {
return;
}
if (model.representation) {
// store current representation on cornerstone element
cornerstone.getElementData(
model.container,
GLANCE_DATA
).currentRepresentation =
model.representation;
// do a first render with a viewport reset
publicAPI.render(true);
if (model.toolManager) {
model.toolManager.setupElement(model.container);
}
} else {
publicAPI.renderBlankImage();
if (model.toolManager) {
model.toolManager.teardownElement(model.container);
}