LT-115: Disable/Enable CRUNEX button for active image viewer

This commit is contained in:
Aysel Afsar committed 2016-03-07 09:05:59 -05:00
1 parent 4c02a1ea3f
commit 58d145194a
4 files changed
+24 -3

No files matched your search

@@ -32,4 +32,16 @@ pixelSpacingAutorunCheck = function() {
// Enable Lesion Buttons
oncologyTools.prop('disabled', false);
}
// Set disabled/enabled timepoint buttons
var imageId = enabledElement.image.imageId;
var study = cornerstoneTools.metaData.get('study', imageId);
// Find the relevant timepoint given the current study
var timepoint = Timepoints.findOne({
studyInstanceUids: {
$in: [study.studyInstanceUid]
}
});
setTimepointTools(timepoint);
};
@@ -3,14 +3,19 @@ setTimepointTools = function(timepoint) {
// Enabled tools for only follow-up tools
var fuTools = ["button#crunexTools"];
var fuToolsJQ = $("button#crunexTools");
var isDisabled = false;
if ((timepoint.timepointType).toLowerCase() === "baseline") {
// Set active tool as lesion tool
toolManager.setActiveTool('bidirectional');
toolManager.addDisabledTool({tools: fuTools, status: true});
isDisabled = true;
} else {
toolManager.setActiveTool(toolManager.getDefaultTool());
toolManager.addDisabledTool({tools: fuTools, status: false});
isDisabled = false;
}
toolManager.addDisabledTool({tools: fuTools, status: isDisabled});
fuToolsJQ.prop('disabled', isDisabled);
};
timepointAutoCheck = function(templateData) {