Adapting studyPrefecther to the new Viewer Data structure

This commit is contained in:
Bruno Alves de Faria 2017-03-17 19:24:25 -03:00
parent 69c8aea993
commit 2ea2107e11

View File

@ -1,9 +1,10 @@
import { OHIF } from 'meteor/ohif:core'; import { Meteor } from 'meteor/meteor';
import { Session } from 'meteor/session'; import { Session } from 'meteor/session';
import { StackManager } from '../StackManager.js';
import { OHIFError } from './OHIFError';
import { $ } from 'meteor/jquery'; import { $ } from 'meteor/jquery';
import { _ } from 'meteor/underscore'; import { _ } from 'meteor/underscore';
import { OHIF } from 'meteor/ohif:core';
import { OHIFError } from './OHIFError';
import { StackManager } from '../StackManager.js';
export class StudyPrefetcher { export class StudyPrefetcher {
@ -84,8 +85,7 @@ export class StudyPrefetcher {
if (this.hasStack(element)) { if (this.hasStack(element)) {
// Check if this is a clip or not // Check if this is a clip or not
const activeViewportIndex = Session.get('activeViewport'); const activeViewportIndex = Session.get('activeViewport');
const contentId = Session.get('activeContentId'); const displaySetInstanceUid = OHIF.viewer.data.loadedSeriesData[activeViewportIndex].displaySetInstanceUid;
const displaySetInstanceUid = ViewerData[contentId].loadedSeriesData[activeViewportIndex].displaySetInstanceUid;
const stack = StackManager.findStack(displaySetInstanceUid); const stack = StackManager.findStack(displaySetInstanceUid);
@ -178,7 +178,7 @@ export class StudyPrefetcher {
getActiveDisplaySet(displaySets, instance) { getActiveDisplaySet(displaySets, instance) {
return _.find(displaySets, displaySet => { return _.find(displaySets, displaySet => {
return _.some(displaySet.images, displaySetImage => { return _.some(displaySet.images, displaySetImage => {
return displaySetImage.sopInstanceUid == instance.sopInstanceUid; return displaySetImage.sopInstanceUid === instance.sopInstanceUid;
}); });
}); });
} }
@ -309,4 +309,4 @@ export class StudyPrefetcher {
this.stopPrefetching(); this.stopPrefetching();
} }
}; }