LT-301: Addeing Stack Scroll, Reset, Rotate, Flip H, Flip V, Invert, Magnify, Elliptical ROI, Clear and Toggle CINE dialog buttons to More Tools panel

This commit is contained in:
Eloízio Salgado authored and Erik Ziegler committed 2016-11-15 08:29:46 +01:00
1 parent 5d02b76453
commit c004aee40f
10 files changed
+179 -6

No files matched your search

+14 -2
View File
@@ -18,8 +18,8 @@ var initialized = false;
function configureTools() {
// Get Cornerstone Tools
const { panMultiTouch, textStyle, toolStyle, toolColors,
length, bidirectional, arrowAnnotate, zoom } = cornerstoneTools;
const { panMultiTouch, textStyle, toolStyle, toolColors, length,
bidirectional, arrowAnnotate, zoom, ellipticalRoi } = cornerstoneTools;
// Set the configuration for the multitouch pan tool
const multiTouchPanConfig = {
@@ -52,6 +52,7 @@ function configureTools() {
// Get some tools config to not override them
const lengthConfig = length.getConfiguration();
const bidirectionalConfig = bidirectional.getConfiguration();
const ellipticalRoiConfig = ellipticalRoi.getConfiguration();
// Add shadow to length tool
length.setConfiguration({
@@ -65,6 +66,12 @@ function configureTools() {
...shadowConfig
});
// Add shadow to length tool
ellipticalRoi.setConfiguration({
...ellipticalRoiConfig,
...shadowConfig
});
// Set the configuration values for the text annotation (Arrow) tool
const annotateConfig = {
getTextCallback: getAnnotationTextCallback,
@@ -132,6 +139,11 @@ toolManager = {
touch: cornerstoneTools.arrowAnnotateTouch
});
toolManager.addTool('rotate', {
mouse: cornerstoneTools.rotate,
touch: cornerstoneTools.rotateTouchDrag
});
if (OHIF.viewer.defaultTool) {
activeTool = OHIF.viewer.defaultTool;
}
@@ -198,6 +198,44 @@ hasMultipleFrames = () => {
return true;
}
if(clipState) {
// Return true if the clip is playing
return !_.isUndefined(clipState.intervalId);
}
return false;
};
// Check if a study has multiple frames
hasMultipleFrames = () => {
// Its called everytime active viewport and/or layout change
Session.get('activeViewport');
Session.get('LayoutManagerUpdated');
const activeViewport = getActiveViewportElement();
// No active viewport yet: disable button
if(!activeViewport) {
return true;
}
// Get images in the stack
const stackToolData = cornerstoneTools.getToolState(activeViewport, 'stack');
// No images in the stack, so disable button
if (!stackToolData || !stackToolData.data || !stackToolData.data.length) {
return true;
}
// Get number of images in the stack
const stackData = stackToolData.data[0];
const nImages = stackData.imageIds && stackData.imageIds.length ? stackData.imageIds.length : 1;
// Stack has just one image, so disable button
if(nImages === 1) {
return true;
}
return false;
};