LT-115: Removing the old code for calculating Measurement Numbers
This commit is contained in:
1 parent
c06043483d
commit
b776e5f411
6 files changed
+18
-142
No files matched your search
@@ -10,7 +10,6 @@ import { OHIF } from 'meteor/ohif:core';
|
||||
const shadowConfig = toolManager.getToolDefaultStates().shadowConfig;
|
||||
|
||||
var configuration = {
|
||||
setMeasurementNumberCallback: setMeasurementNumberCallback,
|
||||
getMeasurementLocationCallback: getMeasurementLocationCallback,
|
||||
changeMeasurementLocationCallback: changeMeasurementLocationCallback,
|
||||
...shadowConfig
|
||||
@@ -24,13 +23,6 @@ import { OHIF } from 'meteor/ohif:core';
|
||||
// The distance between the mouse and the tool to make it active
|
||||
var distanceThreshold = 7;
|
||||
|
||||
// Set lesion number
|
||||
// Get Target lesions on image
|
||||
function setMeasurementNumberCallback(measurementData, eventData, doneCallback) {
|
||||
var measurementNumber = 1;
|
||||
doneCallback(measurementNumber);
|
||||
}
|
||||
|
||||
// Define a callback to get your text annotation
|
||||
// This could be used, e.g. to open a modal
|
||||
function getMeasurementLocationCallback(measurementData, eventData, doneCallback) {
|
||||
@@ -111,8 +103,7 @@ import { OHIF } from 'meteor/ohif:core';
|
||||
return;
|
||||
}
|
||||
|
||||
function doneCallback(measurementNumber) {
|
||||
measurementData.measurementNumber = measurementNumber;
|
||||
function doneCallback() {
|
||||
measurementData.active = false;
|
||||
cornerstone.updateImage(element);
|
||||
}
|
||||
@@ -124,11 +115,7 @@ import { OHIF } from 'meteor/ohif:core';
|
||||
mouseButtonMask: mouseEventData.which
|
||||
};
|
||||
|
||||
// Set lesion number and lesion name
|
||||
var config = cornerstoneTools.bidirectional.getConfiguration();
|
||||
if (measurementData.measurementNumber === undefined) {
|
||||
config.setMeasurementNumberCallback(measurementData, mouseEventData, doneCallback);
|
||||
}
|
||||
|
||||
// associate this data with this imageId so we can render it and manipulate it
|
||||
cornerstoneTools.addToolState(element, toolType, measurementData);
|
||||
@@ -190,19 +177,14 @@ import { OHIF } from 'meteor/ohif:core';
|
||||
return;
|
||||
}
|
||||
|
||||
function doneCallback(measurementNumber) {
|
||||
measurementData.measurementNumber = measurementNumber;
|
||||
function doneCallback() {
|
||||
measurementData.active = false;
|
||||
cornerstone.updateImage(element);
|
||||
}
|
||||
|
||||
var measurementData = createNewMeasurement(touchEventData);
|
||||
|
||||
// Set lesion number and lesion name
|
||||
var config = cornerstoneTools.bidirectional.getConfiguration();
|
||||
if (measurementData.measurementNumber === undefined) {
|
||||
config.setMeasurementNumberCallback(measurementData, mouseEventData, doneCallback);
|
||||
}
|
||||
|
||||
// associate this data with this imageId so we can render it and manipulate it
|
||||
cornerstoneTools.addToolState(element, toolType, measurementData);
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
}];
|
||||
|
||||
var configuration = {
|
||||
setMeasurementNumberCallback: setMeasurementNumberCallback,
|
||||
getMeasurementLocationCallback: getMeasurementLocationCallback,
|
||||
changeMeasurementLocationCallback: changeMeasurementLocationCallback,
|
||||
drawHandles: false,
|
||||
@@ -26,12 +25,6 @@
|
||||
ESC: 27
|
||||
};
|
||||
|
||||
// Set lesion number
|
||||
// Get Non-Target lesions on image
|
||||
function setMeasurementNumberCallback(measurementData, eventData, doneCallback) {
|
||||
var measurementNumber = 1;
|
||||
doneCallback(measurementNumber);
|
||||
}
|
||||
// Define a callback to get your text annotation
|
||||
// This could be used, e.g. to open a modal
|
||||
function getMeasurementLocationCallback(measurementData, eventData, doneCallback) {
|
||||
@@ -61,8 +54,7 @@
|
||||
function addNewMeasurement(mouseEventData) {
|
||||
var element = mouseEventData.element;
|
||||
|
||||
function doneCallback(measurementNumber) {
|
||||
measurementData.measurementNumber = measurementNumber;
|
||||
function doneCallback() {
|
||||
measurementData.active = true;
|
||||
cornerstone.updateImage(element);
|
||||
}
|
||||
@@ -75,11 +67,6 @@
|
||||
|
||||
var config = cornerstoneTools[toolType].getConfiguration();
|
||||
|
||||
// Set lesion number and lesion name
|
||||
if (measurementData.measurementNumber === undefined) {
|
||||
config.setMeasurementNumberCallback(measurementData, mouseEventData, doneCallback);
|
||||
}
|
||||
|
||||
// associate this data with this imageId so we can render it and manipulate it
|
||||
cornerstoneTools.addToolState(mouseEventData.element, toolType, measurementData);
|
||||
|
||||
@@ -317,8 +304,7 @@
|
||||
function addNewMeasurementTouch(touchEventData) {
|
||||
var element = touchEventData.element;
|
||||
|
||||
function doneCallback(measurementNumber) {
|
||||
measurementData.measurementNumber = measurementNumber;
|
||||
function doneCallback() {
|
||||
measurementData.active = true;
|
||||
cornerstone.updateImage(element);
|
||||
}
|
||||
@@ -330,11 +316,6 @@
|
||||
$(element).off('CornerstoneToolsTap', cornerstoneTools[toolType + "Touch"].tapCallback);
|
||||
var config = cornerstoneTools[toolType].getConfiguration();
|
||||
|
||||
// Set lesion number and lesion name
|
||||
if (measurementData.lesionName === undefined) {
|
||||
config.setMeasurementNumberCallback(measurementData, touchEventData, doneCallback);
|
||||
}
|
||||
|
||||
cornerstone.updateImage(element);
|
||||
|
||||
cornerstoneTools.moveNewHandleTouch(touchEventData, toolType, measurementData, measurementData.handles.end, function() {
|
||||
|
||||
-32
@@ -2,37 +2,6 @@
|
||||
// is in the process of being moved into another location
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
// This event sets measurement number for new measurement
|
||||
function getSetMeasurementNumberCallbackFunction(measurementTypeId, measurementApi, timepointApi) {
|
||||
return (measurementData, eventData, doneCallback) => {
|
||||
// Get the current element's timepointId from the study date metadata
|
||||
var element = eventData.element;
|
||||
var enabledElement = cornerstone.getEnabledElement(element);
|
||||
var imageId = enabledElement.image.imageId;
|
||||
|
||||
var study = cornerstoneTools.metaData.get('study', imageId);
|
||||
if (!timepointApi) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Find the relevant timepoint given the current study
|
||||
var timepoint = timepointApi.study(study.studyInstanceUid)[0];
|
||||
if (!timepoint) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 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.tools[measurementTypeId];
|
||||
const measurementNumber = OHIF.measurements.MeasurementManager.getNewMeasurementNumber(timepointId, collection, timepointApi);
|
||||
measurementData.measurementNumber = measurementNumber;
|
||||
|
||||
// Set measurement number
|
||||
doneCallback(measurementNumber);
|
||||
};
|
||||
}
|
||||
|
||||
Template.measurementLocationDialog.onCreated(() => {
|
||||
const instance = Template.instance();
|
||||
const measurementTypeId = 'bidirectional';
|
||||
@@ -67,7 +36,6 @@ Template.measurementLocationDialog.onCreated(() => {
|
||||
};
|
||||
|
||||
const callbackConfig = {
|
||||
setMeasurementNumberCallback: getSetMeasurementNumberCallbackFunction(measurementTypeId, measurementApi, timepointApi),
|
||||
// TODO: Check the position for these, the Add Label button position seems very awkward
|
||||
getMeasurementLocationCallback: toggleLabel,
|
||||
changeMeasurementLocationCallback: toggleLabel,
|
||||
|
||||
Reference in new issue
Block a user