LT-115: Adapting MeasurementAPI to new tools storage structure

This commit is contained in:
Bruno Alves de Faria committed 2017-01-02 16:32:09 -02:00
1 parent bd748eae32
commit c9c2cd548e
14 files changed
+77 -72

No files matched your search

@@ -1,8 +1,3 @@
import { target } from './target';
import { nonTarget } from './nonTarget';
import { length } from './length';
import { ellipse } from './ellipse';
export const validateMeasurements = () => {
console.log('validateMeasurements');
};
@@ -1,6 +1,3 @@
import './nonTarget.js';
import './ellipse.js';
import './length.js';
import './measurementTools.js';
import './dataExchange.js';
import './dataValidation.js';
@@ -86,6 +86,8 @@ const displayFunction = data => {
};
export const bidirectional = {
id: 'bidirectional',
name: 'Target',
toolGroup: 'targets',
cornerstoneToolType: 'bidirectional',
schema: BidirectionalSchema,
@@ -4,18 +4,18 @@ import { MeasurementSchemaTypes } from 'meteor/ohif:measurements/both/schema/mea
const CornerstoneHandleSchema = MeasurementSchemaTypes.CornerstoneHandleSchema;
const EllipseHandlesSchema = new SimpleSchema({
start: {
type: CornerstoneHandleSchema,
label: 'Start'
},
end: {
type: CornerstoneHandleSchema,
label: 'End'
},
textBox: {
type: CornerstoneHandleSchema,
label: 'Text Box'
},
start: {
type: CornerstoneHandleSchema,
label: 'Start'
},
end: {
type: CornerstoneHandleSchema,
label: 'End'
},
textBox: {
type: CornerstoneHandleSchema,
label: 'Text Box'
},
});
const EllipseSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneToolMeasurement, {
@@ -28,6 +28,7 @@ const EllipseSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneToolMe
export const ellipse = {
id: 'ellipse',
name: 'Ellipse',
toolGroup: 'temp',
cornerstoneToolType: 'ellipticalRoi',
schema: EllipseSchema
}
};
@@ -4,18 +4,18 @@ import { MeasurementSchemaTypes } from 'meteor/ohif:measurements/both/schema/mea
const CornerstoneHandleSchema = MeasurementSchemaTypes.CornerstoneHandleSchema;
const LengthHandlesSchema = new SimpleSchema({
start: {
type: CornerstoneHandleSchema,
label: 'Start'
},
end: {
type: CornerstoneHandleSchema,
label: 'End'
},
textBox: {
type: CornerstoneHandleSchema,
label: 'Text Box'
},
start: {
type: CornerstoneHandleSchema,
label: 'Start'
},
end: {
type: CornerstoneHandleSchema,
label: 'End'
},
textBox: {
type: CornerstoneHandleSchema,
label: 'Text Box'
}
});
const LengthSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneToolMeasurement, {
@@ -28,6 +28,7 @@ const LengthSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneToolMea
export const length = {
id: 'length',
name: 'Length',
toolGroup: 'temp',
cornerstoneToolType: 'length',
schema: LengthSchema
}
};
@@ -45,6 +45,8 @@ const NonTargetSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneTool
}]);
export const nonTarget = {
id: 'nonTarget',
name: 'Non-Target',
toolGroup: 'nonTargets',
cornerstoneToolType: 'nonTarget',
schema: NonTargetSchema,
@@ -50,6 +50,8 @@ const TargetCRSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneToolM
}]);
export const targetCR = {
id: 'targetCR',
name: 'CR Target',
toolGroup: 'targets',
cornerstoneToolType: 'targetCR',
schema: TargetCRSchema,
@@ -50,6 +50,8 @@ const TargetUNSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneToolM
}]);
export const targetUN = {
id: 'targetUN',
name: 'UN Target',
toolGroup: 'targets',
cornerstoneToolType: 'targetUN',
schema: TargetUNSchema,
@@ -7,7 +7,7 @@ import { FieldLesionLocation, FieldLesionLocationResponse } from 'meteor/ohif:le
Template.dialogNonTargetMeasurement.onCreated(() => {
const instance = Template.instance();
instance.measurementTypeId = 'nonTargets';
instance.measurementTypeId = 'nonTarget';
const timepointApi = instance.data.timepointApi;
instance.schema = new SimpleSchema({
@@ -63,7 +63,7 @@ Template.dialogNonTargetMeasurement.onRendered(() => {
const measurementApi = instance.viewerData.measurementApi;
const timepointApi = instance.viewerData.timepointApi;
const collection = measurementApi[instance.measurementTypeId];
const collection = measurementApi.tools[instance.measurementTypeId];
const measurementData = instance.data.measurementData;
@@ -24,7 +24,7 @@ function getSetMeasurementNumberCallbackFunction(measurementTypeId, measurementA
// Get a measurement number for this measurement, depending on whether or not the same measurement previously
// exists at a different timepoint
const timepointId = timepoint.timepointId;
const collection = measurementApi[measurementTypeId];
const collection = measurementApi.tools[measurementTypeId];
const measurementNumber = OHIF.measurements.MeasurementManager.getNewMeasurementNumber(timepointId, collection, timepointApi);
measurementData.measurementNumber = measurementNumber;
@@ -35,7 +35,7 @@ function getSetMeasurementNumberCallbackFunction(measurementTypeId, measurementA
Template.measurementLocationDialog.onCreated(() => {
const instance = Template.instance();
const measurementTypeId = 'targets';
const measurementTypeId = 'bidirectional';
const measurementApi = instance.data.measurementApi;
const timepointApi = instance.data.timepointApi;