Keeping bidirectional arm selected after moving handles

This commit is contained in:
Bruno Alves de Faria 2017-11-21 13:22:54 -02:00
parent 10a6b2f094
commit 4dcff38a53
3 changed files with 16 additions and 8 deletions

View File

@ -1,24 +1,32 @@
import { SimpleSchema } from 'meteor/aldeed:simple-schema'; import { SimpleSchema } from 'meteor/aldeed:simple-schema';
import { MeasurementSchemaTypes } from 'meteor/ohif:measurements/both/schema/measurements'; import { MeasurementSchemaTypes } from 'meteor/ohif:measurements/both/schema/measurements';
// import { OHIF } from 'meteor/ohif:core';
const CornerstoneHandleSchema = MeasurementSchemaTypes.CornerstoneHandleSchema; const { CornerstoneHandleSchema } = MeasurementSchemaTypes;
const BidirectionalHandleSchema = new SimpleSchema([CornerstoneHandleSchema, {
selected: {
type: Boolean,
label: 'Selected',
optional: true,
defaultValue: false
}
}]);
const BidirectionalHandlesSchema = new SimpleSchema({ const BidirectionalHandlesSchema = new SimpleSchema({
start: { start: {
type: CornerstoneHandleSchema, type: BidirectionalHandleSchema,
label: 'Start' label: 'Start'
}, },
end: { end: {
type: CornerstoneHandleSchema, type: BidirectionalHandleSchema,
label: 'End' label: 'End'
}, },
perpendicularStart: { perpendicularStart: {
type: CornerstoneHandleSchema, type: BidirectionalHandleSchema,
label: 'Perpendicular Start' label: 'Perpendicular Start'
}, },
perpendicularEnd: { perpendicularEnd: {
type: CornerstoneHandleSchema, type: BidirectionalHandleSchema,
label: 'Perpendicular End' label: 'Perpendicular End'
}, },
textBox: { textBox: {

View File

@ -149,7 +149,7 @@ const CornerstoneViewport = new SimpleSchema({
decimal: true, decimal: true,
optional: true optional: true
} }
}) });
const InstanceLevelMeasurement = new SimpleSchema([ const InstanceLevelMeasurement = new SimpleSchema([
StudyLevelMeasurement, StudyLevelMeasurement,

View File

@ -113,7 +113,7 @@ class MeasurementHandlers {
} }
// Clean the measurement according to the Schema // Clean the measurement according to the Schema
Collection._c2._simpleSchema.clean(measurement); Collection._c2._simpleSchema.clean(_.clone(measurement));
// Insert the new measurement into the collection // Insert the new measurement into the collection
Collection.update(measurementId, { Collection.update(measurementId, {