Work on refactoring measurements out of Lesion Tracker package

- Removed AssociatedStudies Collection
- Measurement API is generated from configuration files
- Data exchange methods are defined in configuration
This commit is contained in:
Erik Ziegler committed 2016-11-15 08:21:46 +01:00
1 parent c511edd419
commit ab4d4c9008
537 files changed
+5122 -3545

No files matched your search

@@ -0,0 +1,45 @@
Template.studySeriesQuickSwitch.onCreated(() => {
const instance = Template.instance();
// Defines the study being shown in the current viewport
instance.data.currentStudy = new ReactiveVar();
// Gets the viewport data for the given viewport index
instance.getViewportData = viewportIndex => {
const layoutManager = window.layoutManager;
return layoutManager && layoutManager.viewportData && layoutManager.viewportData[viewportIndex];
};
// Gets the current viewport data
const viewportIndex = instance.data.viewportIndex;
const viewportData = instance.getViewportData(viewportIndex);
if (!viewportData) {
return;
}
// Finds the current study and return it
const study = ViewerStudies.findOne({
studyInstanceUid: viewportData.studyInstanceUid
});
// Change the current study to update the thumbnails
instance.data.currentStudy.set(study);
});
Template.studySeriesQuickSwitch.events({
'mouseenter .js-quick-switch, mouseenter .js-quick-switch .switchSectionSeries'(event, instance) {
instance.$('.quickSwitchWrapper').addClass('overlay');
$(event.currentTarget).addClass('hover');
},
'mouseleave .js-quick-switch'(event, instance) {
instance.$('.js-quick-switch, .switchSectionSeries').removeClass('hover');
instance.$('.quickSwitchWrapper').removeClass('overlay');
}
});
Template.studySeriesQuickSwitch.helpers({
// Get the current study
currentStudy() {
return Template.instance().data.currentStudy.get();
}
});