Update cornerstone to v0.10.2
Update cornerstoneTools to v0.8.3
This commit is contained in:
parent
710d7c9a02
commit
7035469b91
@ -1,4 +1,4 @@
|
||||
/*! cornerstone - v0.10.1 - 2017-02-11 | (c) 2014 Chris Hafey | https://github.com/chafey/cornerstone */
|
||||
/*! cornerstone - v0.10.2 - 2017-02-21 | (c) 2014 Chris Hafey | https://github.com/chafey/cornerstone */
|
||||
if(typeof cornerstone === 'undefined'){
|
||||
cornerstone = {
|
||||
internal : {},
|
||||
@ -55,6 +55,7 @@ if(typeof cornerstone === 'undefined'){
|
||||
|
||||
// remove the child dom elements that we created (e.g.canvas)
|
||||
enabledElements[i].element.removeChild(enabledElements[i].canvas);
|
||||
enabledElements[i].canvas = undefined;
|
||||
|
||||
// remove this element from the list of enabled elements
|
||||
enabledElements.splice(i, 1);
|
||||
@ -203,12 +204,46 @@ if(typeof cornerstone === 'undefined'){
|
||||
canvas: canvas,
|
||||
image : undefined, // will be set once image is loaded
|
||||
invalid: false, // true if image needs to be drawn, false if not
|
||||
needsRedraw:true,
|
||||
data : {}
|
||||
};
|
||||
cornerstone.addEnabledElement(el);
|
||||
|
||||
cornerstone.resize(element, true);
|
||||
|
||||
|
||||
function draw() {
|
||||
if (el.canvas === undefined){
|
||||
return;
|
||||
}
|
||||
if (el.needsRedraw && el.image !== undefined){
|
||||
var start = new Date();
|
||||
el.image.render(el, el.invalid);
|
||||
|
||||
var context = el.canvas.getContext('2d');
|
||||
|
||||
var end = new Date();
|
||||
var diff = end - start;
|
||||
|
||||
var eventData = {
|
||||
viewport: el.viewport,
|
||||
element: el.element,
|
||||
image: el.image,
|
||||
enabledElement: el,
|
||||
canvasContext: context,
|
||||
renderTimeInMs: diff
|
||||
};
|
||||
|
||||
$(el.element).trigger("CornerstoneImageRendered", eventData);
|
||||
el.invalid = false;
|
||||
el.needsRedraw = false;
|
||||
}
|
||||
|
||||
cornerstone.requestAnimationFrame(draw);
|
||||
}
|
||||
|
||||
draw();
|
||||
|
||||
return element;
|
||||
}
|
||||
|
||||
@ -880,28 +915,11 @@ if(typeof cornerstone === 'undefined'){
|
||||
* @param invalidated - true if pixel data has been invalidated and cached rendering should not be used
|
||||
*/
|
||||
function drawImage(enabledElement, invalidated) {
|
||||
enabledElement.needsRedraw = true;
|
||||
if (invalidated){
|
||||
enabledElement.invalid = true;
|
||||
}
|
||||
|
||||
var start = new Date();
|
||||
|
||||
enabledElement.image.render(enabledElement, invalidated);
|
||||
|
||||
var context = enabledElement.canvas.getContext('2d');
|
||||
|
||||
var end = new Date();
|
||||
var diff = end - start;
|
||||
//console.log(diff + ' ms');
|
||||
|
||||
var eventData = {
|
||||
viewport : enabledElement.viewport,
|
||||
element : enabledElement.element,
|
||||
image : enabledElement.image,
|
||||
enabledElement : enabledElement,
|
||||
canvasContext: context,
|
||||
renderTimeInMs : diff
|
||||
};
|
||||
|
||||
$(enabledElement.element).trigger("CornerstoneImageRendered", eventData);
|
||||
enabledElement.invalid = false;
|
||||
}
|
||||
|
||||
// Module exports
|
||||
@ -1158,6 +1176,32 @@ if(typeof cornerstone === 'undefined'){
|
||||
|
||||
}(cornerstone));
|
||||
|
||||
/**
|
||||
* This module polyfills requestAnimationFrame for older browsers.
|
||||
*/
|
||||
|
||||
|
||||
(function (cornerstone) {
|
||||
|
||||
'use strict';
|
||||
|
||||
function requestFrame(callback) {
|
||||
window.setTimeout(callback, 1000 / 60);
|
||||
}
|
||||
|
||||
function requestAnimationFrame(callback) {
|
||||
return window.requestAnimationFrame(callback) ||
|
||||
window.webkitRequestAnimationFrame(callback) ||
|
||||
window.mozRequestAnimationFrame(callback) ||
|
||||
window.oRequestAnimationFrame(callback) ||
|
||||
window.msRequestAnimationFrame(callback) ||
|
||||
requestFrame(callback);
|
||||
}
|
||||
|
||||
// Module exports
|
||||
cornerstone.requestAnimationFrame = requestAnimationFrame;
|
||||
|
||||
})(cornerstone);
|
||||
/**
|
||||
* This module contains a function to convert stored pixel values to display pixel values using a LUT
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*! cornerstoneTools - v0.8.1 - 2017-02-11 | (c) 2014 Chris Hafey | https://github.com/chafey/cornerstoneTools */
|
||||
/*! cornerstoneTools - v0.8.3 - 2017-02-21 | (c) 2014 Chris Hafey | https://github.com/chafey/cornerstoneTools */
|
||||
// Begin Source: src/header.js
|
||||
if (typeof cornerstone === 'undefined') {
|
||||
cornerstone = {};
|
||||
@ -2634,7 +2634,7 @@ if (typeof cornerstoneTools === 'undefined') {
|
||||
stackData.currentImageIdIndex = newImageIdIndex;
|
||||
cornerstone.displayImage(targetElement, image, viewport);
|
||||
if (endLoadingHandler) {
|
||||
endLoadingHandler(targetElement);
|
||||
endLoadingHandler(targetElement, image);
|
||||
}
|
||||
}, function(error) {
|
||||
var imageId = stackData.imageIds[newImageIdIndex];
|
||||
@ -8092,7 +8092,7 @@ if (typeof cornerstoneTools === 'undefined') {
|
||||
cornerstone.updateImage(enabledElement.element);
|
||||
|
||||
// Request a new frame
|
||||
cornerstoneTools.requestAnimFrame(function() {
|
||||
cornerstone.requestAnimationFrame(function() {
|
||||
animate(time, handle, runAnimation, enabledElement, targetLocation);
|
||||
});
|
||||
}
|
||||
@ -8822,7 +8822,7 @@ if (typeof cornerstoneTools === 'undefined') {
|
||||
stackData.currentImageIdIndex = newImageIdIndex;
|
||||
cornerstone.displayImage(element, image, viewport);
|
||||
if (endLoadingHandler) {
|
||||
endLoadingHandler(element);
|
||||
endLoadingHandler(element, image);
|
||||
}
|
||||
}, function(error) {
|
||||
var imageId = stackData.imageIds[newImageIdIndex];
|
||||
@ -10236,7 +10236,7 @@ Display scroll progress bar across bottom of image.
|
||||
targetStackData.currentImageIdIndex = newImageIdIndex;
|
||||
synchronizer.displayImage(targetElement, image, viewport);
|
||||
if (endLoadingHandler) {
|
||||
endLoadingHandler(targetElement);
|
||||
endLoadingHandler(targetElement, image);
|
||||
}
|
||||
}, function(error) {
|
||||
var imageId = targetStackData.imageIds[newImageIdIndex];
|
||||
@ -10321,7 +10321,7 @@ Display scroll progress bar across bottom of image.
|
||||
stackData.currentImageIdIndex = newImageIdIndex;
|
||||
synchronizer.displayImage(targetElement, image, viewport);
|
||||
if (endLoadingHandler) {
|
||||
endLoadingHandler(targetElement);
|
||||
endLoadingHandler(targetElement, image);
|
||||
}
|
||||
}, function(error) {
|
||||
var imageId = stackData.imageIds[newImageIdIndex];
|
||||
@ -10398,7 +10398,7 @@ Display scroll progress bar across bottom of image.
|
||||
stackData.currentImageIdIndex = newImageIdIndex;
|
||||
synchronizer.displayImage(targetElement, image, viewport);
|
||||
if (endLoadingHandler) {
|
||||
endLoadingHandler(targetElement);
|
||||
endLoadingHandler(targetElement, image);
|
||||
}
|
||||
}, function(error) {
|
||||
var imageId = stackData.imageIds[newImageIdIndex];
|
||||
@ -10469,7 +10469,7 @@ Display scroll progress bar across bottom of image.
|
||||
stackData.currentImageIdIndex = newImageIdIndex;
|
||||
synchronizer.displayImage(targetElement, image, viewport);
|
||||
if (endLoadingHandler) {
|
||||
endLoadingHandler(targetElement);
|
||||
endLoadingHandler(targetElement, image);
|
||||
}
|
||||
}, function(error) {
|
||||
var imageId = stackData.imageIds[newImageIdIndex];
|
||||
@ -10991,7 +10991,7 @@ Display scroll progress bar across bottom of image.
|
||||
timeSeriesData.currentStackIndex = newStackIndex;
|
||||
cornerstone.displayImage(element, image, viewport);
|
||||
if (endLoadingHandler) {
|
||||
endLoadingHandler(element);
|
||||
endLoadingHandler(element, image);
|
||||
}
|
||||
}
|
||||
}, function(error) {
|
||||
@ -11182,23 +11182,6 @@ Display scroll progress bar across bottom of image.
|
||||
|
||||
// End Source; src/timeSeriesTools/timeSeriesScroll.js
|
||||
|
||||
// Begin Source: src/util/RoundToDecimal.js
|
||||
(function($, cornerstone, cornerstoneTools) {
|
||||
|
||||
'use strict';
|
||||
|
||||
function roundToDecimal(value, precision) {
|
||||
var multiplier = Math.pow(10, precision);
|
||||
return (Math.round(value * multiplier) / multiplier);
|
||||
}
|
||||
|
||||
// module exports
|
||||
cornerstoneTools.roundToDecimal = roundToDecimal;
|
||||
|
||||
})($, cornerstone, cornerstoneTools);
|
||||
|
||||
// End Source; src/util/RoundToDecimal.js
|
||||
|
||||
// Begin Source: src/util/calculateSUV.js
|
||||
(function(cornerstoneTools) {
|
||||
|
||||
@ -11865,17 +11848,10 @@ Display scroll progress bar across bottom of image.
|
||||
|
||||
'use strict';
|
||||
|
||||
function requestFrame(callback) {
|
||||
window.setTimeout(callback, 1000 / 60);
|
||||
}
|
||||
|
||||
function requestAnimFrame(callback) {
|
||||
return window.requestAnimationFrame(callback) ||
|
||||
window.webkitRequestAnimationFrame(callback) ||
|
||||
window.mozRequestAnimationFrame(callback) ||
|
||||
window.oRequestAnimationFrame(callback) ||
|
||||
window.msRequestAnimationFrame(callback) ||
|
||||
requestFrame(callback);
|
||||
// This functionality was moved to cornerstone.
|
||||
console.warn('cornerstoneTools.requestAnimFrame() is deprecated, consider using cornerstone.requestAnimationFrame()');
|
||||
cornerstone.requestAnimationFrame(callback);
|
||||
}
|
||||
|
||||
// Module exports
|
||||
@ -11885,6 +11861,23 @@ Display scroll progress bar across bottom of image.
|
||||
|
||||
// End Source; src/util/requestAnimFrame.js
|
||||
|
||||
// Begin Source: src/util/RoundToDecimal.js
|
||||
(function($, cornerstone, cornerstoneTools) {
|
||||
|
||||
'use strict';
|
||||
|
||||
function roundToDecimal(value, precision) {
|
||||
var multiplier = Math.pow(10, precision);
|
||||
return (Math.round(value * multiplier) / multiplier);
|
||||
}
|
||||
|
||||
// module exports
|
||||
cornerstoneTools.roundToDecimal = roundToDecimal;
|
||||
|
||||
})($, cornerstone, cornerstoneTools);
|
||||
|
||||
// End Source; src/util/RoundToDecimal.js
|
||||
|
||||
// Begin Source: src/util/scroll.js
|
||||
(function(cornerstone, cornerstoneTools) {
|
||||
|
||||
@ -11951,7 +11944,7 @@ Display scroll progress bar across bottom of image.
|
||||
|
||||
cornerstone.displayImage(element, image, viewport);
|
||||
if (endLoadingHandler) {
|
||||
endLoadingHandler(element);
|
||||
endLoadingHandler(element, image);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user