LT-291: Re-implementing the Non-Target tool behavior

This commit is contained in:
Bruno Alves de Faria authored and Erik Ziegler committed 2016-11-15 08:29:46 +01:00
1 parent e348ff1d4d
commit 5d8a99dc5f
12 files changed
+195 -56

No files matched your search

@@ -90,18 +90,16 @@ class MeasurementApi {
});
}
deleteMeasurements(measurementTypeId, toolType, measurementNumber) {
deleteMeasurements(measurementTypeId, filter) {
const collection = this[measurementTypeId];
const filter = {
toolType,
measurementNumber
};
// Get the entries information before removing them
const entries = collection.find(filter).fetch();
collection.remove(filter);
// If the filter doesn't have the measurement number, get it from the first entry
const measurementNumber = filter.measurementNumber || entries[0].measurementNumber;
// Synchronize the new data with cornerstone tools
const toolState = cornerstoneTools.globalImageIdSpecificToolStateManager.toolState;
_.each(entries, entry => {