diff --git a/LesionTracker/client/components/toolbarSection/toolbarSection.js b/LesionTracker/client/components/toolbarSection/toolbarSection.js index 6fe77da8f..18cb39450 100644 --- a/LesionTracker/client/components/toolbarSection/toolbarSection.js +++ b/LesionTracker/client/components/toolbarSection/toolbarSection.js @@ -49,7 +49,7 @@ Template.toolbarSection.helpers({ toolbarButtons() { // Check if the measure tools shall be disabled const isToolDisabled = false; //!Template.instance().data.timepointApi; - + const buttonData = []; buttonData.push({ @@ -179,30 +179,29 @@ Template.toolbarSection.helpers({ }); // TODO: Get real icons for CR / UN / EX - /* Disabling these for now, since they aren't hooked up in the Lesion Tracker yet buttonData.push({ - id: 'crTool', - title: 'CR Tool', + id: 'targetCR', + title: 'CR Target', classes: 'imageViewerTool toolbarSectionButton', svgLink: '/packages/ohif_viewerbase/assets/icons.svg#icon-tools-measure-temp', disabled: isToolDisabled }); buttonData.push({ - id: 'unTool', - title: 'UN Tool', + id: 'targetUN', + title: 'UN Target', classes: 'imageViewerTool toolbarSectionButton', svgLink: '/packages/ohif_viewerbase/assets/icons.svg#icon-tools-measure-temp', disabled: isToolDisabled }); buttonData.push({ - id: 'exTool', - title: 'EX Tool', + id: 'targetEX', + title: 'EX Target', classes: 'imageViewerTool toolbarSectionButton', svgLink: '/packages/ohif_viewerbase/assets/icons.svg#icon-tools-measure-temp', disabled: isToolDisabled - });*/ + }); return buttonData; } diff --git a/Packages/ohif-lesiontracker/both/configuration/dataValidation.js b/Packages/ohif-lesiontracker/both/configuration/dataValidation.js index 7bf96cb41..07ff7e9d7 100644 --- a/Packages/ohif-lesiontracker/both/configuration/dataValidation.js +++ b/Packages/ohif-lesiontracker/both/configuration/dataValidation.js @@ -1,8 +1,8 @@ -import { bidirectional } from './bidirectional'; +import { target } from './target'; import { nonTarget } from './nonTarget'; import { length } from './length'; import { ellipse } from './ellipse'; export const validateMeasurements = () => { - console.log('validateMeasurements'); -}; \ No newline at end of file + console.log('validateMeasurements'); +}; diff --git a/Packages/ohif-lesiontracker/both/configuration/measurementTools.js b/Packages/ohif-lesiontracker/both/configuration/measurementTools.js index d3f103d35..d444553bc 100644 --- a/Packages/ohif-lesiontracker/both/configuration/measurementTools.js +++ b/Packages/ohif-lesiontracker/both/configuration/measurementTools.js @@ -1,11 +1,15 @@ -import { bidirectional } from './bidirectional'; +import { target } from './target'; +import { targetCR } from './targetCR'; +import { targetUN } from './targetUN'; import { nonTarget } from './nonTarget'; import { length } from './length'; import { ellipse } from './ellipse'; export const measurementTools = [ - bidirectional, - nonTarget, - length, - ellipse -]; \ No newline at end of file + target, + targetCR, + targetUN, + nonTarget, + length, + ellipse +]; diff --git a/Packages/ohif-lesiontracker/both/configuration/bidirectional.js b/Packages/ohif-lesiontracker/both/configuration/target.js similarity index 90% rename from Packages/ohif-lesiontracker/both/configuration/bidirectional.js rename to Packages/ohif-lesiontracker/both/configuration/target.js index efec48106..9f3fb7541 100644 --- a/Packages/ohif-lesiontracker/both/configuration/bidirectional.js +++ b/Packages/ohif-lesiontracker/both/configuration/target.js @@ -3,7 +3,7 @@ import { MeasurementSchemaTypes } from 'meteor/ohif:measurements/both/schema/mea const CornerstoneHandleSchema = MeasurementSchemaTypes.CornerstoneHandleSchema; -const BidirectionalHandlesSchema = new SimpleSchema({ +const TargetHandlesSchema = new SimpleSchema({ start: { type: CornerstoneHandleSchema, label: 'Start' @@ -26,9 +26,9 @@ const BidirectionalHandlesSchema = new SimpleSchema({ }, }); -const BidirectionalSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneToolMeasurement, { +const TargetSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneToolMeasurement, { handles: { - type: BidirectionalHandlesSchema, + type: TargetHandlesSchema, label: 'Handles' }, location: { @@ -81,14 +81,15 @@ function displayFunction(data) { return data.longestDiameter; } -export const bidirectional = { +export const target = { id: 'targets', name: 'Targets', cornerstoneToolType: 'bidirectional', - schema: BidirectionalSchema, + schema: TargetSchema, options: { showInMeasurementTable: true, measurementTableOptions: { + key: 'targets', displayFunction: displayFunction }, includeInCaseProgress: true, diff --git a/Packages/ohif-lesiontracker/both/configuration/targetCR.js b/Packages/ohif-lesiontracker/both/configuration/targetCR.js new file mode 100644 index 000000000..0800324ff --- /dev/null +++ b/Packages/ohif-lesiontracker/both/configuration/targetCR.js @@ -0,0 +1,56 @@ +import { SimpleSchema } from 'meteor/aldeed:simple-schema'; +import { MeasurementSchemaTypes } from 'meteor/ohif:measurements/both/schema/measurements'; + +const CornerstoneHandleSchema = MeasurementSchemaTypes.CornerstoneHandleSchema; + +const TargetCRHandlesSchema = new SimpleSchema({ + start: { + type: CornerstoneHandleSchema, + label: 'Start' + }, + end: { + type: CornerstoneHandleSchema, + label: 'End' + }, + textBox: { + type: CornerstoneHandleSchema, + label: 'Text Box' + } +}); + +const TargetCRSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneToolMeasurement, { + handles: { + type: TargetCRHandlesSchema, + label: 'Handles' + }, + location: { + type: String, + label: 'Location', + optional: true + }, + description: { + type: String, + label: 'Description', + optional: true + }, + locationUid: { + type: String, + label: 'Location UID', + optional: true // Optional because it is added after initial drawing, via a callback + } +}]); + +function displayFunction(data) { + return data.location; +} + +export const targetCR = { + id: 'targetsCR', + memberOf: 'targets', + name: 'CR Targets', + cornerstoneToolType: 'targetCR', + schema: TargetCRSchema, + options: { + includeInCaseProgress: true, + } +}; diff --git a/Packages/ohif-lesiontracker/both/configuration/targetUN.js b/Packages/ohif-lesiontracker/both/configuration/targetUN.js new file mode 100644 index 000000000..9ab8963ed --- /dev/null +++ b/Packages/ohif-lesiontracker/both/configuration/targetUN.js @@ -0,0 +1,56 @@ +import { SimpleSchema } from 'meteor/aldeed:simple-schema'; +import { MeasurementSchemaTypes } from 'meteor/ohif:measurements/both/schema/measurements'; + +const CornerstoneHandleSchema = MeasurementSchemaTypes.CornerstoneHandleSchema; + +const TargetUNHandlesSchema = new SimpleSchema({ + start: { + type: CornerstoneHandleSchema, + label: 'Start' + }, + end: { + type: CornerstoneHandleSchema, + label: 'End' + }, + textBox: { + type: CornerstoneHandleSchema, + label: 'Text Box' + } +}); + +const TargetUNSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneToolMeasurement, { + handles: { + type: TargetUNHandlesSchema, + label: 'Handles' + }, + location: { + type: String, + label: 'Location', + optional: true + }, + description: { + type: String, + label: 'Description', + optional: true + }, + locationUid: { + type: String, + label: 'Location UID', + optional: true // Optional because it is added after initial drawing, via a callback + } +}]); + +function displayFunction(data) { + return data.location; +} + +export const targetUN = { + id: 'targetsUN', + memberOf: 'targets', + name: 'UN Targets', + cornerstoneToolType: 'targetUN', + schema: TargetUNSchema, + options: { + includeInCaseProgress: true, + } +}; diff --git a/Packages/ohif-lesiontracker/client/compatibility/deleteLesionKeyboardTool.js b/Packages/ohif-lesiontracker/client/compatibility/deleteLesionKeyboardTool.js index 06888f342..f30b6c7d4 100644 --- a/Packages/ohif-lesiontracker/client/compatibility/deleteLesionKeyboardTool.js +++ b/Packages/ohif-lesiontracker/client/compatibility/deleteLesionKeyboardTool.js @@ -80,7 +80,7 @@ if (keyCode === keys.DELETE || (keyCode === keys.D && eventData.event.ctrlKey === true)) { - var toolTypes = [ 'bidirectional', 'nonTarget', 'length', 'crTool', 'unTool', 'exTool']; + var toolTypes = [ 'bidirectional', 'nonTarget', 'length', 'targetCR', 'targetUN', 'targetEX']; var nearbyToolData = getNearbyToolData(eventData.element, eventData.currentPoints.canvas, toolTypes); if (!nearbyToolData) { diff --git a/Packages/ohif-lesiontracker/client/compatibility/qualitativeTargetTools.js b/Packages/ohif-lesiontracker/client/compatibility/qualitativeTargetTools.js index ae84fd72c..2c8b73911 100644 --- a/Packages/ohif-lesiontracker/client/compatibility/qualitativeTargetTools.js +++ b/Packages/ohif-lesiontracker/client/compatibility/qualitativeTargetTools.js @@ -2,13 +2,13 @@ 'use strict'; var responseByToolType = [{ - "toolType": "crTool", + "toolType": "targetCR", "toolResponse": "CR" }, { - "toolType": "unTool", + "toolType": "targetUN", "toolResponse": "UN" }, { - "toolType": "exTool", + "toolType": "targetEX", "toolResponse": "EX" }]; @@ -418,19 +418,19 @@ return toolInterface; } - var crToolInterface = createQualitativeTargetTool('crTool'); - cornerstoneTools.crTool = crToolInterface.mouse; - cornerstoneTools.crTool.setConfiguration(configuration); - cornerstoneTools.crToolTouch = crToolInterface.touch; + var targetCRInterface = createQualitativeTargetTool('targetCR'); + cornerstoneTools.targetCR = targetCRInterface.mouse; + cornerstoneTools.targetCR.setConfiguration(configuration); + cornerstoneTools.targetCRTouch = targetCRInterface.touch; - var unToolInterface = createQualitativeTargetTool('unTool'); - cornerstoneTools.unTool = unToolInterface.mouse; - cornerstoneTools.unTool.setConfiguration(configuration); - cornerstoneTools.unToolTouch = unToolInterface.touch; + var targetUNInterface = createQualitativeTargetTool('targetUN'); + cornerstoneTools.targetUN = targetUNInterface.mouse; + cornerstoneTools.targetUN.setConfiguration(configuration); + cornerstoneTools.targetUNTouch = targetUNInterface.touch; - var exToolInterface = createQualitativeTargetTool('exTool'); - cornerstoneTools.exTool = exToolInterface.mouse; - cornerstoneTools.exTool.setConfiguration(configuration); - cornerstoneTools.exToolTouch = exToolInterface.touch; + var targetEXInterface = createQualitativeTargetTool('targetEX'); + cornerstoneTools.targetEX = targetEXInterface.mouse; + cornerstoneTools.targetEX.setConfiguration(configuration); + cornerstoneTools.targetEXTouch = targetEXInterface.touch; -})($, cornerstone, cornerstoneMath, cornerstoneTools); \ No newline at end of file +})($, cornerstone, cornerstoneMath, cornerstoneTools); diff --git a/Packages/ohif-lesiontracker/client/components/measurementLocationDialog/measurementLocationDialog.js b/Packages/ohif-lesiontracker/client/components/measurementLocationDialog/measurementLocationDialog.js index 1fb976eb3..6b061723a 100644 --- a/Packages/ohif-lesiontracker/client/components/measurementLocationDialog/measurementLocationDialog.js +++ b/Packages/ohif-lesiontracker/client/components/measurementLocationDialog/measurementLocationDialog.js @@ -85,9 +85,9 @@ Template.measurementLocationDialog.onCreated(() => { cornerstoneTools.bidirectional.setConfiguration(config); // Set CR-Tool, UN-Tool, EX-Tool configurations - cornerstoneTools.crTool.setConfiguration(config); - cornerstoneTools.exTool.setConfiguration(config); - cornerstoneTools.unTool.setConfiguration(config); + cornerstoneTools.targetCR.setConfiguration(config); + cornerstoneTools.targetUN.setConfiguration(config); + cornerstoneTools.targetEX.setConfiguration(config); }); diff --git a/Packages/ohif-lesiontracker/client/lib/convertNonTarget.js b/Packages/ohif-lesiontracker/client/lib/convertNonTarget.js index eb8b85c14..e9ca53c29 100644 --- a/Packages/ohif-lesiontracker/client/lib/convertNonTarget.js +++ b/Packages/ohif-lesiontracker/client/lib/convertNonTarget.js @@ -1,9 +1,9 @@ import { OHIF } from 'meteor/ohif:core'; var responseTypes = { - crTool: 'CR', - exTool: 'EX', - unTool: 'UN' + targetCR: 'CR', + targetUN: 'UN', + targetEX: 'EX' }; convertNonTarget = function(measurementApi, measurementData, newTooltype) { diff --git a/Packages/ohif-lesiontracker/client/lib/toggleLesionTrackerTools.js b/Packages/ohif-lesiontracker/client/lib/toggleLesionTrackerTools.js index b85253c94..b884567c0 100644 --- a/Packages/ohif-lesiontracker/client/lib/toggleLesionTrackerTools.js +++ b/Packages/ohif-lesiontracker/client/lib/toggleLesionTrackerTools.js @@ -20,7 +20,7 @@ OHIF.lesiontracker.toggleLesionTrackerTools = () => { activate: [], //'deleteLesionKeyboardTool' deactivate: [], enable: [], - disable: [ 'bidirectional', 'nonTarget', 'length', 'crTool', 'unTool', 'exTool' ] + disable: [ 'bidirectional', 'nonTarget', 'length', 'targetCR', 'targetUN', 'targetEX' ] }; toolManager.setToolDefaultStates(toolDefaultStates); @@ -49,7 +49,7 @@ OHIF.lesiontracker.toggleLesionTrackerToolsButtons = (isEnabled) => { toolStates.disabledToolButtons = []; OHIF.lesiontracker.toggleLesionTrackerToolsHotKeys(true); } else { - toolStates.disabledToolButtons = [ 'bidirectional', 'nonTarget', 'crTool', 'unTool', 'exTool', + toolStates.disabledToolButtons = [ 'bidirectional', 'nonTarget', 'targetCR', 'targetUN', 'targetEX', 'toggleHUD', 'toggleTrial', 'toolbarSectionEntry', 'toggleMeasurements' ]; OHIF.lesiontracker.toggleLesionTrackerToolsHotKeys(false); } diff --git a/Packages/ohif-lesiontracker/client/tools.js b/Packages/ohif-lesiontracker/client/tools.js index a06415437..1c0231e13 100644 --- a/Packages/ohif-lesiontracker/client/tools.js +++ b/Packages/ohif-lesiontracker/client/tools.js @@ -19,25 +19,25 @@ Meteor.startup(function() { touch: cornerstoneTools.deleteLesionKeyboardTool }); - toolManager.addTool('crTool', { - mouse: cornerstoneTools.crTool, - touch: cornerstoneTools.crToolTouch + toolManager.addTool('targetCR', { + mouse: cornerstoneTools.targetCR, + touch: cornerstoneTools.targetCRTouch }); - toolManager.addTool('unTool', { - mouse: cornerstoneTools.unTool, - touch: cornerstoneTools.unToolTouch + toolManager.addTool('targetUN', { + mouse: cornerstoneTools.targetUN, + touch: cornerstoneTools.targetUNTouch }); - toolManager.addTool('exTool', { - mouse: cornerstoneTools.exTool, - touch: cornerstoneTools.exToolTouch + toolManager.addTool('targetEX', { + mouse: cornerstoneTools.targetEX, + touch: cornerstoneTools.targetEXTouch }); // Update default state for tools making sure each tool is only inserted once let currentDefaultStates = toolManager.getToolDefaultStates(); let newDefaultStates = { - deactivate: ['bidirectional', 'nonTarget', 'length', 'crTool', 'unTool', 'exTool'], + deactivate: ['bidirectional', 'nonTarget', 'length', 'targetCR', 'targetUN', 'targetEX'], activate: [] // 'deleteLesionKeyboardTool' }; @@ -53,4 +53,4 @@ Meteor.startup(function() { toolManager.setToolDefaultStates(currentDefaultStates); -}); \ No newline at end of file +}); diff --git a/Packages/ohif-measurements/client/components/measurementTable/measurementTableView/measurementTableView.js b/Packages/ohif-measurements/client/components/measurementTable/measurementTableView/measurementTableView.js index f15235c10..4b5fe10a4 100644 --- a/Packages/ohif-measurements/client/components/measurementTable/measurementTableView/measurementTableView.js +++ b/Packages/ohif-measurements/client/components/measurementTable/measurementTableView/measurementTableView.js @@ -110,7 +110,7 @@ Template.measurementTableView.helpers({ // Reformat the data for display in the table return Object.keys(groupObject).map(key => { const anEntry = groupObject[key][0]; - + return { measurementTypeId: measurementTypeId, measurementNumber: key, diff --git a/Packages/ohif-measurements/client/lib/toggleLabelButton.js b/Packages/ohif-measurements/client/lib/toggleLabelButton.js index 4a28069b0..2407da796 100644 --- a/Packages/ohif-measurements/client/lib/toggleLabelButton.js +++ b/Packages/ohif-measurements/client/lib/toggleLabelButton.js @@ -5,9 +5,9 @@ import { OHIF } from 'meteor/ohif:core'; const toolMap = { bidirectional: 'targets', - crTool: 'targets', - unTool: 'targets', - exTool: 'targets' + targetCR: 'targets', + targetUN: 'targets', + targetEX: 'targets' }; OHIF.measurements.toggleLabelButton = options => {