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

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

View File

@ -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',

View File

@ -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 = [{

View File

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

View File

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

View File

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

View File

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

View File

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