LT-275: Work towards proper measurement / tooldata syncing
This commit is contained in:
parent
ec6f96e714
commit
9aa7cf012f
@ -3,7 +3,7 @@
|
|||||||
<div class="viewerDialogs">
|
<div class="viewerDialogs">
|
||||||
{{>confirmDeleteDialog}}
|
{{>confirmDeleteDialog}}
|
||||||
{{>measurementLocationDialog (clone this)}}
|
{{>measurementLocationDialog (clone this)}}
|
||||||
{{>nonTargetLesionDialog (clone this)}}
|
{{>nonTargetMeasurementDialog (clone this)}}
|
||||||
{{>nonTargetResponseDialog (clone this)}}
|
{{>nonTargetResponseDialog (clone this)}}
|
||||||
{{>measurementTableHUD (clone this)}}
|
{{>measurementTableHUD (clone this)}}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -5,9 +5,9 @@
|
|||||||
var toolType = 'bidirectional';
|
var toolType = 'bidirectional';
|
||||||
|
|
||||||
var configuration = {
|
var configuration = {
|
||||||
setLesionNumberCallback: setLesionNumberCallback,
|
setMeasurementNumberCallback: setMeasurementNumberCallback,
|
||||||
getLesionLocationCallback: getLesionLocationCallback,
|
getMeasurementLocationCallback: getMeasurementLocationCallback,
|
||||||
changeLesionLocationCallback: changeLesionLocationCallback
|
changeMeasurementLocationCallback: changeMeasurementLocationCallback
|
||||||
};
|
};
|
||||||
|
|
||||||
// Used to cancel tool placement
|
// Used to cancel tool placement
|
||||||
@ -17,18 +17,18 @@
|
|||||||
|
|
||||||
// Set lesion number
|
// Set lesion number
|
||||||
// Get Target lesions on image
|
// Get Target lesions on image
|
||||||
function setLesionNumberCallback(measurementData, eventData, doneCallback) {
|
function setMeasurementNumberCallback(measurementData, eventData, doneCallback) {
|
||||||
var lesionNumber = 1;
|
var measurementNumber = 1;
|
||||||
doneCallback(lesionNumber);
|
doneCallback(measurementNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define a callback to get your text annotation
|
// Define a callback to get your text annotation
|
||||||
// This could be used, e.g. to open a modal
|
// This could be used, e.g. to open a modal
|
||||||
function getLesionLocationCallback(measurementData, eventData, doneCallback) {
|
function getMeasurementLocationCallback(measurementData, eventData, doneCallback) {
|
||||||
//doneCallback(prompt('Enter your lesion location:'));
|
//doneCallback(prompt('Enter your lesion location:'));
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeLesionLocationCallback(measurementData, eventData, doneCallback) {
|
function changeMeasurementLocationCallback(measurementData, eventData, doneCallback) {
|
||||||
//doneCallback(prompt('Change your lesion location:'));
|
//doneCallback(prompt('Change your lesion location:'));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,8 +97,8 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function doneCallback(lesionNumber) {
|
function doneCallback(measurementNumber) {
|
||||||
measurementData.lesionNumber = lesionNumber;
|
measurementData.measurementNumber = measurementNumber;
|
||||||
measurementData.active = false;
|
measurementData.active = false;
|
||||||
cornerstone.updateImage(element);
|
cornerstone.updateImage(element);
|
||||||
}
|
}
|
||||||
@ -111,8 +111,8 @@
|
|||||||
|
|
||||||
// Set lesion number and lesion name
|
// Set lesion number and lesion name
|
||||||
var config = cornerstoneTools.bidirectional.getConfiguration();
|
var config = cornerstoneTools.bidirectional.getConfiguration();
|
||||||
if (measurementData.lesionNumber === undefined) {
|
if (measurementData.measurementNumber === undefined) {
|
||||||
config.setLesionNumberCallback(measurementData, mouseEventData, doneCallback);
|
config.setMeasurementNumberCallback(measurementData, mouseEventData, doneCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
// associate this data with this imageId so we can render it and manipulate it
|
// associate this data with this imageId so we can render it and manipulate it
|
||||||
@ -150,7 +150,7 @@
|
|||||||
cornerstoneTools.removeToolState(element, toolType, measurementData);
|
cornerstoneTools.removeToolState(element, toolType, measurementData);
|
||||||
} else {
|
} else {
|
||||||
// Set lesionMeasurementData Session
|
// Set lesionMeasurementData Session
|
||||||
config.getLesionLocationCallback(measurementData, mouseEventData, doneCallback);
|
config.getMeasurementLocationCallback(measurementData, mouseEventData, doneCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unbind the Esc keydown hook
|
// Unbind the Esc keydown hook
|
||||||
@ -175,8 +175,8 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function doneCallback(lesionNumber) {
|
function doneCallback(measurementNumber) {
|
||||||
measurementData.lesionNumber = lesionNumber;
|
measurementData.measurementNumber = measurementNumber;
|
||||||
measurementData.active = false;
|
measurementData.active = false;
|
||||||
cornerstone.updateImage(element);
|
cornerstone.updateImage(element);
|
||||||
}
|
}
|
||||||
@ -185,8 +185,8 @@
|
|||||||
|
|
||||||
// Set lesion number and lesion name
|
// Set lesion number and lesion name
|
||||||
var config = cornerstoneTools.bidirectional.getConfiguration();
|
var config = cornerstoneTools.bidirectional.getConfiguration();
|
||||||
if (measurementData.lesionNumber === undefined) {
|
if (measurementData.measurementNumber === undefined) {
|
||||||
config.setLesionNumberCallback(measurementData, mouseEventData, doneCallback);
|
config.setMeasurementNumberCallback(measurementData, mouseEventData, doneCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
// associate this data with this imageId so we can render it and manipulate it
|
// associate this data with this imageId so we can render it and manipulate it
|
||||||
@ -205,7 +205,7 @@
|
|||||||
cornerstoneTools.removeToolState(element, toolType, measurementData);
|
cornerstoneTools.removeToolState(element, toolType, measurementData);
|
||||||
} else {
|
} else {
|
||||||
// Set lesionMeasurementData Session
|
// Set lesionMeasurementData Session
|
||||||
config.getLesionLocationCallback(measurementData, touchEventData, doneCallback);
|
config.getMeasurementLocationCallback(measurementData, touchEventData, doneCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
// perpendicular line is not connected to long-line
|
// perpendicular line is not connected to long-line
|
||||||
@ -1025,7 +1025,7 @@
|
|||||||
|
|
||||||
var lengthText = ' L ' + length.toFixed(1) + suffix;
|
var lengthText = ' L ' + length.toFixed(1) + suffix;
|
||||||
var widthText = ' W ' + width.toFixed(1) + suffix;
|
var widthText = ' W ' + width.toFixed(1) + suffix;
|
||||||
var textLines = [ 'Target ' + data.lesionNumber, lengthText, widthText ];
|
var textLines = [ 'Target ' + data.measurementNumber, lengthText, widthText ];
|
||||||
|
|
||||||
var boundingBox = cornerstoneTools.drawTextBox(context,
|
var boundingBox = cornerstoneTools.drawTextBox(context,
|
||||||
textLines,
|
textLines,
|
||||||
@ -1075,7 +1075,7 @@
|
|||||||
data.active = true;
|
data.active = true;
|
||||||
cornerstone.updateImage(element);
|
cornerstone.updateImage(element);
|
||||||
// Allow relabelling via a callback
|
// Allow relabelling via a callback
|
||||||
config.changeLesionLocationCallback(data, eventData, doneCallback);
|
config.changeMeasurementLocationCallback(data, eventData, doneCallback);
|
||||||
|
|
||||||
e.stopImmediatePropagation();
|
e.stopImmediatePropagation();
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -5,9 +5,9 @@
|
|||||||
var toolType = 'nonTarget';
|
var toolType = 'nonTarget';
|
||||||
|
|
||||||
var configuration = {
|
var configuration = {
|
||||||
setLesionNumberCallback: setLesionNumberCallback,
|
setMeasurementNumberCallback: setMeasurementNumberCallback,
|
||||||
getLesionLocationCallback: getLesionLocationCallback,
|
getmeasurementLocationCallback: getmeasurementLocationCallback,
|
||||||
changeLesionLocationCallback: changeLesionLocationCallback,
|
changemeasurementLocationCallback: changemeasurementLocationCallback,
|
||||||
drawHandles: false,
|
drawHandles: false,
|
||||||
drawHandlesOnHover: true,
|
drawHandlesOnHover: true,
|
||||||
arrowFirst: true
|
arrowFirst: true
|
||||||
@ -18,20 +18,20 @@
|
|||||||
ESC: 27
|
ESC: 27
|
||||||
};
|
};
|
||||||
|
|
||||||
// Set lesion number
|
// Set measurement number
|
||||||
// Get Non-Target lesions on image
|
// Get Non-Target measurements on image
|
||||||
function setLesionNumberCallback(measurementData, eventData, doneCallback) {
|
function setMeasurementNumberCallback(measurementData, eventData, doneCallback) {
|
||||||
var lesionNumber = 1;
|
var measurementNumber = 1;
|
||||||
doneCallback(lesionNumber);
|
doneCallback(measurementNumber);
|
||||||
}
|
}
|
||||||
// Define a callback to get your text annotation
|
// Define a callback to get your text annotation
|
||||||
// This could be used, e.g. to open a modal
|
// This could be used, e.g. to open a modal
|
||||||
function getLesionLocationCallback(measurementData, eventData, doneCallback) {
|
function getmeasurementLocationCallback(measurementData, eventData, doneCallback) {
|
||||||
doneCallback(prompt('Enter your lesion location:'));
|
doneCallback(prompt('Enter your measurement location:'));
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeLesionLocationCallback(measurementData, eventData, doneCallback) {
|
function changemeasurementLocationCallback(measurementData, eventData, doneCallback) {
|
||||||
doneCallback(prompt('Change your lesion location:'));
|
doneCallback(prompt('Change your measurement location:'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// --- Mouse Tool --- ///
|
/// --- Mouse Tool --- ///
|
||||||
@ -39,8 +39,8 @@
|
|||||||
function addNewMeasurement(mouseEventData) {
|
function addNewMeasurement(mouseEventData) {
|
||||||
var element = mouseEventData.element;
|
var element = mouseEventData.element;
|
||||||
|
|
||||||
function doneCallback(lesionNumber) {
|
function doneCallback(measurementNumber) {
|
||||||
measurementData.lesionNumber = lesionNumber;
|
measurementData.measurementNumber = measurementNumber;
|
||||||
measurementData.active = true;
|
measurementData.active = true;
|
||||||
cornerstone.updateImage(element);
|
cornerstone.updateImage(element);
|
||||||
}
|
}
|
||||||
@ -53,9 +53,9 @@
|
|||||||
|
|
||||||
var config = cornerstoneTools.nonTarget.getConfiguration();
|
var config = cornerstoneTools.nonTarget.getConfiguration();
|
||||||
|
|
||||||
// Set lesion number and lesion name
|
// Set measurement number and measurement name
|
||||||
if (measurementData.lesionNumber === undefined) {
|
if (measurementData.measurementNumber === undefined) {
|
||||||
config.setLesionNumberCallback(measurementData, mouseEventData, doneCallback);
|
config.setMeasurementNumberCallback(measurementData, mouseEventData, doneCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
// associate this data with this imageId so we can render it and manipulate it
|
// associate this data with this imageId so we can render it and manipulate it
|
||||||
@ -92,7 +92,7 @@
|
|||||||
// delete the measurement
|
// delete the measurement
|
||||||
cornerstoneTools.removeToolState(mouseEventData.element, toolType, measurementData);
|
cornerstoneTools.removeToolState(mouseEventData.element, toolType, measurementData);
|
||||||
} else {
|
} else {
|
||||||
config.getLesionLocationCallback(measurementData, mouseEventData, doneCallback);
|
config.getmeasurementLocationCallback(measurementData, mouseEventData, doneCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unbind the Esc keydown hook
|
// Unbind the Esc keydown hook
|
||||||
@ -223,13 +223,13 @@
|
|||||||
if (config.drawHandles) {
|
if (config.drawHandles) {
|
||||||
cornerstoneTools.drawHandles(context, eventData, data.handles, color);
|
cornerstoneTools.drawHandles(context, eventData, data.handles, color);
|
||||||
} else if (config.drawHandlesOnHover && data.handles.start.active) {
|
} else if (config.drawHandlesOnHover && data.handles.start.active) {
|
||||||
cornerstoneTools.drawHandles(context, eventData, [ lesion.handles.start ], color);
|
cornerstoneTools.drawHandles(context, eventData, [ measurement.handles.start ], color);
|
||||||
} else if (config.drawHandlesOnHover && data.handles.end.active) {
|
} else if (config.drawHandlesOnHover && data.handles.end.active) {
|
||||||
cornerstoneTools.drawHandles(context, eventData, [ lesion.handles.end ], color);
|
cornerstoneTools.drawHandles(context, eventData, [ measurement.handles.end ], color);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw the text
|
// Draw the text
|
||||||
if (data.lesionNumber) {
|
if (data.measurementNumber) {
|
||||||
// Draw linked line as dashed
|
// Draw linked line as dashed
|
||||||
var mid = {
|
var mid = {
|
||||||
x: (handleStartCanvas.x + handleEndCanvas.x) / 2,
|
x: (handleStartCanvas.x + handleEndCanvas.x) / 2,
|
||||||
@ -245,7 +245,7 @@
|
|||||||
context.lineTo(canvasTextLocation.x + 20, canvasTextLocation.y + 20);
|
context.lineTo(canvasTextLocation.x + 20, canvasTextLocation.y + 20);
|
||||||
context.stroke();
|
context.stroke();
|
||||||
|
|
||||||
var boundingBox = cornerstoneTools.drawTextBox(context, 'Non-Target ' + data.lesionNumber, canvasTextLocation.x, canvasTextLocation.y, color);
|
var boundingBox = cornerstoneTools.drawTextBox(context, 'Non-Target ' + data.measurementNumber, canvasTextLocation.x, canvasTextLocation.y, color);
|
||||||
data.handles.textBox.boundingBox = boundingBox;
|
data.handles.textBox.boundingBox = boundingBox;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -259,8 +259,8 @@
|
|||||||
function addNewMeasurementTouch(touchEventData) {
|
function addNewMeasurementTouch(touchEventData) {
|
||||||
var element = touchEventData.element;
|
var element = touchEventData.element;
|
||||||
|
|
||||||
function doneCallback(lesionNumber) {
|
function doneCallback(measurementNumber) {
|
||||||
measurementData.lesionNumber = lesionNumber;
|
measurementData.measurementNumber = measurementNumber;
|
||||||
measurementData.active = true;
|
measurementData.active = true;
|
||||||
cornerstone.updateImage(element);
|
cornerstone.updateImage(element);
|
||||||
}
|
}
|
||||||
@ -272,9 +272,9 @@
|
|||||||
$(element).off('CornerstoneToolsTap', cornerstoneTools.nonTargetTouch.tapCallback);
|
$(element).off('CornerstoneToolsTap', cornerstoneTools.nonTargetTouch.tapCallback);
|
||||||
var config = cornerstoneTools.nonTarget.getConfiguration();
|
var config = cornerstoneTools.nonTarget.getConfiguration();
|
||||||
|
|
||||||
// Set lesion number and lesion name
|
// Set measurement number and measurement name
|
||||||
if (measurementData.lesionName === undefined) {
|
if (measurementData.measurementName === undefined) {
|
||||||
config.setLesionNumberCallback(measurementData, touchEventData, doneCallback);
|
config.setMeasurementNumberCallback(measurementData, touchEventData, doneCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
cornerstone.updateImage(element);
|
cornerstone.updateImage(element);
|
||||||
@ -287,7 +287,7 @@
|
|||||||
cornerstoneTools.removeToolState(element, toolType, measurementData);
|
cornerstoneTools.removeToolState(element, toolType, measurementData);
|
||||||
}
|
}
|
||||||
|
|
||||||
config.getLesionLocationCallback(measurementData, touchEventData, doneCallback);
|
config.getmeasurementLocationCallback(measurementData, touchEventData, doneCallback);
|
||||||
|
|
||||||
$(element).on('CornerstoneToolsTouchDrag', cornerstoneTools.nonTargetTouch.touchMoveHandle);
|
$(element).on('CornerstoneToolsTouchDrag', cornerstoneTools.nonTargetTouch.touchMoveHandle);
|
||||||
$(element).on('CornerstoneToolsDragStartActive', cornerstoneTools.nonTargetTouch.touchDownActivateCallback);
|
$(element).on('CornerstoneToolsDragStartActive', cornerstoneTools.nonTargetTouch.touchDownActivateCallback);
|
||||||
@ -330,7 +330,7 @@
|
|||||||
data.active = true;
|
data.active = true;
|
||||||
cornerstone.updateImage(element);
|
cornerstone.updateImage(element);
|
||||||
// Allow relabelling via a callback
|
// Allow relabelling via a callback
|
||||||
config.changeLesionLocationCallback(data, eventData, doneCallback);
|
config.changemeasurementLocationCallback(data, eventData, doneCallback);
|
||||||
|
|
||||||
e.stopImmediatePropagation();
|
e.stopImmediatePropagation();
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
}];
|
}];
|
||||||
|
|
||||||
var configuration = {
|
var configuration = {
|
||||||
setLesionNumberCallback: setLesionNumberCallback,
|
setmeasurementNumberCallback: setmeasurementNumberCallback,
|
||||||
getLesionLocationCallback: getLesionLocationCallback,
|
getLesionLocationCallback: getLesionLocationCallback,
|
||||||
changeLesionLocationCallback: changeLesionLocationCallback,
|
changeLesionLocationCallback: changeLesionLocationCallback,
|
||||||
drawHandles: false,
|
drawHandles: false,
|
||||||
@ -28,9 +28,9 @@
|
|||||||
|
|
||||||
// Set lesion number
|
// Set lesion number
|
||||||
// Get Non-Target lesions on image
|
// Get Non-Target lesions on image
|
||||||
function setLesionNumberCallback(measurementData, eventData, doneCallback) {
|
function setmeasurementNumberCallback(measurementData, eventData, doneCallback) {
|
||||||
var lesionNumber = 1;
|
var measurementNumber = 1;
|
||||||
doneCallback(lesionNumber);
|
doneCallback(measurementNumber);
|
||||||
}
|
}
|
||||||
// Define a callback to get your text annotation
|
// Define a callback to get your text annotation
|
||||||
// This could be used, e.g. to open a modal
|
// This could be used, e.g. to open a modal
|
||||||
@ -61,8 +61,8 @@
|
|||||||
function addNewMeasurement(mouseEventData) {
|
function addNewMeasurement(mouseEventData) {
|
||||||
var element = mouseEventData.element;
|
var element = mouseEventData.element;
|
||||||
|
|
||||||
function doneCallback(lesionNumber) {
|
function doneCallback(measurementNumber) {
|
||||||
measurementData.lesionNumber = lesionNumber;
|
measurementData.measurementNumber = measurementNumber;
|
||||||
measurementData.active = true;
|
measurementData.active = true;
|
||||||
cornerstone.updateImage(element);
|
cornerstone.updateImage(element);
|
||||||
}
|
}
|
||||||
@ -76,8 +76,8 @@
|
|||||||
var config = cornerstoneTools[toolType].getConfiguration();
|
var config = cornerstoneTools[toolType].getConfiguration();
|
||||||
|
|
||||||
// Set lesion number and lesion name
|
// Set lesion number and lesion name
|
||||||
if (measurementData.lesionNumber === undefined) {
|
if (measurementData.measurementNumber === undefined) {
|
||||||
config.setLesionNumberCallback(measurementData, mouseEventData, doneCallback);
|
config.setmeasurementNumberCallback(measurementData, mouseEventData, doneCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
// associate this data with this imageId so we can render it and manipulate it
|
// associate this data with this imageId so we can render it and manipulate it
|
||||||
@ -287,7 +287,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Draw the text
|
// Draw the text
|
||||||
if (data.lesionNumber) {
|
if (data.measurementNumber) {
|
||||||
// Draw linked line as dashed
|
// Draw linked line as dashed
|
||||||
var mid = {
|
var mid = {
|
||||||
x: (handleStartCanvas.x + handleEndCanvas.x) / 2,
|
x: (handleStartCanvas.x + handleEndCanvas.x) / 2,
|
||||||
@ -303,7 +303,7 @@
|
|||||||
context.lineTo(canvasTextLocation.x + 20, canvasTextLocation.y + 20);
|
context.lineTo(canvasTextLocation.x + 20, canvasTextLocation.y + 20);
|
||||||
context.stroke();
|
context.stroke();
|
||||||
|
|
||||||
var boundingBox = cornerstoneTools.drawTextBox(context, "Target " + +data.lesionNumber, canvasTextLocation.x, canvasTextLocation.y, color);
|
var boundingBox = cornerstoneTools.drawTextBox(context, "Target " + +data.measurementNumber, canvasTextLocation.x, canvasTextLocation.y, color);
|
||||||
data.handles.textBox.boundingBox = boundingBox;
|
data.handles.textBox.boundingBox = boundingBox;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -317,8 +317,8 @@
|
|||||||
function addNewMeasurementTouch(touchEventData) {
|
function addNewMeasurementTouch(touchEventData) {
|
||||||
var element = touchEventData.element;
|
var element = touchEventData.element;
|
||||||
|
|
||||||
function doneCallback(lesionNumber) {
|
function doneCallback(measurementNumber) {
|
||||||
measurementData.lesionNumber = lesionNumber;
|
measurementData.measurementNumber = measurementNumber;
|
||||||
measurementData.active = true;
|
measurementData.active = true;
|
||||||
cornerstone.updateImage(element);
|
cornerstone.updateImage(element);
|
||||||
}
|
}
|
||||||
@ -332,7 +332,7 @@
|
|||||||
|
|
||||||
// Set lesion number and lesion name
|
// Set lesion number and lesion name
|
||||||
if (measurementData.lesionName === undefined) {
|
if (measurementData.lesionName === undefined) {
|
||||||
config.setLesionNumberCallback(measurementData, touchEventData, doneCallback);
|
config.setmeasurementNumberCallback(measurementData, touchEventData, doneCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
cornerstone.updateImage(element);
|
cornerstone.updateImage(element);
|
||||||
|
|||||||
@ -9,9 +9,9 @@ import './measurementLocationDialog/measurementLocationDialog.html';
|
|||||||
import './measurementLocationDialog/measurementLocationDialog.js';
|
import './measurementLocationDialog/measurementLocationDialog.js';
|
||||||
import './measurementLocationDialog/measurementLocationDialog.styl';
|
import './measurementLocationDialog/measurementLocationDialog.styl';
|
||||||
|
|
||||||
import './nonTargetLesionDialog/nonTargetLesionDialog.html';
|
import './nonTargetMeasurementDialog/nonTargetMeasurementDialog.html';
|
||||||
import './nonTargetLesionDialog/nonTargetLesionDialog.styl';
|
import './nonTargetMeasurementDialog/nonTargetMeasurementDialog.styl';
|
||||||
import './nonTargetLesionDialog/nonTargetLesionDialog.js';
|
import './nonTargetMeasurementDialog/nonTargetMeasurementDialog.js';
|
||||||
|
|
||||||
import './nonTargetResponseDialog/nonTargetResponseDialog.html';
|
import './nonTargetResponseDialog/nonTargetResponseDialog.html';
|
||||||
import './nonTargetResponseDialog/nonTargetResponseDialog.styl';
|
import './nonTargetResponseDialog/nonTargetResponseDialog.styl';
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { OHIF } from 'meteor/ohif:core';
|
import { OHIF } from 'meteor/ohif:core';
|
||||||
|
|
||||||
function closeHandler(dialog) {
|
function closeHandler(dialog) {
|
||||||
// Hide the lesion dialog
|
// Hide the measurement dialog
|
||||||
$(dialog).css('display', 'none');
|
$(dialog).css('display', 'none');
|
||||||
|
|
||||||
// Remove the backdrop
|
// Remove the backdrop
|
||||||
@ -11,8 +11,8 @@ function closeHandler(dialog) {
|
|||||||
setFocusToActiveViewport();
|
setFocusToActiveViewport();
|
||||||
}
|
}
|
||||||
|
|
||||||
// This event sets lesion number for new lesion
|
// This event sets measurement number for new measurement
|
||||||
function getSetLesionNumberCallbackFunction(measurementTypeId, measurementApi, timepointApi) {
|
function getSetMeasurementNumberCallbackFunction(measurementTypeId, measurementApi, timepointApi) {
|
||||||
return (measurementData, eventData, doneCallback) => {
|
return (measurementData, eventData, doneCallback) => {
|
||||||
// Get the current element's timepointId from the study date metadata
|
// Get the current element's timepointId from the study date metadata
|
||||||
var element = eventData.element;
|
var element = eventData.element;
|
||||||
@ -30,29 +30,29 @@ function getSetLesionNumberCallbackFunction(measurementTypeId, measurementApi, t
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get a lesion number for this lesion, depending on whether or not the same lesion previously
|
// Get a measurement number for this measurement, depending on whether or not the same measurement previously
|
||||||
// exists at a different timepoint
|
// exists at a different timepoint
|
||||||
const timepointId = timepoint.timepointId;
|
const timepointId = timepoint.timepointId;
|
||||||
const collection = measurementApi[measurementTypeId];
|
const collection = measurementApi[measurementTypeId];
|
||||||
const measurementNumber = OHIF.measurements.MeasurementManager.getNewMeasurementNumber(timepointId, collection, timepointApi);
|
const measurementNumber = OHIF.measurements.MeasurementManager.getNewMeasurementNumber(timepointId, collection, timepointApi);
|
||||||
measurementData.measurementNumber = measurementNumber;
|
measurementData.measurementNumber = measurementNumber;
|
||||||
|
|
||||||
// Set lesion number
|
// Set measurement number
|
||||||
doneCallback(measurementNumber);
|
doneCallback(measurementNumber);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// This event determines whether or not to show the lesion dialog
|
// This event determines whether or not to show the measurement dialog
|
||||||
// If there already exists a lesion with this specific lesion number,
|
// If there already exists a measurement with this specific measurement number,
|
||||||
// related to the chosen location.
|
// related to the chosen location.
|
||||||
function getLesionLocationCallback(measurementData, eventData) {
|
function getMeasurementLocationCallback(measurementData, eventData) {
|
||||||
return;
|
return;
|
||||||
Template.measurementLocationDialog.measurementData = measurementData;
|
Template.measurementLocationDialog.measurementData = measurementData;
|
||||||
|
|
||||||
// Reset the doneCallback saved in the template so we don't call the change event's done callback
|
// Reset the doneCallback saved in the template so we don't call the change event's done callback
|
||||||
Template.measurementLocationDialog.doneCallback = undefined;
|
Template.measurementLocationDialog.doneCallback = undefined;
|
||||||
|
|
||||||
// Get the lesion location dialog
|
// Get the measurement location dialog
|
||||||
var dialog = $('#measurementLocationDialog');
|
var dialog = $('#measurementLocationDialog');
|
||||||
Template.measurementLocationDialog.dialog = dialog;
|
Template.measurementLocationDialog.dialog = dialog;
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ function getLesionLocationCallback(measurementData, eventData) {
|
|||||||
var selector = dialog.find('select.selectMeasurementLocation');
|
var selector = dialog.find('select.selectMeasurementLocation');
|
||||||
selector.find('option:first').prop('selected', true);
|
selector.find('option:first').prop('selected', true);
|
||||||
|
|
||||||
// Find out if this lesion number is already added in the lesion manager for another timepoint
|
// Find out if this measurement number is already added in the measurement manager for another timepoint
|
||||||
// If it is, stop here because we don't need the dialog.
|
// If it is, stop here because we don't need the dialog.
|
||||||
var locationUID = OHIF.measurements.MeasurementManager.getLocationIdIfMeasurementExists(measurementData);
|
var locationUID = OHIF.measurements.MeasurementManager.getLocationIdIfMeasurementExists(measurementData);
|
||||||
if (locationUID) {
|
if (locationUID) {
|
||||||
@ -76,13 +76,13 @@ function getLesionLocationCallback(measurementData, eventData) {
|
|||||||
measurementData.id = 'notready';
|
measurementData.id = 'notready';
|
||||||
|
|
||||||
measurementData.locationUID = locationUID;
|
measurementData.locationUID = locationUID;
|
||||||
LesionManager.updateLesionData(measurementData);
|
MeasurementManager.updateMeasurementData(measurementData);
|
||||||
closeHandler();
|
closeHandler();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// If it isn't, continue to open the dialog and have the user choose a lesion location
|
// If it isn't, continue to open the dialog and have the user choose a measurement location
|
||||||
|
|
||||||
// Show the lesion location dialog above
|
// Show the measurement location dialog above
|
||||||
var dialogProperty = {
|
var dialogProperty = {
|
||||||
top: eventData.currentPoints.page.y - dialog.outerHeight() - 40,
|
top: eventData.currentPoints.page.y - dialog.outerHeight() - 40,
|
||||||
left: eventData.currentPoints.page.x - dialog.outerWidth() / 2,
|
left: eventData.currentPoints.page.x - dialog.outerWidth() / 2,
|
||||||
@ -112,12 +112,12 @@ function getLesionLocationCallback(measurementData, eventData) {
|
|||||||
dialog.focus();
|
dialog.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
changeLesionLocationCallback = function(measurementData, eventData, doneCallback) {
|
changeMeasurementLocationCallback = function(measurementData, eventData, doneCallback) {
|
||||||
return;
|
return;
|
||||||
Template.measurementLocationDialog.measurementData = measurementData;
|
Template.measurementLocationDialog.measurementData = measurementData;
|
||||||
Template.measurementLocationDialog.doneCallback = doneCallback;
|
Template.measurementLocationDialog.doneCallback = doneCallback;
|
||||||
|
|
||||||
// Get the lesion location dialog
|
// Get the measurement location dialog
|
||||||
var dialog = $('#measurementLocationRelabelDialog');
|
var dialog = $('#measurementLocationRelabelDialog');
|
||||||
|
|
||||||
// Show/Hide Convert To NonTarget option in measurementLocationRelabelDialog
|
// Show/Hide Convert To NonTarget option in measurementLocationRelabelDialog
|
||||||
@ -137,7 +137,7 @@ changeLesionLocationCallback = function(measurementData, eventData, doneCallback
|
|||||||
closeHandler(dialog);
|
closeHandler(dialog);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Show the lesion location dialog above
|
// Show the measurement location dialog above
|
||||||
var dialogProperty = {
|
var dialogProperty = {
|
||||||
display: 'block'
|
display: 'block'
|
||||||
};
|
};
|
||||||
@ -164,7 +164,7 @@ changeLesionLocationCallback = function(measurementData, eventData, doneCallback
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LesionLocations.update({},
|
MeasurementLocations.update({},
|
||||||
{
|
{
|
||||||
$set: {
|
$set: {
|
||||||
selected: false
|
selected: false
|
||||||
@ -173,7 +173,7 @@ changeLesionLocationCallback = function(measurementData, eventData, doneCallback
|
|||||||
multi: true
|
multi: true
|
||||||
});
|
});
|
||||||
|
|
||||||
var currentLocation = LesionLocations.findOne({
|
var currentLocation = MeasurementLocations.findOne({
|
||||||
id: measurement.locationId
|
id: measurement.locationId
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -181,7 +181,7 @@ changeLesionLocationCallback = function(measurementData, eventData, doneCallback
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LesionLocations.update(currentLocation._id, {
|
MeasurementLocations.update(currentLocation._id, {
|
||||||
$set: {
|
$set: {
|
||||||
selected: true
|
selected: true
|
||||||
}
|
}
|
||||||
@ -195,9 +195,9 @@ Template.measurementLocationDialog.onCreated(() => {
|
|||||||
const timepointApi = instance.data.timepointApi;
|
const timepointApi = instance.data.timepointApi;
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
setLesionNumberCallback: getSetLesionNumberCallbackFunction(measurementTypeId, measurementApi, timepointApi),
|
setMeasurementNumberCallback: getSetMeasurementNumberCallbackFunction(measurementTypeId, measurementApi, timepointApi),
|
||||||
getLesionLocationCallback: getLesionLocationCallback,
|
getMeasurementLocationCallback: getMeasurementLocationCallback,
|
||||||
changeLesionLocationCallback: changeLesionLocationCallback
|
changeMeasurementLocationCallback: changeMeasurementLocationCallback
|
||||||
};
|
};
|
||||||
|
|
||||||
cornerstoneTools.bidirectional.setConfiguration(config);
|
cornerstoneTools.bidirectional.setConfiguration(config);
|
||||||
@ -225,7 +225,7 @@ Template.measurementLocationDialog.events({
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get selected location data
|
// Get selected location data
|
||||||
var locationObj = LesionLocations.findOne({
|
var locationObj = MeasurementLocations.findOne({
|
||||||
_id: selectedOptionId
|
_id: selectedOptionId
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -242,7 +242,7 @@ Template.measurementLocationDialog.events({
|
|||||||
doneCallback(measurementData);
|
doneCallback(measurementData);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'click #removeLesion': function() {
|
'click #removeMeasurement': function() {
|
||||||
var measurementData = Template.measurementLocationDialog.measurementData;
|
var measurementData = Template.measurementLocationDialog.measurementData;
|
||||||
var doneCallback = Template.measurementLocationDialog.doneCallback;
|
var doneCallback = Template.measurementLocationDialog.doneCallback;
|
||||||
var dialog = Template.measurementLocationDialog.dialog;
|
var dialog = Template.measurementLocationDialog.dialog;
|
||||||
@ -268,11 +268,11 @@ Template.measurementLocationDialog.events({
|
|||||||
|
|
||||||
const instance = Template.instance();
|
const instance = Template.instance();
|
||||||
const measurementApi = instance.data.measurementApi;
|
const measurementApi = instance.data.measurementApi;
|
||||||
OHIF.lesiontracker.convertToNonTarget(measurementApi, measurementData);
|
OHIF.measurementtracker.convertToNonTarget(measurementApi, measurementData);
|
||||||
|
|
||||||
closeHandler(dialog);
|
closeHandler(dialog);
|
||||||
},
|
},
|
||||||
'click #btnCloseLesionPopup': function() {
|
'click #btnCloseMeasurementPopup': function() {
|
||||||
var dialog = Template.measurementLocationDialog.dialog;
|
var dialog = Template.measurementLocationDialog.dialog;
|
||||||
closeHandler(dialog);
|
closeHandler(dialog);
|
||||||
},
|
},
|
||||||
@ -289,6 +289,6 @@ Template.measurementLocationDialog.events({
|
|||||||
|
|
||||||
Template.measurementLocationDialog.helpers({
|
Template.measurementLocationDialog.helpers({
|
||||||
measurementLocations() {
|
measurementLocations() {
|
||||||
return LesionLocations.find();
|
return MeasurementLocations.find();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<template name="nonTargetLesionDialog">
|
<template name="nonTargetMeasurementDialog">
|
||||||
<div id="nonTargetLesionLocationDialog" class="dialog-animated" tabindex="0">
|
<div id="nonTargetMeasurementDialog" class="dialog-animated" tabindex="0">
|
||||||
<div class="dialogHeader">
|
<div class="dialogHeader">
|
||||||
<h4>Select Lesion Location</h4>
|
<h4>Select Lesion Location</h4>
|
||||||
</div>
|
</div>
|
||||||
@ -1,7 +1,7 @@
|
|||||||
import { OHIF } from 'meteor/ohif:core';
|
import { OHIF } from 'meteor/ohif:core';
|
||||||
|
|
||||||
function closeHandler(dialog) {
|
function closeHandler(dialog) {
|
||||||
// Hide the lesion dialog
|
// Hide the measurement dialog
|
||||||
$(dialog).css('display', 'none');
|
$(dialog).css('display', 'none');
|
||||||
|
|
||||||
// Remove the backdrop
|
// Remove the backdrop
|
||||||
@ -11,8 +11,8 @@ function closeHandler(dialog) {
|
|||||||
setFocusToActiveViewport();
|
setFocusToActiveViewport();
|
||||||
}
|
}
|
||||||
|
|
||||||
// This event sets lesion number for new lesion
|
// This event sets measurement number for new measurement
|
||||||
function getSetLesionNumberCallbackFunction(measurementTypeId, measurementApi, timepointApi) {
|
function getSetMeasurementNumberCallbackFunction(measurementTypeId, measurementApi, timepointApi) {
|
||||||
return (measurementData, eventData, doneCallback) => {
|
return (measurementData, eventData, doneCallback) => {
|
||||||
// Get the current element's timepointId from the study date metadata
|
// Get the current element's timepointId from the study date metadata
|
||||||
var element = eventData.element;
|
var element = eventData.element;
|
||||||
@ -27,14 +27,14 @@ function getSetLesionNumberCallbackFunction(measurementTypeId, measurementApi, t
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get a lesion number for this lesion, depending on whether or not the same lesion previously
|
// Get a measurement number for this measurement, depending on whether or not the same measurement previously
|
||||||
// exists at a different timepoint
|
// exists at a different timepoint
|
||||||
const timepointId = timepoint.timepointId;
|
const timepointId = timepoint.timepointId;
|
||||||
const collection = measurementApi[measurementTypeId];
|
const collection = measurementApi[measurementTypeId];
|
||||||
const measurementNumber = OHIF.measurements.MeasurementManager.getNewMeasurementNumber(timepointId, collection, timepointApi);
|
const measurementNumber = OHIF.measurements.MeasurementManager.getNewMeasurementNumber(timepointId, collection, timepointApi);
|
||||||
measurementData.measurementNumber = measurementNumber;
|
measurementData.measurementNumber = measurementNumber;
|
||||||
|
|
||||||
// Set lesion number
|
// Set measurement number
|
||||||
doneCallback(measurementNumber);
|
doneCallback(measurementNumber);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -64,16 +64,16 @@ function selectNonTargetResponse(responseCode) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// This event determines whether or not to show the Non-Target lesion dialog
|
// This event determines whether or not to show the Non-Target measurement dialog
|
||||||
// If there already exists a lesion with this specific lesion number,
|
// If there already exists a measurement with this specific measurement number,
|
||||||
// related to the chosen location.
|
// related to the chosen location.
|
||||||
function getLesionLocationCallback(measurementData, eventData) {
|
function getMeasurementLocationCallback(measurementData, eventData) {
|
||||||
return 'Test Location';
|
return 'Test Location';
|
||||||
Template.nonTargetLesionDialog.measurementData = measurementData;
|
Template.nonTargetMeasurementDialog.measurementData = measurementData;
|
||||||
|
|
||||||
// Get the non-target lesion location dialog
|
// Get the non-target measurement location dialog
|
||||||
var dialog = $('#nonTargetLesionLocationDialog');
|
var dialog = $('#nonTargetMeasurementLocationDialog');
|
||||||
Template.nonTargetLesionDialog.dialog = dialog;
|
Template.nonTargetMeasurementDialog.dialog = dialog;
|
||||||
|
|
||||||
// Show the backdrop
|
// Show the backdrop
|
||||||
UI.render(Template.removableBackdrop, document.body);
|
UI.render(Template.removableBackdrop, document.body);
|
||||||
@ -84,7 +84,7 @@ function getLesionLocationCallback(measurementData, eventData) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Find the select option box
|
// Find the select option box
|
||||||
var selectorLocation = dialog.find('select#selectNonTargetLesionLocation');
|
var selectorLocation = dialog.find('select#selectNonTargetMeasurementLocation');
|
||||||
|
|
||||||
selectorLocation.find('option:first').prop('selected', 'selected');
|
selectorLocation.find('option:first').prop('selected', 'selected');
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ function getLesionLocationCallback(measurementData, eventData) {
|
|||||||
// Allow location selection
|
// Allow location selection
|
||||||
selectorLocation.removeAttr('disabled');
|
selectorLocation.removeAttr('disabled');
|
||||||
|
|
||||||
// Find out if this lesion number is already added in the lesion manager for another timepoint
|
// Find out if this measurement number is already added in the measurement manager for another timepoint
|
||||||
// If it is, disable selector location
|
// If it is, disable selector location
|
||||||
var locationId = OHIF.measurements.MeasurementManager.getLocationIdIfMeasurementExists(measurementData);
|
var locationId = OHIF.measurements.MeasurementManager.getLocationIdIfMeasurementExists(measurementData);
|
||||||
if (locationId) {
|
if (locationId) {
|
||||||
@ -117,7 +117,7 @@ function getLesionLocationCallback(measurementData, eventData) {
|
|||||||
|
|
||||||
// Disable selector location to prevent selecting a new location
|
// Disable selector location to prevent selecting a new location
|
||||||
function disableLocationSelection(locationId) {
|
function disableLocationSelection(locationId) {
|
||||||
var locationObject = LesionLocations.findOne({
|
var locationObject = MeasurementLocations.findOne({
|
||||||
id: locationId
|
id: locationId
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -129,7 +129,7 @@ function getLesionLocationCallback(measurementData, eventData) {
|
|||||||
selectorLocation.prop('disabled', true);
|
selectorLocation.prop('disabled', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show the nonTargetLesion dialog above
|
// Show the nonTargetMeasurement dialog above
|
||||||
var dialogProperty = {
|
var dialogProperty = {
|
||||||
top: eventData.currentPoints.page.y - dialog.outerHeight() - 40,
|
top: eventData.currentPoints.page.y - dialog.outerHeight() - 40,
|
||||||
left: eventData.currentPoints.page.x - dialog.outerWidth() / 2,
|
left: eventData.currentPoints.page.x - dialog.outerWidth() / 2,
|
||||||
@ -160,12 +160,12 @@ function getLesionLocationCallback(measurementData, eventData) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
changeNonTargetLocationCallback = function(measurementData, eventData, doneCallback) {
|
changeNonTargetLocationCallback = function(measurementData, eventData, doneCallback) {
|
||||||
Template.nonTargetLesionDialog.measurementData = measurementData;
|
Template.nonTargetMeasurementDialog.measurementData = measurementData;
|
||||||
Template.nonTargetLesionDialog.doneCallback = doneCallback;
|
Template.nonTargetMeasurementDialog.doneCallback = doneCallback;
|
||||||
|
|
||||||
// Get the non-target lesion location dialog
|
// Get the non-target measurement location dialog
|
||||||
var dialog = $('#nonTargetLesionRelabelDialog');
|
var dialog = $('#nonTargetMeasurementRelabelDialog');
|
||||||
Template.nonTargetLesionDialog.dialog = dialog;
|
Template.nonTargetMeasurementDialog.dialog = dialog;
|
||||||
|
|
||||||
// Show the backdrop
|
// Show the backdrop
|
||||||
UI.render(Template.removableBackdrop, document.body);
|
UI.render(Template.removableBackdrop, document.body);
|
||||||
@ -176,8 +176,8 @@ changeNonTargetLocationCallback = function(measurementData, eventData, doneCallb
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Find the select option box
|
// Find the select option box
|
||||||
var selectorLocation = dialog.find('select#selectNonTargetLesionLocation');
|
var selectorLocation = dialog.find('select#selectNonTargetMeasurementLocation');
|
||||||
var selectorResponse = dialog.find('select#selectNonTargetLesionLocationResponse');
|
var selectorResponse = dialog.find('select#selectNonTargetMeasurementLocationResponse');
|
||||||
|
|
||||||
selectorLocation.find('option:first').prop('selected', 'selected');
|
selectorLocation.find('option:first').prop('selected', 'selected');
|
||||||
selectorResponse.find('option:first').prop('selected', 'selected');
|
selectorResponse.find('option:first').prop('selected', 'selected');
|
||||||
@ -185,7 +185,7 @@ changeNonTargetLocationCallback = function(measurementData, eventData, doneCallb
|
|||||||
// Allow location selection
|
// Allow location selection
|
||||||
selectorLocation.removeAttr('disabled');
|
selectorLocation.removeAttr('disabled');
|
||||||
|
|
||||||
// Show the nonTargetLesion dialog above
|
// Show the nonTargetMeasurement dialog above
|
||||||
var dialogProperty = {
|
var dialogProperty = {
|
||||||
display: 'block'
|
display: 'block'
|
||||||
};
|
};
|
||||||
@ -212,7 +212,7 @@ changeNonTargetLocationCallback = function(measurementData, eventData, doneCallb
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LesionLocations.update({}, {
|
MeasurementLocations.update({}, {
|
||||||
$set: {
|
$set: {
|
||||||
selected: false
|
selected: false
|
||||||
}
|
}
|
||||||
@ -220,7 +220,7 @@ changeNonTargetLocationCallback = function(measurementData, eventData, doneCallb
|
|||||||
multi: true
|
multi: true
|
||||||
});
|
});
|
||||||
|
|
||||||
var currentLocation = LesionLocations.findOne({
|
var currentLocation = MeasurementLocations.findOne({
|
||||||
id: measurement.locationId
|
id: measurement.locationId
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -228,7 +228,7 @@ changeNonTargetLocationCallback = function(measurementData, eventData, doneCallb
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LesionLocations.update(currentLocation._id, {
|
MeasurementLocations.update(currentLocation._id, {
|
||||||
$set: {
|
$set: {
|
||||||
selected: true
|
selected: true
|
||||||
}
|
}
|
||||||
@ -238,32 +238,32 @@ changeNonTargetLocationCallback = function(measurementData, eventData, doneCallb
|
|||||||
selectNonTargetResponse(response);
|
selectNonTargetResponse(response);
|
||||||
};
|
};
|
||||||
|
|
||||||
Template.nonTargetLesionDialog.onCreated(() => {
|
Template.nonTargetMeasurementDialog.onCreated(() => {
|
||||||
const instance = Template.instance();
|
const instance = Template.instance();
|
||||||
const measurementTypeId = 'nonTargets';
|
const measurementTypeId = 'nonTargets';
|
||||||
const measurementApi = instance.data.measurementApi;
|
const measurementApi = instance.data.measurementApi;
|
||||||
const timepointApi = instance.data.timepointApi;
|
const timepointApi = instance.data.timepointApi;
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
setLesionNumberCallback: getSetLesionNumberCallbackFunction(measurementTypeId, measurementApi, timepointApi),
|
setMeasurementNumberCallback: getSetMeasurementNumberCallbackFunction(measurementTypeId, measurementApi, timepointApi),
|
||||||
getLesionLocationCallback: getLesionLocationCallback,
|
getMeasurementLocationCallback: getMeasurementLocationCallback,
|
||||||
changeLesionLocationCallback: changeLesionLocationCallback
|
changeMeasurementLocationCallback: changeMeasurementLocationCallback
|
||||||
};
|
};
|
||||||
|
|
||||||
cornerstoneTools.nonTarget.setConfiguration(config);
|
//cornerstoneTools.nonTarget.setConfiguration(config);
|
||||||
});
|
});
|
||||||
|
|
||||||
Template.nonTargetLesionDialog.events({
|
Template.nonTargetMeasurementDialog.events({
|
||||||
'change #selectNonTargetLesionLocationResponse': function(e) {
|
'change #selectNonTargetMeasurementLocationResponse': function(e) {
|
||||||
var responseCode = $(e.currentTarget).val();
|
var responseCode = $(e.currentTarget).val();
|
||||||
selectNonTargetResponse(responseCode);
|
selectNonTargetResponse(responseCode);
|
||||||
},
|
},
|
||||||
'click #nonTargetLesionOK': function() {
|
'click #nonTargetMeasurementOK': function() {
|
||||||
var dialog = Template.nonTargetLesionDialog.dialog;
|
var dialog = Template.nonTargetMeasurementDialog.dialog;
|
||||||
var measurementData = Template.nonTargetLesionDialog.measurementData;
|
var measurementData = Template.nonTargetMeasurementDialog.measurementData;
|
||||||
|
|
||||||
// Find the select option box
|
// Find the select option box
|
||||||
var selectorLocation = dialog.find('select#selectNonTargetLesionLocation');
|
var selectorLocation = dialog.find('select#selectNonTargetMeasurementLocation');
|
||||||
|
|
||||||
// Get the current value of the selector
|
// Get the current value of the selector
|
||||||
var selectedOptionId = selectorLocation.find('option:selected').val();
|
var selectedOptionId = selectorLocation.find('option:selected').val();
|
||||||
@ -275,7 +275,7 @@ Template.nonTargetLesionDialog.events({
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get selected location data
|
// Get selected location data
|
||||||
var locationObj = LesionLocations.findOne({
|
var locationObj = MeasurementLocations.findOne({
|
||||||
_id: selectedOptionId
|
_id: selectedOptionId
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -292,7 +292,7 @@ Template.nonTargetLesionDialog.events({
|
|||||||
measurementData.id = 'notready';
|
measurementData.id = 'notready';
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Set the isTarget value to true, since this is the target-lesion dialog callback
|
/// Set the isTarget value to true, since this is the target-measurement dialog callback
|
||||||
measurementData.isTarget = false;
|
measurementData.isTarget = false;
|
||||||
|
|
||||||
// Response is set from location response list
|
// Response is set from location response list
|
||||||
@ -300,16 +300,16 @@ Template.nonTargetLesionDialog.events({
|
|||||||
selected: true
|
selected: true
|
||||||
}).code;
|
}).code;
|
||||||
|
|
||||||
// Adds lesion data to timepoints array
|
// Adds measurement data to timepoints array
|
||||||
LesionManager.updateLesionData(measurementData);
|
MeasurementManager.updateMeasurementData(measurementData);
|
||||||
|
|
||||||
// Close the dialog
|
// Close the dialog
|
||||||
closeHandler(dialog);
|
closeHandler(dialog);
|
||||||
},
|
},
|
||||||
'click #removeLesion': function() {
|
'click #removeMeasurement': function() {
|
||||||
var measurementData = Template.nonTargetLesionDialog.measurementData;
|
var measurementData = Template.nonTargetMeasurementDialog.measurementData;
|
||||||
var doneCallback = Template.nonTargetLesionDialog.doneCallback;
|
var doneCallback = Template.nonTargetMeasurementDialog.doneCallback;
|
||||||
var dialog = Template.nonTargetLesionDialog.dialog;
|
var dialog = Template.nonTargetMeasurementDialog.dialog;
|
||||||
|
|
||||||
showConfirmDialog(function() {
|
showConfirmDialog(function() {
|
||||||
if (doneCallback && typeof doneCallback === 'function') {
|
if (doneCallback && typeof doneCallback === 'function') {
|
||||||
@ -320,13 +320,13 @@ Template.nonTargetLesionDialog.events({
|
|||||||
|
|
||||||
closeHandler(dialog);
|
closeHandler(dialog);
|
||||||
},
|
},
|
||||||
'click #btnCloseLesionPopup': function() {
|
'click #btnCloseMeasurementPopup': function() {
|
||||||
var dialog = Template.nonTargetLesionDialog.dialog;
|
var dialog = Template.nonTargetMeasurementDialog.dialog;
|
||||||
closeHandler(dialog);
|
closeHandler(dialog);
|
||||||
},
|
},
|
||||||
'click a.convertNonTarget': function(evt) {
|
'click a.convertNonTarget': function(evt) {
|
||||||
var measurementData = Template.nonTargetLesionDialog.measurementData;
|
var measurementData = Template.nonTargetMeasurementDialog.measurementData;
|
||||||
var dialog = Template.nonTargetLesionDialog.dialog;
|
var dialog = Template.nonTargetMeasurementDialog.dialog;
|
||||||
|
|
||||||
var button = $(evt.currentTarget);
|
var button = $(evt.currentTarget);
|
||||||
var toolType = button.data('type');
|
var toolType = button.data('type');
|
||||||
@ -335,8 +335,8 @@ Template.nonTargetLesionDialog.events({
|
|||||||
|
|
||||||
closeHandler(dialog);
|
closeHandler(dialog);
|
||||||
},
|
},
|
||||||
'keydown #lesionLocationDialog, keydown #lesionLocationRelabelDialog': function(e) {
|
'keydown #measurementLocationDialog, keydown #measurementLocationRelabelDialog': function(e) {
|
||||||
var dialog = Template.nonTargetLesionDialog.dialog;
|
var dialog = Template.nonTargetMeasurementDialog.dialog;
|
||||||
|
|
||||||
// If Esc or Enter are pressed, close the dialog
|
// If Esc or Enter are pressed, close the dialog
|
||||||
if (e.which === keys.ESC || e.which === keys.ENTER) {
|
if (e.which === keys.ESC || e.which === keys.ENTER) {
|
||||||
@ -360,9 +360,9 @@ var conversionOptions = [{
|
|||||||
name: 'Excluded (EX)'
|
name: 'Excluded (EX)'
|
||||||
}];
|
}];
|
||||||
|
|
||||||
Template.nonTargetLesionDialog.helpers({
|
Template.nonTargetMeasurementDialog.helpers({
|
||||||
lesionLocations: function() {
|
measurementLocations: function() {
|
||||||
return LesionLocations.find();
|
return MeasurementLocations.find();
|
||||||
},
|
},
|
||||||
locationResponses: function() {
|
locationResponses: function() {
|
||||||
return LocationResponses.find();
|
return LocationResponses.find();
|
||||||
@ -37,9 +37,9 @@ Meteor.methods({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
retrieveTimepoints(filter = {}) {
|
retrieveTimepoints(filter) {
|
||||||
OHIF.log.info('Retrieving Timepoints from the Server');
|
OHIF.log.info('Retrieving Timepoints from the Server');
|
||||||
return Timepoints.find(filter).fetch();
|
return Timepoints.find(filter || {}).fetch();
|
||||||
},
|
},
|
||||||
|
|
||||||
storeMeasurements(measurementData) {
|
storeMeasurements(measurementData) {
|
||||||
@ -66,7 +66,7 @@ Meteor.methods({
|
|||||||
|
|
||||||
|
|
||||||
measurementTools.forEach(tool => {
|
measurementTools.forEach(tool => {
|
||||||
measurementData[tool.id] = MeasurementCollections[tool.id].find(filter).fetch();
|
measurementData[tool.id] = MeasurementCollections[tool.id].find(filter || {}).fetch();
|
||||||
});
|
});
|
||||||
|
|
||||||
return measurementData;
|
return measurementData;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<template name="measurementTableRow">
|
<template name="measurementTableRow">
|
||||||
<div class="measurementTableRow {{#unless rowItem.location}}warning{{/unless}}{{#if responseStatus}}response-status{{/if}}" data-measurementid="{{_id}}">
|
<div class="measurementTableRow {{#unless rowItem.location}}warning{{/unless}}{{#if responseStatus}}response-status{{/if}}" data-measurementid="{{_id}}">
|
||||||
<div class='lesionRowSidebar'>
|
<div class='measurementRowSidebar'>
|
||||||
<div class="lesionNumber">
|
<div class="measurementNumber">
|
||||||
{{rowItem.measurementNumber}}
|
{{rowItem.measurementNumber}}
|
||||||
</div>
|
</div>
|
||||||
{{#unless rowItem.location}}
|
{{#unless rowItem.location}}
|
||||||
@ -17,7 +17,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
<div class="lesionDetails">
|
<div class="measurementDetails">
|
||||||
<div class='location'>
|
<div class='location'>
|
||||||
{{#if rowItem.location}}
|
{{#if rowItem.location}}
|
||||||
{{rowItem.location}}
|
{{rowItem.location}}
|
||||||
|
|||||||
@ -20,7 +20,7 @@ var keys = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Template.measurementTableRow.events({
|
Template.measurementTableRow.events({
|
||||||
'click .lesionRowSidebar'(event, instance) {
|
'click .measurementRowSidebar'(event, instance) {
|
||||||
const $row = instance.$('.measurementTableRow');
|
const $row = instance.$('.measurementTableRow');
|
||||||
$row.closest('.measurementTableView').find('.measurementTableRow').not($row).removeClass('active');
|
$row.closest('.measurementTableView').find('.measurementTableRow').not($row).removeClass('active');
|
||||||
$row.toggleClass('active');
|
$row.toggleClass('active');
|
||||||
|
|||||||
@ -29,14 +29,14 @@
|
|||||||
&:before
|
&:before
|
||||||
opacity: 1
|
opacity: 1
|
||||||
|
|
||||||
.lesionRowSidebar
|
.measurementRowSidebar
|
||||||
theme('color', '$activeColor')
|
theme('color', '$activeColor')
|
||||||
|
|
||||||
.rowOptions
|
.rowOptions
|
||||||
height: 35px
|
height: 35px
|
||||||
visibility: visible
|
visibility: visible
|
||||||
|
|
||||||
&.response-status .lesionRowSidebar .response-status-icon
|
&.response-status .measurementRowSidebar .response-status-icon
|
||||||
theme('background-color', '$defaultColor')
|
theme('background-color', '$defaultColor')
|
||||||
theme('color', '$uiGray')
|
theme('color', '$uiGray')
|
||||||
border-radius: 11px
|
border-radius: 11px
|
||||||
@ -48,7 +48,7 @@
|
|||||||
text-align: center
|
text-align: center
|
||||||
width: 21px
|
width: 21px
|
||||||
|
|
||||||
&.warning .lesionRowSidebar
|
&.warning .measurementRowSidebar
|
||||||
theme('background-color', '$uiYellow')
|
theme('background-color', '$uiYellow')
|
||||||
theme('color', '$textPrimaryColor')
|
theme('color', '$textPrimaryColor')
|
||||||
|
|
||||||
@ -95,7 +95,7 @@
|
|||||||
width: 11px
|
width: 11px
|
||||||
height: 11px
|
height: 11px
|
||||||
|
|
||||||
.lesionRowSidebar
|
.measurementRowSidebar
|
||||||
theme('background', '$uiGray')
|
theme('background', '$uiGray')
|
||||||
theme('color', '$textSecondaryColor')
|
theme('color', '$textSecondaryColor')
|
||||||
cursor: pointer
|
cursor: pointer
|
||||||
@ -103,14 +103,14 @@
|
|||||||
max-width: 30px
|
max-width: 30px
|
||||||
transition(all 0.3s ease)
|
transition(all 0.3s ease)
|
||||||
|
|
||||||
.lesionNumber
|
.measurementNumber
|
||||||
font-size: 14px
|
font-size: 14px
|
||||||
font-weight: 400
|
font-weight: 400
|
||||||
margin-right: 5px
|
margin-right: 5px
|
||||||
padding-top: 10px
|
padding-top: 10px
|
||||||
text-align: center
|
text-align: center
|
||||||
|
|
||||||
.lesionDetails
|
.measurementDetails
|
||||||
flex: 1
|
flex: 1
|
||||||
padding: 5px 2px 0 0
|
padding: 5px 2px 0 0
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
import { $ } from 'meteor/jquery';
|
import { $ } from 'meteor/jquery';
|
||||||
|
|
||||||
import { OHIF } from 'meteor/ohif:core';
|
import { OHIF } from 'meteor/ohif:core';
|
||||||
|
|
||||||
OHIF.measurements.syncMeasurementAndToolData = measurement => {
|
OHIF.measurements.syncMeasurementAndToolData = measurement => {
|
||||||
|
|||||||
@ -14,7 +14,7 @@ switchToTab = function(contentId) {
|
|||||||
OHIF.log.info('Switching to tab: ' + contentId);
|
OHIF.log.info('Switching to tab: ' + contentId);
|
||||||
|
|
||||||
// Clear the cornerstone tool data to sync the measurements with the measurements API
|
// Clear the cornerstone tool data to sync the measurements with the measurements API
|
||||||
cornerstoneTools.globalImageIdSpecificToolStateManager.restoreToolState({});
|
cornerstoneTools.globalImageIdSpecificToolStateManager = cornerstoneTools.newImageIdSpecificToolStateManager();
|
||||||
|
|
||||||
$('.tab-content .tab-pane').removeClass('active');
|
$('.tab-content .tab-pane').removeClass('active');
|
||||||
if (contentId !== 'studylistTab') {
|
if (contentId !== 'studylistTab') {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user