LT-251: Making studies clickable to trigger series state
This commit is contained in:
parent
b6e95b567b
commit
0d9afa3557
@ -13,24 +13,20 @@ Template.studySeriesQuickSwitch.onCreated(() => {
|
|||||||
return layoutManager && layoutManager.viewportData && layoutManager.viewportData[viewportIndex];
|
return layoutManager && layoutManager.viewportData && layoutManager.viewportData[viewportIndex];
|
||||||
};
|
};
|
||||||
|
|
||||||
// Get the current study being shown in the current viewport
|
// Gets the current viewport data
|
||||||
instance.getCurrentStudy = () => {
|
const viewportIndex = instance.data.viewportIndex;
|
||||||
const viewportIndex = instance.data.viewportIndex;
|
const viewportData = instance.getViewportData(viewportIndex);
|
||||||
|
if (!viewportData) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Runs this computation everytime the current viewport is changed
|
// Fins the current study and return it
|
||||||
Session.get('CornerstoneNewImage' + viewportIndex);
|
const study = ViewerStudies.findOne({
|
||||||
|
studyInstanceUid: viewportData.studyInstanceUid
|
||||||
|
});
|
||||||
|
|
||||||
// Gets the current viewport data
|
// Change the current study to update the thumbnails
|
||||||
const viewportData = instance.getViewportData(viewportIndex);
|
instance.data.currentStudy.set(study);
|
||||||
if (!viewportData) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fins the current study and return it
|
|
||||||
return ViewerStudies.findOne({
|
|
||||||
studyInstanceUid: viewportData.studyInstanceUid
|
|
||||||
});
|
|
||||||
};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Template.studySeriesQuickSwitch.events({
|
Template.studySeriesQuickSwitch.events({
|
||||||
@ -45,11 +41,8 @@ Template.studySeriesQuickSwitch.events({
|
|||||||
});
|
});
|
||||||
|
|
||||||
Template.studySeriesQuickSwitch.helpers({
|
Template.studySeriesQuickSwitch.helpers({
|
||||||
// Get the current study and change the reactive variable
|
// Get the current study
|
||||||
currentStudy() {
|
currentStudy() {
|
||||||
const instance = Template.instance();
|
return Template.instance().data.currentStudy.get();
|
||||||
const currentStudy = instance.getCurrentStudy();
|
|
||||||
instance.data.currentStudy.set(currentStudy);
|
|
||||||
return currentStudy;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -49,18 +49,21 @@ $seriesSpacing = 2px
|
|||||||
position: relative
|
position: relative
|
||||||
|
|
||||||
&.switchSectionSeries.hover, &.switchSectionStudy:hover
|
&.switchSectionSeries.hover, &.switchSectionStudy:hover
|
||||||
.studySwitch .studyBox, .seriesSwitch .seriesItem
|
.seriesSwitch .seriesItem
|
||||||
opacity: 0
|
opacity: 0
|
||||||
.switchHover
|
.switchHover
|
||||||
opacity: 1
|
opacity: 1
|
||||||
.studyHover
|
.studyHover
|
||||||
transform(scale(1))
|
height: auto
|
||||||
|
padding-top: $switchSize
|
||||||
|
transition(padding-top 0.3s ease\, visibility 0s linear 0s)
|
||||||
|
visibility: visible
|
||||||
|
|
||||||
&.switchSectionSeries.hover
|
&.switchSectionSeries.hover
|
||||||
.seriesHover
|
.seriesHover
|
||||||
.thumbnailsWrapper
|
.thumbnailsWrapper
|
||||||
|
transform(scale(0.9) translateY($switchSize))
|
||||||
transition(all 0.3s ease)
|
transition(all 0.3s ease)
|
||||||
transform(scale(0.9) translateY($switchSize*1.5))
|
|
||||||
.thumbnailEntry .seriesDetails
|
.thumbnailEntry .seriesDetails
|
||||||
opacity: 0
|
opacity: 0
|
||||||
visibility: hidden
|
visibility: hidden
|
||||||
@ -79,7 +82,7 @@ $seriesSpacing = 2px
|
|||||||
opacity: 0
|
opacity: 0
|
||||||
transform(translateY(-36px))
|
transform(translateY(-36px))
|
||||||
|
|
||||||
.studySwitch .studyBox, .seriesSwitch .seriesItem
|
.seriesSwitch .seriesItem
|
||||||
transition(opacity 0.3s ease)
|
transition(opacity 0.3s ease)
|
||||||
|
|
||||||
.studySwitch, .seriesSwitch
|
.studySwitch, .seriesSwitch
|
||||||
@ -139,8 +142,6 @@ $seriesSpacing = 2px
|
|||||||
overflow: hidden
|
overflow: hidden
|
||||||
position: absolute
|
position: absolute
|
||||||
top: 0
|
top: 0
|
||||||
transform(scale(0))
|
|
||||||
transition(all 0.3s ease)
|
|
||||||
z-index: 10000
|
z-index: 10000
|
||||||
|
|
||||||
.scrollArea
|
.scrollArea
|
||||||
@ -151,9 +152,18 @@ $seriesSpacing = 2px
|
|||||||
width: calc(100% + 20px)
|
width: calc(100% + 20px)
|
||||||
|
|
||||||
.studyHover
|
.studyHover
|
||||||
|
height: 0
|
||||||
|
padding-top: 0
|
||||||
|
transition(padding-top 0.3s ease\, visibility 0s linear 0.3s)
|
||||||
|
visibility: hidden
|
||||||
width: 320px
|
width: 320px
|
||||||
|
|
||||||
|
.scrollArea
|
||||||
|
height: 500px
|
||||||
|
|
||||||
.seriesHover
|
.seriesHover
|
||||||
|
transform(scale(0))
|
||||||
|
transition(all 0.3s ease)
|
||||||
width: 731px
|
width: 731px
|
||||||
|
|
||||||
.thumbnailEntry
|
.thumbnailEntry
|
||||||
@ -164,7 +174,6 @@ $seriesSpacing = 2px
|
|||||||
float: right
|
float: right
|
||||||
.studyHover
|
.studyHover
|
||||||
left: 0
|
left: 0
|
||||||
transform-origin(0% 0%)
|
|
||||||
.seriesHover, .thumbnailsWrapper
|
.seriesHover, .thumbnailsWrapper
|
||||||
right: 0
|
right: 0
|
||||||
transform-origin(100% 0%)
|
transform-origin(100% 0%)
|
||||||
@ -174,7 +183,6 @@ $seriesSpacing = 2px
|
|||||||
float: left
|
float: left
|
||||||
.studyHover
|
.studyHover
|
||||||
right: 0
|
right: 0
|
||||||
transform-origin(100% 0%)
|
|
||||||
.seriesHover, .thumbnailsWrapper
|
.seriesHover, .thumbnailsWrapper
|
||||||
left: 0
|
left: 0
|
||||||
transform-origin(0% 0%)
|
transform-origin(0% 0%)
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
<div class="studyTimepointWrapper">
|
<div class="studyTimepointWrapper">
|
||||||
<div class="studyTimepoint">
|
<div class="studyTimepoint">
|
||||||
{{#each study in studies}}
|
{{#each study in studies}}
|
||||||
{{>studyTimepointStudy study=study active=(isActive study) viewportIndex=viewportIndex}}
|
{{>studyTimepointStudy study=study active=(isActive study) viewportIndex=this.viewportIndex}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -30,8 +30,17 @@ Template.studyTimepoint.events({
|
|||||||
'selectionChanged .studyTimepoint'(event, instance, changed) {
|
'selectionChanged .studyTimepoint'(event, instance, changed) {
|
||||||
const $selection = $(changed.selection);
|
const $selection = $(changed.selection);
|
||||||
|
|
||||||
|
// Defines where will be the studies searched
|
||||||
let $studiesTarget = instance.$('.studyTimepoint');
|
let $studiesTarget = instance.$('.studyTimepoint');
|
||||||
|
|
||||||
if (changed.isQuickSwitch) {
|
if (changed.isQuickSwitch) {
|
||||||
|
// Changes the current quick switch study
|
||||||
|
const study = ViewerStudies.findOne({
|
||||||
|
studyInstanceUid: changed.studyInstanceUid
|
||||||
|
});
|
||||||
|
instance.data.currentStudy.set(study);
|
||||||
|
|
||||||
|
// Changes the target to toggle the selection in all the studies
|
||||||
$studiesTarget = $studiesTarget.closest('.studyTimepointBrowser');
|
$studiesTarget = $studiesTarget.closest('.studyTimepointBrowser');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="timepointModalities">{{modalitiesSummary timepoint}}</div>
|
<div class="timepointModalities">{{modalitiesSummary timepoint}}</div>
|
||||||
</div>
|
</div>
|
||||||
{{>studyTimepoint studies=(studies timepoint) index=@index viewportIndex=viewportIndex}}
|
{{>studyTimepoint studies=(studies timepoint) index=@index viewportIndex=this.viewportIndex currentStudy=this.currentStudy}}
|
||||||
</div>
|
</div>
|
||||||
<hr class="m-y-1">
|
<hr class="m-y-1">
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|||||||
@ -48,12 +48,14 @@ Template.studyTimepointStudy.events({
|
|||||||
},
|
},
|
||||||
|
|
||||||
// Changes the current study selection for the clicked study
|
// Changes the current study selection for the clicked study
|
||||||
'click .studySidebarTimepoint .studyModality'(event, instance) {
|
'click .studyModality'(event, instance) {
|
||||||
const $study = $(event.currentTarget).closest('.studyTimepointStudy');
|
const $study = $(event.currentTarget).closest('.studyTimepointStudy');
|
||||||
|
|
||||||
const studyData = instance.data.study;
|
const studyData = instance.data.study;
|
||||||
const studyInstanceUid = studyData.studyInstanceUid;
|
const studyInstanceUid = studyData.studyInstanceUid;
|
||||||
|
|
||||||
|
const isQuickSwitch = !_.isUndefined(instance.data.viewportIndex);
|
||||||
|
|
||||||
// Check if the study already has series data,
|
// Check if the study already has series data,
|
||||||
// and if not, retrieve it.
|
// and if not, retrieve it.
|
||||||
if (!studyData.seriesList) {
|
if (!studyData.seriesList) {
|
||||||
@ -65,13 +67,13 @@ Template.studyTimepointStudy.events({
|
|||||||
$study.addClass('loading');
|
$study.addClass('loading');
|
||||||
getStudyMetadata(studyInstanceUid, studyData => {
|
getStudyMetadata(studyInstanceUid, studyData => {
|
||||||
ViewerStudies.insert(studyData);
|
ViewerStudies.insert(studyData);
|
||||||
instance.select();
|
instance.select(isQuickSwitch);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
studyData.seriesList = alreadyLoaded.seriesList;
|
studyData.seriesList = alreadyLoaded.seriesList;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
instance.select();
|
instance.select(isQuickSwitch);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user