LT-372: Preventing creation of targets with no size

This commit is contained in:
Bruno Alves de Faria committed 2016-11-18 18:47:34 -02:00
1 parent 49ba8eb7a7
commit 2ac832846d
4 files changed
+24 -20

No files matched your search

@@ -0,0 +1,16 @@
import { OHIF } from 'meteor/ohif:core';
import { _ } from 'meteor/underscore';
OHIF.lesiontracker.removeMeasurementIfInvalid = (measurementData, eventData) => {
const handles = measurementData.handles;
const start = _.pick(handles.start, ['x', 'y']);
const end = _.pick(handles.end, ['x', 'y']);
const element = eventData.element;
const toolType = measurementData.toolType;
if (_.isEqual(start, end)) {
cornerstoneTools.removeToolState(element, toolType, measurementData);
return true;
}
return false;
};