LT-115: Configuring schemas for for CR-target and UN-Target
This commit is contained in:
parent
0cf9163885
commit
e640f5a007
@ -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;
|
||||
}
|
||||
|
||||
@ -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');
|
||||
};
|
||||
console.log('validateMeasurements');
|
||||
};
|
||||
|
||||
@ -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
|
||||
];
|
||||
target,
|
||||
targetCR,
|
||||
targetUN,
|
||||
nonTarget,
|
||||
length,
|
||||
ellipse
|
||||
];
|
||||
|
||||
@ -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,
|
||||
56
Packages/ohif-lesiontracker/both/configuration/targetCR.js
Normal file
56
Packages/ohif-lesiontracker/both/configuration/targetCR.js
Normal file
@ -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,
|
||||
}
|
||||
};
|
||||
56
Packages/ohif-lesiontracker/both/configuration/targetUN.js
Normal file
56
Packages/ohif-lesiontracker/both/configuration/targetUN.js
Normal file
@ -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,
|
||||
}
|
||||
};
|
||||
@ -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) {
|
||||
|
||||
@ -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);
|
||||
})($, cornerstone, cornerstoneMath, cornerstoneTools);
|
||||
|
||||
@ -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);
|
||||
|
||||
});
|
||||
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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 => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user