Adding ArrowAnnotate and simpleAngle into measurement-table (#263)

This commit is contained in:
Gustavo André Lelis authored and Bruno Alves de Faria committed 2018-09-06 08:07:54 -03:00
1 parent 7a47b58729
commit 2493802dea
7 files changed
+167 -20

No files matched your search

@@ -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
}
}
};