Adding ArrowAnnotate and simpleAngle into measurement-table (#263)
This commit is contained in:
parent
7a47b58729
commit
2493802dea
@ -7,7 +7,7 @@ Package.describe({
|
|||||||
Npm.depends({
|
Npm.depends({
|
||||||
hammerjs: '2.0.8',
|
hammerjs: '2.0.8',
|
||||||
'cornerstone-core': '2.2.4',
|
'cornerstone-core': '2.2.4',
|
||||||
'cornerstone-tools': '2.3.3',
|
'cornerstone-tools': '2.3.9',
|
||||||
'cornerstone-math': '0.1.6',
|
'cornerstone-math': '0.1.6',
|
||||||
'dicom-parser': '1.8.0',
|
'dicom-parser': '1.8.0',
|
||||||
'cornerstone-wado-image-loader': '2.1.4',
|
'cornerstone-wado-image-loader': '2.1.4',
|
||||||
|
|||||||
@ -1,12 +1,16 @@
|
|||||||
import { ToolGroupBaseSchema } from '../schema/toolGroupSchema';
|
import { ToolGroupBaseSchema } from '../schema/toolGroupSchema';
|
||||||
import { length } from '../schema/length';
|
import length from '../schema/length';
|
||||||
import { ellipticalRoi } from '../schema/ellipticalRoi';
|
import ellipticalRoi from '../schema/ellipticalRoi';
|
||||||
import { rectangleRoi } from '../schema/rectangleRoi';
|
import rectangleRoi from '../schema/rectangleRoi';
|
||||||
|
import simpleAngle from '../schema/simpleAngle';
|
||||||
|
import arrowAnnotate from '../schema/arrowAnnotate';
|
||||||
|
|
||||||
const trackedTools = [
|
const trackedTools = [
|
||||||
length,
|
length,
|
||||||
ellipticalRoi,
|
ellipticalRoi,
|
||||||
rectangleRoi
|
rectangleRoi,
|
||||||
|
simpleAngle,
|
||||||
|
arrowAnnotate
|
||||||
];
|
];
|
||||||
|
|
||||||
export const measurementTools = [{
|
export const measurementTools = [{
|
||||||
|
|||||||
@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
@ -3,7 +3,7 @@ import { MeasurementSchemaTypes } from 'meteor/ohif:measurements/both/schema/mea
|
|||||||
|
|
||||||
const CornerstoneHandleSchema = MeasurementSchemaTypes.CornerstoneHandleSchema;
|
const CornerstoneHandleSchema = MeasurementSchemaTypes.CornerstoneHandleSchema;
|
||||||
|
|
||||||
const EllipticalRoiHandlesSchema = new SimpleSchema({
|
const handlesSchema = new SimpleSchema({
|
||||||
start: {
|
start: {
|
||||||
type: CornerstoneHandleSchema,
|
type: CornerstoneHandleSchema,
|
||||||
label: 'Start'
|
label: 'Start'
|
||||||
@ -42,9 +42,9 @@ const MeanStdDevSchema = new SimpleSchema({
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const EllipticalRoiSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneToolMeasurement, {
|
const toolSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneToolMeasurement, {
|
||||||
handles: {
|
handles: {
|
||||||
type: EllipticalRoiHandlesSchema,
|
type: handlesSchema,
|
||||||
label: 'Handles'
|
label: 'Handles'
|
||||||
},
|
},
|
||||||
measurementNumber: {
|
measurementNumber: {
|
||||||
@ -90,12 +90,12 @@ const displayFunction = data => {
|
|||||||
//return data.meanStdDev.mean.toFixed(2);
|
//return data.meanStdDev.mean.toFixed(2);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ellipticalRoi = {
|
export default {
|
||||||
id: 'ellipticalRoi',
|
id: 'ellipticalRoi',
|
||||||
name: 'Ellipse',
|
name: 'Ellipse',
|
||||||
toolGroup: 'allTools',
|
toolGroup: 'allTools',
|
||||||
cornerstoneToolType: 'ellipticalRoi',
|
cornerstoneToolType: 'ellipticalRoi',
|
||||||
schema: EllipticalRoiSchema,
|
schema: toolSchema,
|
||||||
options: {
|
options: {
|
||||||
measurementTable: {
|
measurementTable: {
|
||||||
displayFunction
|
displayFunction
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { MeasurementSchemaTypes } from 'meteor/ohif:measurements/both/schema/mea
|
|||||||
|
|
||||||
const CornerstoneHandleSchema = MeasurementSchemaTypes.CornerstoneHandleSchema;
|
const CornerstoneHandleSchema = MeasurementSchemaTypes.CornerstoneHandleSchema;
|
||||||
|
|
||||||
const LengthHandlesSchema = new SimpleSchema({
|
const handlesSchema = new SimpleSchema({
|
||||||
start: {
|
start: {
|
||||||
type: CornerstoneHandleSchema,
|
type: CornerstoneHandleSchema,
|
||||||
label: 'Start'
|
label: 'Start'
|
||||||
@ -18,9 +18,9 @@ const LengthHandlesSchema = new SimpleSchema({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const LengthSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneToolMeasurement, {
|
const toolSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneToolMeasurement, {
|
||||||
handles: {
|
handles: {
|
||||||
type: LengthHandlesSchema,
|
type: handlesSchema,
|
||||||
label: 'Handles'
|
label: 'Handles'
|
||||||
},
|
},
|
||||||
measurementNumber: {
|
measurementNumber: {
|
||||||
@ -58,12 +58,12 @@ const displayFunction = data => {
|
|||||||
return lengthValue;
|
return lengthValue;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const length = {
|
export default {
|
||||||
id: 'length',
|
id: 'length',
|
||||||
name: 'Length',
|
name: 'Length',
|
||||||
toolGroup: 'allTools',
|
toolGroup: 'allTools',
|
||||||
cornerstoneToolType: 'length',
|
cornerstoneToolType: 'length',
|
||||||
schema: LengthSchema,
|
schema: toolSchema,
|
||||||
options: {
|
options: {
|
||||||
measurementTable: {
|
measurementTable: {
|
||||||
displayFunction
|
displayFunction
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { MeasurementSchemaTypes } from 'meteor/ohif:measurements/both/schema/mea
|
|||||||
|
|
||||||
const CornerstoneHandleSchema = MeasurementSchemaTypes.CornerstoneHandleSchema;
|
const CornerstoneHandleSchema = MeasurementSchemaTypes.CornerstoneHandleSchema;
|
||||||
|
|
||||||
const RectangleRoiHandlesSchema = new SimpleSchema({
|
const handlesSchema = new SimpleSchema({
|
||||||
start: {
|
start: {
|
||||||
type: CornerstoneHandleSchema,
|
type: CornerstoneHandleSchema,
|
||||||
label: 'Start'
|
label: 'Start'
|
||||||
@ -42,9 +42,9 @@ const MeanStdDevSchema = new SimpleSchema({
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const RectangleRoiSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneToolMeasurement, {
|
const toolSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneToolMeasurement, {
|
||||||
handles: {
|
handles: {
|
||||||
type: RectangleRoiHandlesSchema,
|
type: handlesSchema,
|
||||||
label: 'Handles'
|
label: 'Handles'
|
||||||
},
|
},
|
||||||
measurementNumber: {
|
measurementNumber: {
|
||||||
@ -87,12 +87,12 @@ const displayFunction = data => {
|
|||||||
return meanValue;
|
return meanValue;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const rectangleRoi = {
|
export default {
|
||||||
id: 'rectangleRoi',
|
id: 'rectangleRoi',
|
||||||
name: 'Rectangle',
|
name: 'Rectangle',
|
||||||
toolGroup: 'allTools',
|
toolGroup: 'allTools',
|
||||||
cornerstoneToolType: 'rectangleRoi',
|
cornerstoneToolType: 'rectangleRoi',
|
||||||
schema: RectangleRoiSchema,
|
schema: toolSchema,
|
||||||
options: {
|
options: {
|
||||||
measurementTable: {
|
measurementTable: {
|
||||||
displayFunction
|
displayFunction
|
||||||
|
|||||||
76
Packages/ohif-measurement-table/client/schema/simpleAngle.js
Normal file
76
Packages/ohif-measurement-table/client/schema/simpleAngle.js
Normal 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
Loading…
Reference in New Issue
Block a user