LT-275: Storing the selected label and description on measurements collection
This commit is contained in:
1 parent
20a2a8e453
commit
cd5a1277aa
10 files changed
+157
-84
No files matched your search
@@ -1,3 +1,5 @@
|
||||
import { Template } from 'meteor/templating';
|
||||
import { Session } from 'meteor/session';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
Session.set('TimepointsReady', false);
|
||||
@@ -102,5 +104,36 @@ Template.viewer.events({
|
||||
},
|
||||
'CornerstoneToolsMeasurementRemoved .imageViewerViewport'(event, instance, eventData) {
|
||||
OHIF.measurements.MeasurementHandlers.onRemoved(event, instance, eventData);
|
||||
},
|
||||
CornerstoneToolsMouseClick(event, instance, data) {
|
||||
const element = instance.$('.imageViewerViewport')[0];
|
||||
|
||||
const toolState = cornerstoneTools.getToolState(element, 'bidirectional');
|
||||
|
||||
// Stop here if no tool state was found
|
||||
if (!toolState) {
|
||||
return;
|
||||
}
|
||||
|
||||
const selectLabelCallback = (options, value, description) => {
|
||||
console.warn('>>>>options, value, description', options, value, description);
|
||||
};
|
||||
|
||||
setTimeout(() => {
|
||||
for (let i = 0; i < toolState.data.length; i++) {
|
||||
const toolData = toolState.data[i];
|
||||
if (toolData.active) {
|
||||
OHIF.measurements.toggleLabelButton({
|
||||
instance,
|
||||
toolData,
|
||||
element,
|
||||
measurementApi: instance.data.measurementApi,
|
||||
position: data.currentPoints.page,
|
||||
callback: selectLabelCallback
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user