Bug fixing: Linking on last row in lesion table is broken

This commit is contained in:
Evren Ozkan committed 2015-11-25 07:48:29 -05:00
1 parent 8a844dd2fe
commit e6f1f34d1c
2 files changed
+20 -13

No files matched your search

@@ -70,27 +70,28 @@ Template.viewerMain.helpers({
Template.viewerMain.events({
'click button#clearTools': function(e, template) {
var contentId = template.data.contentId;
var patientId = template.data.studies[0].patientId;
var toolTypes = ["lesion", "nonTarget"];
var toolState = cornerstoneTools.globalImageIdSpecificToolStateManager.toolState;
var toolStateKeys = Object.keys(toolState).slice(0);
// Set null array for toolState data found by imageId and toolType
toolStateKeys.forEach(function (imageId) {
toolTypes.forEach(function (toolType) {
if(toolState[imageId][toolType]) {
if(toolState[imageId][toolType].data[0].patientId === patientId) {
var toolTypeData = toolState[imageId][toolType];
if(toolTypeData && toolTypeData.data.length > 0) {
if(toolTypeData.data[0].patientId === patientId) {
toolState[imageId][toolType] = {
data: []
}
};
}
}
});
});
// Update imageViewerViewport elements
$("#"+contentId+" .imageViewerViewport").each(function(viewportIndex, element) {
$(".imageViewerViewport").each(function(viewportIndex, element) {
cornerstone.updateImage(element);
});