LT-251: Fixing quick switch issue when trying to get UID of study
This commit is contained in:
parent
51cb360b68
commit
37d67f491d
@ -1,10 +1,33 @@
|
|||||||
Template.studySeriesQuickSwitch.onCreated(function studySeriesQuickSwitchOnCreated() {
|
Template.studySeriesQuickSwitch.onCreated(() => {
|
||||||
const instance = this;
|
const instance = Template.instance();
|
||||||
|
|
||||||
var viewportIndex = instance.data.viewportIndex;
|
|
||||||
|
|
||||||
instance.data.timepointViewType = new ReactiveVar();
|
instance.data.timepointViewType = new ReactiveVar();
|
||||||
instance.data.timepointViewType.set('key');
|
instance.data.timepointViewType.set('key');
|
||||||
|
|
||||||
|
instance.getViewportData = viewportIndex => {
|
||||||
|
return layoutManager && layoutManager.viewportData && layoutManager.viewportData[viewportIndex];
|
||||||
|
};
|
||||||
|
|
||||||
|
instance.getCurrentStudy = () => {
|
||||||
|
const viewportIndex = instance.data.viewportIndex;
|
||||||
|
Session.get('CornerstoneNewImage' + viewportIndex);
|
||||||
|
|
||||||
|
layoutManager = window.layoutManager;
|
||||||
|
if (!layoutManager) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const viewportData = instance.getViewportData(viewportIndex);
|
||||||
|
if (!viewportData) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const study = ViewerStudies.findOne({
|
||||||
|
studyInstanceUid: viewportData.studyInstanceUid
|
||||||
|
});
|
||||||
|
|
||||||
|
return study;
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
Template.studySeriesQuickSwitch.helpers({
|
Template.studySeriesQuickSwitch.helpers({
|
||||||
@ -13,47 +36,26 @@ Template.studySeriesQuickSwitch.helpers({
|
|||||||
},
|
},
|
||||||
|
|
||||||
currentStudy() {
|
currentStudy() {
|
||||||
var viewportIndex = Template.instance().data.viewportIndex;
|
return Template.instance().getCurrentStudy;
|
||||||
Session.get('CornerstoneNewImage' + viewportIndex);
|
|
||||||
|
|
||||||
layoutManager = window.layoutManager;
|
|
||||||
if (!layoutManager) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var studyInstanceUid = layoutManager.viewportData[viewportIndex].studyInstanceUid;
|
|
||||||
var study = ViewerStudies.findOne({
|
|
||||||
studyInstanceUid: studyInstanceUid
|
|
||||||
});
|
|
||||||
|
|
||||||
return study;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
currentTimepoint() {
|
currentTimepoint() {
|
||||||
var viewportIndex = Template.instance().data.viewportIndex;
|
const instance = Template.instance();
|
||||||
Session.get('CornerstoneNewImage' + viewportIndex);
|
|
||||||
|
|
||||||
layoutManager = window.layoutManager;
|
const study = instance.getCurrentStudy();
|
||||||
if (!layoutManager) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var studyInstanceUid = layoutManager.viewportData[viewportIndex].studyInstanceUid;
|
const timepoint = Timepoint.findOne({
|
||||||
var study = ViewerStudies.findOne({
|
|
||||||
studyInstanceUid: studyInstanceUid
|
|
||||||
});
|
|
||||||
|
|
||||||
var timepoint = Timepoint.findOne({
|
|
||||||
timepointId: study.timepointId
|
timepointId: study.timepointId
|
||||||
});
|
});
|
||||||
|
console.warn('>>>>TIMEPOINT', timepoint);
|
||||||
|
|
||||||
return timepoint;
|
return timepoint;
|
||||||
},
|
},
|
||||||
|
|
||||||
thumbnails: function(study) {
|
thumbnails: function(study) {
|
||||||
var stacks = createStacks(study);
|
const stacks = createStacks(study);
|
||||||
|
|
||||||
var array = [];
|
const array = [];
|
||||||
stacks.forEach(function(stack, index) {
|
stacks.forEach(function(stack, index) {
|
||||||
array.push({
|
array.push({
|
||||||
thumbnailIndex: index,
|
thumbnailIndex: index,
|
||||||
|
|||||||
@ -20,7 +20,7 @@ Template.registerHelper('isSeriesActive', (seriesInstanceUid, viewportIndex) =>
|
|||||||
|
|
||||||
let result = false;
|
let result = false;
|
||||||
_.each(viewportData, data => {
|
_.each(viewportData, data => {
|
||||||
if (data.seriesInstanceUid === seriesInstanceUid) {
|
if (data && data.seriesInstanceUid === seriesInstanceUid) {
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user