LT-332: Fixed tool color and shadow for target tool. Moved client-only utilities to client-folder in viewerbase to speed up reloading
This commit is contained in:
1 parent
c04c70b325
commit
8cf6666bb1
46 files changed
+67
-57
No files matched your search
@@ -187,10 +187,8 @@ import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
var color;
|
||||
var lineWidth = cornerstoneTools.toolStyle.getToolWidth();
|
||||
var font = cornerstoneTools.textStyle.getFont();
|
||||
var config = cornerstoneTools.nonTarget.getConfiguration();
|
||||
|
||||
context.font = font;
|
||||
for (var i = 0; i < toolData.data.length; i++) {
|
||||
var data = toolData.data[i];
|
||||
|
||||
@@ -198,9 +196,9 @@ import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
// configurable shadow from CornerstoneTools
|
||||
if (config && config.shadow) {
|
||||
context.shadowColor = '#000000';
|
||||
context.shadowOffsetX = 1;
|
||||
context.shadowOffsetY = 1;
|
||||
context.shadowColor = config.shadowColor || '#000000';
|
||||
context.shadowOffsetX = config.shadowOffsetX || 1;
|
||||
context.shadowOffsetY = config.shadowOffsetY || 1;
|
||||
}
|
||||
|
||||
if (data.active) {
|
||||
|
||||
@@ -249,10 +249,8 @@
|
||||
|
||||
var color;
|
||||
var lineWidth = cornerstoneTools.toolStyle.getToolWidth();
|
||||
var font = cornerstoneTools.textStyle.getFont();
|
||||
var config = cornerstoneTools[toolType].getConfiguration();
|
||||
|
||||
context.font = font;
|
||||
for (var i = 0; i < toolData.data.length; i++) {
|
||||
var data = toolData.data[i];
|
||||
|
||||
@@ -260,9 +258,9 @@
|
||||
|
||||
// configurable shadow from CornerstoneTools
|
||||
if (config && config.shadow) {
|
||||
context.shadowColor = '#000000';
|
||||
context.shadowOffsetX = 1;
|
||||
context.shadowOffsetY = 1;
|
||||
context.shadowColor = config.shadowColor || '#000000';
|
||||
context.shadowOffsetX = config.shadowOffsetX || 1;
|
||||
context.shadowOffsetY = config.shadowOffsetY || 1;
|
||||
}
|
||||
|
||||
if (data.active) {
|
||||
|
||||
+10
-1
@@ -50,13 +50,22 @@ Template.measurementLocationDialog.onCreated(() => {
|
||||
});
|
||||
};
|
||||
|
||||
const config = {
|
||||
const callbackConfig = {
|
||||
setMeasurementNumberCallback: getSetMeasurementNumberCallbackFunction(measurementTypeId, measurementApi, timepointApi),
|
||||
// TODO: Check the position for these, the Add Label button position seems very awkward
|
||||
getMeasurementLocationCallback: toggleLabel,
|
||||
changeMeasurementLocationCallback: toggleLabel,
|
||||
};
|
||||
|
||||
|
||||
// TODO: Reconcile this with the configuration in toolManager
|
||||
// it would be better to have this all in one place.
|
||||
const bidirectionalConfig = cornerstoneTools.bidirectional.getConfiguration();
|
||||
const config = {
|
||||
...bidirectionalConfig,
|
||||
...callbackConfig
|
||||
};
|
||||
|
||||
cornerstoneTools.bidirectional.setConfiguration(config);
|
||||
|
||||
// Set CR-Tool, UN-Tool, EX-Tool configurations
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+10
-5
@@ -32,25 +32,30 @@ function configureTools() {
|
||||
// Set text box background color
|
||||
textStyle.setBackgroundColor('transparent');
|
||||
|
||||
// Set the tool font and font size
|
||||
// context.font = "[style] [variant] [weight] [size]/[line height] [font family]";
|
||||
const fontFamily = 'Roboto, OpenSans, HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif';
|
||||
textStyle.setFont('15px ' + fontFamily);
|
||||
|
||||
// Set the tool width
|
||||
toolStyle.setToolWidth(2);
|
||||
|
||||
// Set color for inactive tools
|
||||
toolColors.setToolColor('#ff00ff'); //rgb(255, 255, 0)');
|
||||
toolColors.setToolColor('rgb(255, 255, 0)');
|
||||
|
||||
// Set color for active tools
|
||||
toolColors.setActiveColor('#00ffff'); //rgb(0, 255, 0)'
|
||||
toolColors.setActiveColor('rgb(0, 255, 0)');
|
||||
|
||||
// Set shadow configuration for length and bidirectional text boxes
|
||||
const shadowConfig = {
|
||||
shadow: true,
|
||||
shadowColor: '#000',
|
||||
shadowColor: '#000000',
|
||||
shadowOffsetX: 1,
|
||||
shadowOffsetY: 1
|
||||
};
|
||||
|
||||
// Get some tools config to not override them
|
||||
/*const lengthConfig = length.getConfiguration();
|
||||
const lengthConfig = length.getConfiguration();
|
||||
const bidirectionalConfig = bidirectional.getConfiguration();
|
||||
const ellipticalRoiConfig = ellipticalRoi.getConfiguration();
|
||||
const nonTargetConfig = nonTarget.getConfiguration();
|
||||
@@ -77,7 +82,7 @@ function configureTools() {
|
||||
nonTarget.setConfiguration({
|
||||
...nonTargetConfig,
|
||||
...shadowConfig
|
||||
});*/
|
||||
});
|
||||
|
||||
// Set the configuration values for the text annotation (Arrow) tool
|
||||
const annotateConfig = {
|
||||
File renamed without changes.
File renamed without changes.
@@ -141,31 +141,31 @@ Package.onUse(function(api) {
|
||||
|
||||
|
||||
// Library functions
|
||||
api.addFiles('lib/layoutManager.js', 'client');
|
||||
api.addFiles('lib/createStacks.js', 'client');
|
||||
api.addFiles('lib/getImageId.js', 'client');
|
||||
api.addFiles('lib/getWADORSImageId.js', 'client');
|
||||
api.addFiles('lib/metaDataProvider.js', 'client');
|
||||
api.addFiles('lib/sortStudy.js', 'client');
|
||||
api.addFiles('lib/toolManager.js', 'client');
|
||||
api.addFiles('lib/enablePrefetchOnElement.js', 'client');
|
||||
api.addFiles('lib/displayReferenceLines.js', 'client');
|
||||
api.addFiles('lib/toggleDialog.js', 'client');
|
||||
api.addFiles('lib/setActiveViewport.js', 'client');
|
||||
api.addFiles('lib/switchToImageByIndex.js', 'client');
|
||||
api.addFiles('lib/switchToImageRelative.js', 'client');
|
||||
api.addFiles('lib/enableHotkeys.js', 'client');
|
||||
api.addFiles('lib/viewportFunctions.js', 'client');
|
||||
api.addFiles('lib/WLPresets.js', 'client');
|
||||
api.addFiles('lib/resizeViewportElements.js', 'client');
|
||||
api.addFiles('lib/setFocusToActiveViewport.js', 'client');
|
||||
api.addFiles('lib/updateAllViewports.js', 'client');
|
||||
api.addFiles('client/lib/layoutManager.js', 'client');
|
||||
api.addFiles('client/lib/createStacks.js', 'client');
|
||||
api.addFiles('client/lib/getImageId.js', 'client');
|
||||
api.addFiles('client/lib/getWADORSImageId.js', 'client');
|
||||
api.addFiles('client/lib/metaDataProvider.js', 'client');
|
||||
api.addFiles('client/lib/sortStudy.js', 'client');
|
||||
api.addFiles('client/lib/toolManager.js', 'client');
|
||||
api.addFiles('client/lib/enablePrefetchOnElement.js', 'client');
|
||||
api.addFiles('client/lib/displayReferenceLines.js', 'client');
|
||||
api.addFiles('client/lib/toggleDialog.js', 'client');
|
||||
api.addFiles('client/lib/setActiveViewport.js', 'client');
|
||||
api.addFiles('client/lib/switchToImageByIndex.js', 'client');
|
||||
api.addFiles('client/lib/switchToImageRelative.js', 'client');
|
||||
api.addFiles('client/lib/enableHotkeys.js', 'client');
|
||||
api.addFiles('client/lib/viewportFunctions.js', 'client');
|
||||
api.addFiles('client/lib/WLPresets.js', 'client');
|
||||
api.addFiles('client/lib/resizeViewportElements.js', 'client');
|
||||
api.addFiles('client/lib/setFocusToActiveViewport.js', 'client');
|
||||
api.addFiles('client/lib/updateAllViewports.js', 'client');
|
||||
|
||||
api.addFiles('lib/instanceClassSpecificViewport.js', 'client');
|
||||
api.addFiles('lib/setMammogramViewportAlignment.js', 'client');
|
||||
api.addFiles('lib/isImage.js', 'client');
|
||||
api.addFiles('lib/sopClassDictionary.js', 'client');
|
||||
api.addFiles('lib/debugReactivity.js', 'client');
|
||||
api.addFiles('client/lib/instanceClassSpecificViewport.js', 'client');
|
||||
api.addFiles('client/lib/setMammogramViewportAlignment.js', 'client');
|
||||
api.addFiles('client/lib/isImage.js', 'client');
|
||||
api.addFiles('client/lib/sopClassDictionary.js', 'client');
|
||||
api.addFiles('client/lib/debugReactivity.js', 'client');
|
||||
|
||||
api.export('resizeViewportElements', 'client');
|
||||
api.export('handleResize', 'client');
|
||||
@@ -203,26 +203,26 @@ Package.onUse(function(api) {
|
||||
|
||||
// UI Helpers
|
||||
api.addFiles([
|
||||
'lib/helpers/formatDA.js',
|
||||
'lib/helpers/formatJSDate.js',
|
||||
'lib/helpers/jsDateFromNow.js',
|
||||
'lib/helpers/formatNumberPrecision.js',
|
||||
'lib/helpers/formatTM.js',
|
||||
'lib/helpers/inc.js',
|
||||
'lib/helpers/isDisplaySetActive.js',
|
||||
'lib/helpers/getUsername.js',
|
||||
'lib/helpers/capitalizeFirstLetter.js',
|
||||
'lib/helpers/objectToPairs.js',
|
||||
'lib/helpers/objectEach.js',
|
||||
'lib/helpers/ifTypeIs.js',
|
||||
'lib/helpers/prettyPrintStringify.js',
|
||||
'lib/helpers/sorting.js',
|
||||
'lib/helpers/studyThumbnails.js',
|
||||
'lib/helpers/formatPN.js'
|
||||
'client/lib/helpers/formatDA.js',
|
||||
'client/lib/helpers/formatJSDate.js',
|
||||
'client/lib/helpers/jsDateFromNow.js',
|
||||
'client/lib/helpers/formatNumberPrecision.js',
|
||||
'client/lib/helpers/formatTM.js',
|
||||
'client/lib/helpers/inc.js',
|
||||
'client/lib/helpers/isDisplaySetActive.js',
|
||||
'client/lib/helpers/getUsername.js',
|
||||
'client/lib/helpers/capitalizeFirstLetter.js',
|
||||
'client/lib/helpers/objectToPairs.js',
|
||||
'client/lib/helpers/objectEach.js',
|
||||
'client/lib/helpers/ifTypeIs.js',
|
||||
'client/lib/helpers/prettyPrintStringify.js',
|
||||
'client/lib/helpers/sorting.js',
|
||||
'client/lib/helpers/studyThumbnails.js',
|
||||
'client/lib/helpers/formatPN.js'
|
||||
], 'client');
|
||||
api.export('formatPN', 'client');
|
||||
|
||||
api.addFiles('lib/helpers/isTouchDevice.js', 'client');
|
||||
api.addFiles('client/lib/helpers/isTouchDevice.js', 'client');
|
||||
api.export('isTouchDevice', 'client');
|
||||
|
||||
// TODO: Clean this up later, no real need to export these
|
||||
|
||||
Reference in new issue
Block a user