Clear tools button is added. Removes all target and nonTarget lesions data on image and deletes from Measurements collection
This commit is contained in:
parent
dbd7453980
commit
ca30e22464
@ -53,6 +53,13 @@ Template.viewerMain.helpers({
|
|||||||
iconClasses: 'fa fa-long-arrow-up'
|
iconClasses: 'fa fa-long-arrow-up'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
buttonData.push({
|
||||||
|
id: 'clearTools',
|
||||||
|
title: 'Clear tools',
|
||||||
|
classes: 'imageViewerCommand',
|
||||||
|
iconClasses: 'fa fa-trash'
|
||||||
|
});
|
||||||
|
|
||||||
toolbarOptions.buttonData = buttonData;
|
toolbarOptions.buttonData = buttonData;
|
||||||
toolbarOptions.includePlayClipButton = false;
|
toolbarOptions.includePlayClipButton = false;
|
||||||
toolbarOptions.includeLayoutButton = false;
|
toolbarOptions.includeLayoutButton = false;
|
||||||
@ -60,3 +67,30 @@ Template.viewerMain.helpers({
|
|||||||
return toolbarOptions;
|
return toolbarOptions;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Template.viewerMain.events({
|
||||||
|
'click button#clearTools': function(e, template) {
|
||||||
|
var toolTypes = ["lesion", "nonTarget"];
|
||||||
|
var toolState = cornerstoneTools.globalImageIdSpecificToolStateManager.toolState;
|
||||||
|
var toolStateKeys = Object.keys(toolState).slice(0);
|
||||||
|
toolStateKeys.forEach(function (imageId) {
|
||||||
|
toolTypes.forEach(function (toolType) {
|
||||||
|
toolState[imageId][toolType] = {
|
||||||
|
data: []
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// Update imageViewerViewport elements
|
||||||
|
$(".imageViewerViewport").each(function(viewportIndex, element) {
|
||||||
|
cornerstone.updateImage(element);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Remove patient's measurements
|
||||||
|
var patientId = template.data.studies[0].patientId;
|
||||||
|
Meteor.call('removeMeasurementsByPatientId', patientId);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
8
Packages/lesiontracker/both/removeCollections.js
Normal file
8
Packages/lesiontracker/both/removeCollections.js
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
Meteor.methods({
|
||||||
|
"removeMeasurementsByPatientId": function(patientId) {
|
||||||
|
Measurements.remove(
|
||||||
|
{patientId: patientId},
|
||||||
|
{multi: true}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
@ -51,6 +51,8 @@ Package.onUse(function (api) {
|
|||||||
|
|
||||||
// Both client and server functions
|
// Both client and server functions
|
||||||
api.addFiles('both/collections.js', ['client', 'server']);
|
api.addFiles('both/collections.js', ['client', 'server']);
|
||||||
|
api.addFiles('both/removeCollections.js', ['client', 'server']);
|
||||||
|
|
||||||
|
|
||||||
// Library functions
|
// Library functions
|
||||||
api.addFiles('lib/uuid.js', 'client');
|
api.addFiles('lib/uuid.js', 'client');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user