Switched studies in Session to ViewerStudies and WorklistStudies Collections. Fixes studyDate selector issues
This commit is contained in:
1 parent
aa7982b11b
commit
1511642000
17 files changed
+82
-78
No files matched your search
@@ -1,6 +1,10 @@
|
||||
Template.imageThumbnail.onRendered(function() {
|
||||
var instance = this.data.stack.instances[0];
|
||||
var element = this.find('.imageThumbnail');
|
||||
|
||||
cornerstone.disable(element);
|
||||
$(element).find('canvas').remove();
|
||||
|
||||
cornerstone.enable(element);
|
||||
|
||||
var imageId = getImageId(instance);
|
||||
|
||||
@@ -1,15 +1,5 @@
|
||||
Template.studyBrowser.helpers({
|
||||
studies : function() {
|
||||
var studies = Session.get('studies');
|
||||
console.log(studies);
|
||||
|
||||
var array = [];
|
||||
studies.forEach(function(study, index) {
|
||||
array.push({
|
||||
studyIndex: index,
|
||||
study: study
|
||||
});
|
||||
});
|
||||
return array;
|
||||
}
|
||||
studies : function() {
|
||||
return ViewerStudies.find({selected: true});
|
||||
}
|
||||
});
|
||||
@@ -190,6 +190,7 @@ function thumbnailDragEndHandler(e, target) {
|
||||
}
|
||||
|
||||
Template.thumbnailEntry.onRendered(function() {
|
||||
console.log(this.data);
|
||||
var entry = this.find('.thumbnailEntry');
|
||||
$(entry).data('seriesInstanceUid', Template.parentData(0).seriesInstanceUid);
|
||||
$(entry).data('studyInstanceUid', Template.parentData(1).studyInstanceUid);
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
Template.thumbnails.helpers({
|
||||
thumbnails: function() {
|
||||
var stacks = createStacks(this.study);
|
||||
var studyIndex = this.studyIndex;
|
||||
var study = this;
|
||||
var stacks = createStacks(study);
|
||||
|
||||
var array = [];
|
||||
stacks.forEach(function(stack, index) {
|
||||
array.push({
|
||||
thumbnailIndex: index * (studyIndex + 1),
|
||||
thumbnailIndex: index,
|
||||
stack: stack
|
||||
});
|
||||
});
|
||||
|
||||
@@ -399,30 +399,31 @@ Template.imageViewerViewport.onRendered(function() {
|
||||
return;
|
||||
}
|
||||
|
||||
// Retrieve the current set of studies from the Meteor Session
|
||||
var studies = Session.get('studies');
|
||||
// Look through the ViewerStudies collection for a
|
||||
// study with this studyInstanceUid
|
||||
var study = ViewerStudies.findOne({
|
||||
studyInstanceUid: this.data.studyInstanceUid
|
||||
});
|
||||
|
||||
// Look through every study and their series' until we find the
|
||||
// series that matches the seriesInstanceUid and studyInstanceUid
|
||||
var studyInstanceUid = this.data.studyInstanceUid;
|
||||
// If we didn't find anything, stop here
|
||||
if (!study) {
|
||||
return;
|
||||
}
|
||||
|
||||
data.study = study;
|
||||
|
||||
// Look through this study for a series with this seriesInstanceUid
|
||||
var seriesInstanceUid = this.data.seriesInstanceUid;
|
||||
studies.every(function(study) {
|
||||
if (study.studyInstanceUid === studyInstanceUid) {
|
||||
data.study = study;
|
||||
study.seriesList.every(function(series) {
|
||||
if (series.seriesInstanceUid === seriesInstanceUid) {
|
||||
data.series = series;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
study.seriesList.every(function(series) {
|
||||
if (series.seriesInstanceUid === seriesInstanceUid) {
|
||||
data.series = series;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
// If we didn't find anything, stop here
|
||||
if (!data.study || !data.series) {
|
||||
if (!data.series) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,8 +21,6 @@ Template.imageViewerViewports.helpers({
|
||||
viewportArray: function() {
|
||||
log.info("imageViewerViewports viewportArray");
|
||||
|
||||
var studies = Session.get('studies');
|
||||
|
||||
var viewportRows = this.viewportRows || 1;
|
||||
var viewportColumns = this.viewportColumns || 1;
|
||||
|
||||
@@ -49,7 +47,7 @@ Template.imageViewerViewports.helpers({
|
||||
var inputData = {
|
||||
viewportColumns: viewportColumns,
|
||||
viewportRows: viewportRows,
|
||||
studies: studies
|
||||
studies: ViewerStudies
|
||||
};
|
||||
var hangingProtocolViewportData = hangingProtocol(inputData);
|
||||
|
||||
|
||||
Reference in new issue
Block a user