OHIF-50: Study series issue (study metadata and rendering sync)
This commit is contained in:
parent
48ed3c3fd9
commit
e743d6bc79
@ -18,6 +18,10 @@ Template.studyTimepointStudy.onCreated(() => {
|
|||||||
return isGlobal ? $(selector) : instance.$browser.find(selector);
|
return isGlobal ? $(selector) : instance.$browser.find(selector);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
instance.isQuickSwitch = () => {
|
||||||
|
return !_.isUndefined(instance.data.viewportIndex);
|
||||||
|
};
|
||||||
|
|
||||||
// Set the current study as selected in the studies list
|
// Set the current study as selected in the studies list
|
||||||
instance.select = (isQuickSwitch=false) => {
|
instance.select = (isQuickSwitch=false) => {
|
||||||
const studyInstanceUid = instance.data.study.studyInstanceUid;
|
const studyInstanceUid = instance.data.study.studyInstanceUid;
|
||||||
@ -36,7 +40,7 @@ Template.studyTimepointStudy.onCreated(() => {
|
|||||||
|
|
||||||
instance.initializeStudyWrapper = () => {
|
instance.initializeStudyWrapper = () => {
|
||||||
// Stop here if it's a quick switch
|
// Stop here if it's a quick switch
|
||||||
if (instance.data.viewportIndex) {
|
if (instance.isQuickSwitch()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,8 +99,7 @@ Template.studyTimepointStudy.events({
|
|||||||
'click .studyModality'(event, instance) {
|
'click .studyModality'(event, instance) {
|
||||||
const studyData = instance.data.study;
|
const studyData = instance.data.study;
|
||||||
const { studyInstanceUid, _id } = studyData;
|
const { studyInstanceUid, _id } = studyData;
|
||||||
|
const isQuickSwitch = instance.isQuickSwitch();
|
||||||
const isQuickSwitch = !_.isUndefined(instance.data.viewportIndex);
|
|
||||||
|
|
||||||
// @TypeSafeStudies
|
// @TypeSafeStudies
|
||||||
// Check if the study already has series data,
|
// Check if the study already has series data,
|
||||||
@ -108,12 +111,15 @@ Template.studyTimepointStudy.events({
|
|||||||
const $studies = instance.getStudyElement(true);
|
const $studies = instance.getStudyElement(true);
|
||||||
$studies.trigger('loadStarted');
|
$studies.trigger('loadStarted');
|
||||||
getStudyMetadata(studyInstanceUid, study => {
|
getStudyMetadata(studyInstanceUid, study => {
|
||||||
study.displaySets = sortingManager.getDisplaySets(study);
|
const studyMetadata = new OHIF.metadata.StudyMetadata(study);
|
||||||
|
study.displaySets = sortingManager.getDisplaySets(studyMetadata);
|
||||||
instance.data.study = study;
|
instance.data.study = study;
|
||||||
OHIF.viewer.Studies.insert(study);
|
OHIF.viewer.Studies.insert(study);
|
||||||
// make sure studies are rendered in the DOM
|
|
||||||
$studies.trigger('loadEnded');
|
Meteor.setTimeout(() => {
|
||||||
instance.select(isQuickSwitch);
|
$studies.trigger('loadEnded');
|
||||||
|
instance.select(isQuickSwitch);
|
||||||
|
}, 1);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
studyData.seriesList = alreadyLoaded.seriesList;
|
studyData.seriesList = alreadyLoaded.seriesList;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user