NonTarget tool touch events

This commit is contained in:
Evren Ozkan 2015-11-13 14:44:17 -05:00
parent 7f6a35f45d
commit b28edb9704
4 changed files with 30 additions and 26 deletions

View File

@ -72,7 +72,7 @@
cornerstoneTools.removeToolState(mouseEventData.element, toolType, measurementData);
}
config.getNonTargetLesionLocationCallback(measurementData, mouseEventData, doneCallback);
config.getNonTargetLesionLocationCallback(measurementData, mouseEventData, doneCallback);
$(mouseEventData.element).on('CornerstoneToolsMouseMove', eventData, cornerstoneTools.nonTarget.mouseMoveCallback);
$(mouseEventData.element).on('CornerstoneToolsMouseDown', eventData, cornerstoneTools.nonTarget.mouseDownCallback);
@ -283,14 +283,10 @@
function addNewMeasurementTouch(touchEventData) {
var element = touchEventData.element;
function doneChangingTextCallback(text) {
if (text !== null) {
measurementData.text = text;
} else {
cornerstoneTools.removeToolState(element, toolType, measurementData);
}
measurementData.active = false;
function doneCallback(lesionNumber) {
measurementData.lesionName = "Non-Target "+lesionNumber;
measurementData.lesionNumber = lesionNumber;
measurementData.active = true;
cornerstone.updateImage(element);
}
@ -299,6 +295,12 @@
$(element).off('CornerstoneToolsTouchDrag', cornerstoneTools.nonTargetTouch.touchMoveCallback);
$(element).off('CornerstoneToolsDragStartActive', cornerstoneTools.nonTargetTouch.touchDownActivateCallback);
$(element).off('CornerstoneToolsTap', cornerstoneTools.nonTargetTouch.tapCallback);
var config = cornerstoneTools.nonTarget.getConfiguration();
// Set lesion number and lesion name
if (measurementData.lesionName === undefined) {
config.setLesionNumberCallback(measurementData, touchEventData, doneCallback);
}
cornerstone.updateImage(element);
cornerstoneTools.moveNewHandleTouch(touchEventData, measurementData.handles.end, function() {
@ -309,10 +311,8 @@
cornerstoneTools.removeToolState(element, toolType, measurementData);
}
var config = cornerstoneTools.nonTarget.getConfiguration();
if (measurementData.text === undefined) {
config.getTextCallback(doneChangingTextCallback);
}
config.getNonTargetLesionLocationCallback(measurementData, touchEventData, doneCallback);
$(element).on('CornerstoneToolsTouchDrag', cornerstoneTools.nonTargetTouch.touchMoveCallback);
$(element).on('CornerstoneToolsDragStartActive', cornerstoneTools.nonTargetTouch.touchDownActivateCallback);
@ -471,8 +471,8 @@
createNewMeasurement: createNewMeasurement,
onImageRendered: onImageRendered,
pointNearTool: pointNearTool,
toolType: toolType,
mouseDoubleClickCallback: doubleClickCallback
toolType: toolType
//mouseDoubleClickCallback: doubleClickCallback
});
cornerstoneTools.nonTarget.setConfiguration(configuration);
@ -482,8 +482,8 @@
createNewMeasurement: createNewMeasurement,
onImageRendered: onImageRendered,
pointNearTool: pointNearTool,
toolType: toolType,
pressCallback: doubleClickCallback
toolType: toolType
// pressCallback: doubleClickCallback
});

View File

@ -5,8 +5,6 @@
background: white;
padding: 10px 20px 10px 20px;
border-radius: 10px;
}
#selectNonTargetLesionLocation, #selectNonTargetLesionLocationResponse {
@ -26,3 +24,9 @@
.locationOK {
text-align: center;
}
.btn{
background-color: #bbb;
border: 1px solid #888;
color: #000000;
}

View File

@ -28,7 +28,7 @@
<select id="selectNonTargetLesionLocationResponse">
<option value="-1"></option>
{{ #each locationResponses}}
<option value='{{code}}'>{{text}}</option>
<option value='{{code}}'>{{code}} - {{text}}</option>
{{ /each}}
</select>
</div>

View File

@ -46,14 +46,14 @@ function getNonTargetLesionLocationCallback(measurementData, eventData, doneCall
var locationName = measurementManagerDAL.getLocationName(locationUID);
selectorLocation.find('option').each(function()
{
if ($(this).text().trim() === locationName.trim()) {
if ($(this).text() === locationName) {
// Select location in locations dropdown list
selectorLocation.find('option').eq($(this).index()).attr("selected", "selected");
selectorLocation.find('option').eq($(this).index()).prop("selected", true);
return;
}
});
selectorLocation.attr("disabled", "disabled");
selectorLocation.prop("disabled", true);
}
// Enable selector location
@ -159,9 +159,9 @@ LocationResponses = new Meteor.Collection(null);
LocationResponses.insert(
{
text: "Complete response",
code: "CR",
description: ""
text: "Complete response",
code: "CR",
description: ""
}
);
LocationResponses.insert(