diff --git a/Packages/ohif-cornerstone/package.js b/Packages/ohif-cornerstone/package.js index 5e10d323e..2c69c3259 100644 --- a/Packages/ohif-cornerstone/package.js +++ b/Packages/ohif-cornerstone/package.js @@ -7,7 +7,7 @@ Package.describe({ Npm.depends({ hammerjs: '2.0.8', 'cornerstone-core': '2.2.4', - 'cornerstone-tools': '2.3.3', + 'cornerstone-tools': '2.3.9', 'cornerstone-math': '0.1.6', 'dicom-parser': '1.8.0', 'cornerstone-wado-image-loader': '2.1.4', diff --git a/Packages/ohif-measurement-table/client/configuration/measurementTools.js b/Packages/ohif-measurement-table/client/configuration/measurementTools.js index 4d4e2651a..b1adf7fc5 100644 --- a/Packages/ohif-measurement-table/client/configuration/measurementTools.js +++ b/Packages/ohif-measurement-table/client/configuration/measurementTools.js @@ -1,12 +1,16 @@ import { ToolGroupBaseSchema } from '../schema/toolGroupSchema'; -import { length } from '../schema/length'; -import { ellipticalRoi } from '../schema/ellipticalRoi'; -import { rectangleRoi } from '../schema/rectangleRoi'; +import length from '../schema/length'; +import ellipticalRoi from '../schema/ellipticalRoi'; +import rectangleRoi from '../schema/rectangleRoi'; +import simpleAngle from '../schema/simpleAngle'; +import arrowAnnotate from '../schema/arrowAnnotate'; const trackedTools = [ length, ellipticalRoi, - rectangleRoi + rectangleRoi, + simpleAngle, + arrowAnnotate ]; export const measurementTools = [{ diff --git a/Packages/ohif-measurement-table/client/schema/arrowAnnotate.js b/Packages/ohif-measurement-table/client/schema/arrowAnnotate.js new file mode 100644 index 000000000..9fa71fce4 --- /dev/null +++ b/Packages/ohif-measurement-table/client/schema/arrowAnnotate.js @@ -0,0 +1,67 @@ +import { SimpleSchema } from 'meteor/aldeed:simple-schema'; +import { MeasurementSchemaTypes } from 'meteor/ohif:measurements/both/schema/measurements'; + +const CornerstoneHandleSchema = MeasurementSchemaTypes.CornerstoneHandleSchema; + +const handlesSchema = new SimpleSchema({ + start: { + type: CornerstoneHandleSchema, + label: 'Start' + }, + end: { + type: CornerstoneHandleSchema, + label: 'End' + }, + textBox: { + type: CornerstoneHandleSchema, + label: 'Text Box' + } +}); + +const toolSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneToolMeasurement, { + handles: { + type: handlesSchema, + label: 'Handles' + }, + measurementNumber: { + type: Number, + label: 'Measurement Number' + }, + location: { + type: String, + label: 'Location', + optional: true + }, + description: { + type: String, + label: 'Description', + optional: true + }, + toolType: { + type: String, + label: 'Measurement Tool Type', + defaultValue: 'arrowAnnotate' + }, + text: { + type: String, + label: 'text', + optional: true + } +}]); + +const displayFunction = data => { + return data.text || ''; +}; + +export default { + id: 'arrowAnnotate', + name: 'ArrowAnnotate', + toolGroup: 'allTools', + cornerstoneToolType: 'arrowAnnotate', + schema: toolSchema, + options: { + measurementTable: { + displayFunction + } + } +}; diff --git a/Packages/ohif-measurement-table/client/schema/ellipticalRoi.js b/Packages/ohif-measurement-table/client/schema/ellipticalRoi.js index 5baefc818..6a0326b14 100644 --- a/Packages/ohif-measurement-table/client/schema/ellipticalRoi.js +++ b/Packages/ohif-measurement-table/client/schema/ellipticalRoi.js @@ -3,7 +3,7 @@ import { MeasurementSchemaTypes } from 'meteor/ohif:measurements/both/schema/mea const CornerstoneHandleSchema = MeasurementSchemaTypes.CornerstoneHandleSchema; -const EllipticalRoiHandlesSchema = new SimpleSchema({ +const handlesSchema = new SimpleSchema({ start: { type: CornerstoneHandleSchema, label: 'Start' @@ -42,9 +42,9 @@ const MeanStdDevSchema = new SimpleSchema({ }); -const EllipticalRoiSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneToolMeasurement, { +const toolSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneToolMeasurement, { handles: { - type: EllipticalRoiHandlesSchema, + type: handlesSchema, label: 'Handles' }, measurementNumber: { @@ -90,12 +90,12 @@ const displayFunction = data => { //return data.meanStdDev.mean.toFixed(2); }; -export const ellipticalRoi = { +export default { id: 'ellipticalRoi', name: 'Ellipse', toolGroup: 'allTools', cornerstoneToolType: 'ellipticalRoi', - schema: EllipticalRoiSchema, + schema: toolSchema, options: { measurementTable: { displayFunction diff --git a/Packages/ohif-measurement-table/client/schema/length.js b/Packages/ohif-measurement-table/client/schema/length.js index f56a224c4..20c17a98d 100644 --- a/Packages/ohif-measurement-table/client/schema/length.js +++ b/Packages/ohif-measurement-table/client/schema/length.js @@ -3,7 +3,7 @@ import { MeasurementSchemaTypes } from 'meteor/ohif:measurements/both/schema/mea const CornerstoneHandleSchema = MeasurementSchemaTypes.CornerstoneHandleSchema; -const LengthHandlesSchema = new SimpleSchema({ +const handlesSchema = new SimpleSchema({ start: { type: CornerstoneHandleSchema, label: 'Start' @@ -18,9 +18,9 @@ const LengthHandlesSchema = new SimpleSchema({ } }); -const LengthSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneToolMeasurement, { +const toolSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneToolMeasurement, { handles: { - type: LengthHandlesSchema, + type: handlesSchema, label: 'Handles' }, measurementNumber: { @@ -58,12 +58,12 @@ const displayFunction = data => { return lengthValue; }; -export const length = { +export default { id: 'length', name: 'Length', toolGroup: 'allTools', cornerstoneToolType: 'length', - schema: LengthSchema, + schema: toolSchema, options: { measurementTable: { displayFunction diff --git a/Packages/ohif-measurement-table/client/schema/rectangleRoi.js b/Packages/ohif-measurement-table/client/schema/rectangleRoi.js index e161e75d1..51ddbc0d8 100644 --- a/Packages/ohif-measurement-table/client/schema/rectangleRoi.js +++ b/Packages/ohif-measurement-table/client/schema/rectangleRoi.js @@ -3,7 +3,7 @@ import { MeasurementSchemaTypes } from 'meteor/ohif:measurements/both/schema/mea const CornerstoneHandleSchema = MeasurementSchemaTypes.CornerstoneHandleSchema; -const RectangleRoiHandlesSchema = new SimpleSchema({ +const handlesSchema = new SimpleSchema({ start: { type: CornerstoneHandleSchema, label: 'Start' @@ -42,9 +42,9 @@ const MeanStdDevSchema = new SimpleSchema({ }); -const RectangleRoiSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneToolMeasurement, { +const toolSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneToolMeasurement, { handles: { - type: RectangleRoiHandlesSchema, + type: handlesSchema, label: 'Handles' }, measurementNumber: { @@ -87,12 +87,12 @@ const displayFunction = data => { return meanValue; }; -export const rectangleRoi = { +export default { id: 'rectangleRoi', name: 'Rectangle', toolGroup: 'allTools', cornerstoneToolType: 'rectangleRoi', - schema: RectangleRoiSchema, + schema: toolSchema, options: { measurementTable: { displayFunction diff --git a/Packages/ohif-measurement-table/client/schema/simpleAngle.js b/Packages/ohif-measurement-table/client/schema/simpleAngle.js new file mode 100644 index 000000000..f8928aa1f --- /dev/null +++ b/Packages/ohif-measurement-table/client/schema/simpleAngle.js @@ -0,0 +1,76 @@ +import { SimpleSchema } from 'meteor/aldeed:simple-schema'; +import { MeasurementSchemaTypes } from 'meteor/ohif:measurements/both/schema/measurements'; + +const CornerstoneHandleSchema = MeasurementSchemaTypes.CornerstoneHandleSchema; + +const handlesSchema = new SimpleSchema({ + start: { + type: CornerstoneHandleSchema, + label: 'Start' + }, + middle: { + type: CornerstoneHandleSchema, + label: 'Middle' + }, + end: { + type: CornerstoneHandleSchema, + label: 'End' + }, + textBox: { + type: CornerstoneHandleSchema, + label: 'Text Box' + } +}); + +const toolSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneToolMeasurement, { + handles: { + type: handlesSchema, + label: 'Handles' + }, + measurementNumber: { + type: Number, + label: 'Measurement Number' + }, + location: { + type: String, + label: 'Location', + optional: true + }, + description: { + type: String, + label: 'Description', + optional: true + }, + toolType: { + type: String, + label: 'Measurement Tool Type', + defaultValue: 'simpleAngle' + }, + rAngle: { + type: Number, + label: 'Angle', + optional: true, + decimal: true + } +}]); + +const displayFunction = data => { + let text = ''; + if (data.rAngle) { + text = data.rAngle.toFixed(2) + String.fromCharCode(parseInt('00B0', 16)); + } + return text; +}; + +export default { + id: 'simpleAngle', + name: 'SimpleAngle', + toolGroup: 'allTools', + cornerstoneToolType: 'simpleAngle', + schema: toolSchema, + options: { + measurementTable: { + displayFunction + } + } +};