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() {
|
toolbarButtons() {
|
||||||
// Check if the measure tools shall be disabled
|
// Check if the measure tools shall be disabled
|
||||||
const isToolDisabled = false; //!Template.instance().data.timepointApi;
|
const isToolDisabled = false; //!Template.instance().data.timepointApi;
|
||||||
|
|
||||||
const buttonData = [];
|
const buttonData = [];
|
||||||
|
|
||||||
buttonData.push({
|
buttonData.push({
|
||||||
@ -179,30 +179,29 @@ Template.toolbarSection.helpers({
|
|||||||
});
|
});
|
||||||
|
|
||||||
// TODO: Get real icons for CR / UN / EX
|
// 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({
|
buttonData.push({
|
||||||
id: 'crTool',
|
id: 'targetCR',
|
||||||
title: 'CR Tool',
|
title: 'CR Target',
|
||||||
classes: 'imageViewerTool toolbarSectionButton',
|
classes: 'imageViewerTool toolbarSectionButton',
|
||||||
svgLink: '/packages/ohif_viewerbase/assets/icons.svg#icon-tools-measure-temp',
|
svgLink: '/packages/ohif_viewerbase/assets/icons.svg#icon-tools-measure-temp',
|
||||||
disabled: isToolDisabled
|
disabled: isToolDisabled
|
||||||
});
|
});
|
||||||
|
|
||||||
buttonData.push({
|
buttonData.push({
|
||||||
id: 'unTool',
|
id: 'targetUN',
|
||||||
title: 'UN Tool',
|
title: 'UN Target',
|
||||||
classes: 'imageViewerTool toolbarSectionButton',
|
classes: 'imageViewerTool toolbarSectionButton',
|
||||||
svgLink: '/packages/ohif_viewerbase/assets/icons.svg#icon-tools-measure-temp',
|
svgLink: '/packages/ohif_viewerbase/assets/icons.svg#icon-tools-measure-temp',
|
||||||
disabled: isToolDisabled
|
disabled: isToolDisabled
|
||||||
});
|
});
|
||||||
|
|
||||||
buttonData.push({
|
buttonData.push({
|
||||||
id: 'exTool',
|
id: 'targetEX',
|
||||||
title: 'EX Tool',
|
title: 'EX Target',
|
||||||
classes: 'imageViewerTool toolbarSectionButton',
|
classes: 'imageViewerTool toolbarSectionButton',
|
||||||
svgLink: '/packages/ohif_viewerbase/assets/icons.svg#icon-tools-measure-temp',
|
svgLink: '/packages/ohif_viewerbase/assets/icons.svg#icon-tools-measure-temp',
|
||||||
disabled: isToolDisabled
|
disabled: isToolDisabled
|
||||||
});*/
|
});
|
||||||
|
|
||||||
return buttonData;
|
return buttonData;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import { bidirectional } from './bidirectional';
|
import { target } from './target';
|
||||||
import { nonTarget } from './nonTarget';
|
import { nonTarget } from './nonTarget';
|
||||||
import { length } from './length';
|
import { length } from './length';
|
||||||
import { ellipse } from './ellipse';
|
import { ellipse } from './ellipse';
|
||||||
|
|
||||||
export const validateMeasurements = () => {
|
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 { nonTarget } from './nonTarget';
|
||||||
import { length } from './length';
|
import { length } from './length';
|
||||||
import { ellipse } from './ellipse';
|
import { ellipse } from './ellipse';
|
||||||
|
|
||||||
export const measurementTools = [
|
export const measurementTools = [
|
||||||
bidirectional,
|
target,
|
||||||
nonTarget,
|
targetCR,
|
||||||
length,
|
targetUN,
|
||||||
ellipse
|
nonTarget,
|
||||||
];
|
length,
|
||||||
|
ellipse
|
||||||
|
];
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { MeasurementSchemaTypes } from 'meteor/ohif:measurements/both/schema/mea
|
|||||||
|
|
||||||
const CornerstoneHandleSchema = MeasurementSchemaTypes.CornerstoneHandleSchema;
|
const CornerstoneHandleSchema = MeasurementSchemaTypes.CornerstoneHandleSchema;
|
||||||
|
|
||||||
const BidirectionalHandlesSchema = new SimpleSchema({
|
const TargetHandlesSchema = new SimpleSchema({
|
||||||
start: {
|
start: {
|
||||||
type: CornerstoneHandleSchema,
|
type: CornerstoneHandleSchema,
|
||||||
label: 'Start'
|
label: 'Start'
|
||||||
@ -26,9 +26,9 @@ const BidirectionalHandlesSchema = new SimpleSchema({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const BidirectionalSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneToolMeasurement, {
|
const TargetSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneToolMeasurement, {
|
||||||
handles: {
|
handles: {
|
||||||
type: BidirectionalHandlesSchema,
|
type: TargetHandlesSchema,
|
||||||
label: 'Handles'
|
label: 'Handles'
|
||||||
},
|
},
|
||||||
location: {
|
location: {
|
||||||
@ -81,14 +81,15 @@ function displayFunction(data) {
|
|||||||
return data.longestDiameter;
|
return data.longestDiameter;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const bidirectional = {
|
export const target = {
|
||||||
id: 'targets',
|
id: 'targets',
|
||||||
name: 'Targets',
|
name: 'Targets',
|
||||||
cornerstoneToolType: 'bidirectional',
|
cornerstoneToolType: 'bidirectional',
|
||||||
schema: BidirectionalSchema,
|
schema: TargetSchema,
|
||||||
options: {
|
options: {
|
||||||
showInMeasurementTable: true,
|
showInMeasurementTable: true,
|
||||||
measurementTableOptions: {
|
measurementTableOptions: {
|
||||||
|
key: 'targets',
|
||||||
displayFunction: displayFunction
|
displayFunction: displayFunction
|
||||||
},
|
},
|
||||||
includeInCaseProgress: true,
|
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 ||
|
if (keyCode === keys.DELETE ||
|
||||||
(keyCode === keys.D && eventData.event.ctrlKey === true)) {
|
(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);
|
var nearbyToolData = getNearbyToolData(eventData.element, eventData.currentPoints.canvas, toolTypes);
|
||||||
|
|
||||||
if (!nearbyToolData) {
|
if (!nearbyToolData) {
|
||||||
|
|||||||
@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
var responseByToolType = [{
|
var responseByToolType = [{
|
||||||
"toolType": "crTool",
|
"toolType": "targetCR",
|
||||||
"toolResponse": "CR"
|
"toolResponse": "CR"
|
||||||
}, {
|
}, {
|
||||||
"toolType": "unTool",
|
"toolType": "targetUN",
|
||||||
"toolResponse": "UN"
|
"toolResponse": "UN"
|
||||||
}, {
|
}, {
|
||||||
"toolType": "exTool",
|
"toolType": "targetEX",
|
||||||
"toolResponse": "EX"
|
"toolResponse": "EX"
|
||||||
}];
|
}];
|
||||||
|
|
||||||
@ -418,19 +418,19 @@
|
|||||||
return toolInterface;
|
return toolInterface;
|
||||||
}
|
}
|
||||||
|
|
||||||
var crToolInterface = createQualitativeTargetTool('crTool');
|
var targetCRInterface = createQualitativeTargetTool('targetCR');
|
||||||
cornerstoneTools.crTool = crToolInterface.mouse;
|
cornerstoneTools.targetCR = targetCRInterface.mouse;
|
||||||
cornerstoneTools.crTool.setConfiguration(configuration);
|
cornerstoneTools.targetCR.setConfiguration(configuration);
|
||||||
cornerstoneTools.crToolTouch = crToolInterface.touch;
|
cornerstoneTools.targetCRTouch = targetCRInterface.touch;
|
||||||
|
|
||||||
var unToolInterface = createQualitativeTargetTool('unTool');
|
var targetUNInterface = createQualitativeTargetTool('targetUN');
|
||||||
cornerstoneTools.unTool = unToolInterface.mouse;
|
cornerstoneTools.targetUN = targetUNInterface.mouse;
|
||||||
cornerstoneTools.unTool.setConfiguration(configuration);
|
cornerstoneTools.targetUN.setConfiguration(configuration);
|
||||||
cornerstoneTools.unToolTouch = unToolInterface.touch;
|
cornerstoneTools.targetUNTouch = targetUNInterface.touch;
|
||||||
|
|
||||||
var exToolInterface = createQualitativeTargetTool('exTool');
|
var targetEXInterface = createQualitativeTargetTool('targetEX');
|
||||||
cornerstoneTools.exTool = exToolInterface.mouse;
|
cornerstoneTools.targetEX = targetEXInterface.mouse;
|
||||||
cornerstoneTools.exTool.setConfiguration(configuration);
|
cornerstoneTools.targetEX.setConfiguration(configuration);
|
||||||
cornerstoneTools.exToolTouch = exToolInterface.touch;
|
cornerstoneTools.targetEXTouch = targetEXInterface.touch;
|
||||||
|
|
||||||
})($, cornerstone, cornerstoneMath, cornerstoneTools);
|
})($, cornerstone, cornerstoneMath, cornerstoneTools);
|
||||||
|
|||||||
@ -85,9 +85,9 @@ Template.measurementLocationDialog.onCreated(() => {
|
|||||||
cornerstoneTools.bidirectional.setConfiguration(config);
|
cornerstoneTools.bidirectional.setConfiguration(config);
|
||||||
|
|
||||||
// Set CR-Tool, UN-Tool, EX-Tool configurations
|
// Set CR-Tool, UN-Tool, EX-Tool configurations
|
||||||
cornerstoneTools.crTool.setConfiguration(config);
|
cornerstoneTools.targetCR.setConfiguration(config);
|
||||||
cornerstoneTools.exTool.setConfiguration(config);
|
cornerstoneTools.targetUN.setConfiguration(config);
|
||||||
cornerstoneTools.unTool.setConfiguration(config);
|
cornerstoneTools.targetEX.setConfiguration(config);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
import { OHIF } from 'meteor/ohif:core';
|
import { OHIF } from 'meteor/ohif:core';
|
||||||
|
|
||||||
var responseTypes = {
|
var responseTypes = {
|
||||||
crTool: 'CR',
|
targetCR: 'CR',
|
||||||
exTool: 'EX',
|
targetUN: 'UN',
|
||||||
unTool: 'UN'
|
targetEX: 'EX'
|
||||||
};
|
};
|
||||||
|
|
||||||
convertNonTarget = function(measurementApi, measurementData, newTooltype) {
|
convertNonTarget = function(measurementApi, measurementData, newTooltype) {
|
||||||
|
|||||||
@ -20,7 +20,7 @@ OHIF.lesiontracker.toggleLesionTrackerTools = () => {
|
|||||||
activate: [], //'deleteLesionKeyboardTool'
|
activate: [], //'deleteLesionKeyboardTool'
|
||||||
deactivate: [],
|
deactivate: [],
|
||||||
enable: [],
|
enable: [],
|
||||||
disable: [ 'bidirectional', 'nonTarget', 'length', 'crTool', 'unTool', 'exTool' ]
|
disable: [ 'bidirectional', 'nonTarget', 'length', 'targetCR', 'targetUN', 'targetEX' ]
|
||||||
};
|
};
|
||||||
|
|
||||||
toolManager.setToolDefaultStates(toolDefaultStates);
|
toolManager.setToolDefaultStates(toolDefaultStates);
|
||||||
@ -49,7 +49,7 @@ OHIF.lesiontracker.toggleLesionTrackerToolsButtons = (isEnabled) => {
|
|||||||
toolStates.disabledToolButtons = [];
|
toolStates.disabledToolButtons = [];
|
||||||
OHIF.lesiontracker.toggleLesionTrackerToolsHotKeys(true);
|
OHIF.lesiontracker.toggleLesionTrackerToolsHotKeys(true);
|
||||||
} else {
|
} else {
|
||||||
toolStates.disabledToolButtons = [ 'bidirectional', 'nonTarget', 'crTool', 'unTool', 'exTool',
|
toolStates.disabledToolButtons = [ 'bidirectional', 'nonTarget', 'targetCR', 'targetUN', 'targetEX',
|
||||||
'toggleHUD', 'toggleTrial', 'toolbarSectionEntry', 'toggleMeasurements' ];
|
'toggleHUD', 'toggleTrial', 'toolbarSectionEntry', 'toggleMeasurements' ];
|
||||||
OHIF.lesiontracker.toggleLesionTrackerToolsHotKeys(false);
|
OHIF.lesiontracker.toggleLesionTrackerToolsHotKeys(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,25 +19,25 @@ Meteor.startup(function() {
|
|||||||
touch: cornerstoneTools.deleteLesionKeyboardTool
|
touch: cornerstoneTools.deleteLesionKeyboardTool
|
||||||
});
|
});
|
||||||
|
|
||||||
toolManager.addTool('crTool', {
|
toolManager.addTool('targetCR', {
|
||||||
mouse: cornerstoneTools.crTool,
|
mouse: cornerstoneTools.targetCR,
|
||||||
touch: cornerstoneTools.crToolTouch
|
touch: cornerstoneTools.targetCRTouch
|
||||||
});
|
});
|
||||||
|
|
||||||
toolManager.addTool('unTool', {
|
toolManager.addTool('targetUN', {
|
||||||
mouse: cornerstoneTools.unTool,
|
mouse: cornerstoneTools.targetUN,
|
||||||
touch: cornerstoneTools.unToolTouch
|
touch: cornerstoneTools.targetUNTouch
|
||||||
});
|
});
|
||||||
|
|
||||||
toolManager.addTool('exTool', {
|
toolManager.addTool('targetEX', {
|
||||||
mouse: cornerstoneTools.exTool,
|
mouse: cornerstoneTools.targetEX,
|
||||||
touch: cornerstoneTools.exToolTouch
|
touch: cornerstoneTools.targetEXTouch
|
||||||
});
|
});
|
||||||
|
|
||||||
// Update default state for tools making sure each tool is only inserted once
|
// Update default state for tools making sure each tool is only inserted once
|
||||||
let currentDefaultStates = toolManager.getToolDefaultStates();
|
let currentDefaultStates = toolManager.getToolDefaultStates();
|
||||||
let newDefaultStates = {
|
let newDefaultStates = {
|
||||||
deactivate: ['bidirectional', 'nonTarget', 'length', 'crTool', 'unTool', 'exTool'],
|
deactivate: ['bidirectional', 'nonTarget', 'length', 'targetCR', 'targetUN', 'targetEX'],
|
||||||
activate: [] // 'deleteLesionKeyboardTool'
|
activate: [] // 'deleteLesionKeyboardTool'
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -53,4 +53,4 @@ Meteor.startup(function() {
|
|||||||
|
|
||||||
toolManager.setToolDefaultStates(currentDefaultStates);
|
toolManager.setToolDefaultStates(currentDefaultStates);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@ -110,7 +110,7 @@ Template.measurementTableView.helpers({
|
|||||||
// Reformat the data for display in the table
|
// Reformat the data for display in the table
|
||||||
return Object.keys(groupObject).map(key => {
|
return Object.keys(groupObject).map(key => {
|
||||||
const anEntry = groupObject[key][0];
|
const anEntry = groupObject[key][0];
|
||||||
|
|
||||||
return {
|
return {
|
||||||
measurementTypeId: measurementTypeId,
|
measurementTypeId: measurementTypeId,
|
||||||
measurementNumber: key,
|
measurementNumber: key,
|
||||||
|
|||||||
@ -5,9 +5,9 @@ import { OHIF } from 'meteor/ohif:core';
|
|||||||
|
|
||||||
const toolMap = {
|
const toolMap = {
|
||||||
bidirectional: 'targets',
|
bidirectional: 'targets',
|
||||||
crTool: 'targets',
|
targetCR: 'targets',
|
||||||
unTool: 'targets',
|
targetUN: 'targets',
|
||||||
exTool: 'targets'
|
targetEX: 'targets'
|
||||||
};
|
};
|
||||||
|
|
||||||
OHIF.measurements.toggleLabelButton = options => {
|
OHIF.measurements.toggleLabelButton = options => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user