Remove tabbed layout in favour of current Lesion Tracker design (OHIF-49)
This commit is contained in:
1 parent
8b364ce9d0
commit
82e374b1e3
48 files changed
+371
-511
No files matched your search
@@ -1,2 +1,4 @@
|
||||
@import url(http://fonts.googleapis.com/css?family=Roboto:400,100,100italic,300,300italic,400italic,500,500italic,700,700italic,900,900italic&subset=latin,latin-ext)
|
||||
@import url(http://fonts.googleapis.com/css?family=Sanchez:400,700&subset=latin,latin-ext)
|
||||
// TODO: Find out why Meteor is complaining about these?
|
||||
// Replaced them with <link>'s in the HEAD.html of each application, for now.
|
||||
//@import url(http://fonts.googleapis.com/css?family=Roboto:400,100,100italic,300,300italic,400italic,500,500italic,700,700italic,900,900italic&subset=latin,latin-ext)
|
||||
//@import url(http://fonts.googleapis.com/css?family=Sanchez:400,700&subset=latin,latin-ext)
|
||||
@@ -1,10 +1,5 @@
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
Template.matchedProtocols.onRendered(() => {
|
||||
const instance = Template.instance();
|
||||
instance.$('#matchedProtocols button').tooltip(OHIF.viewer.tooltipConfig);
|
||||
});
|
||||
|
||||
Template.matchedProtocols.helpers({
|
||||
/**
|
||||
* Reactively re-render the MatchedProtocols Collection contents
|
||||
|
||||
@@ -6,7 +6,7 @@ ViewerData = Session.get('ViewerData') || {};
|
||||
const worklistContentId = 'worklistTab';
|
||||
const viewerContentId = 'viewerTab';
|
||||
|
||||
Template.lesionTracker.onRendered(function() {
|
||||
Template.lesionTracker.onRendered(() => {
|
||||
const templateData = Template.currentData();
|
||||
if (templateData && templateData.studyInstanceUid) {
|
||||
const studyInstanceUid = templateData.studyInstanceUid;
|
||||
@@ -19,12 +19,10 @@ Template.lesionTracker.onRendered(function() {
|
||||
// TODO: Fix this it seems to be forcing two switches
|
||||
switchToTab(contentId);
|
||||
}
|
||||
|
||||
Meteor.subscribe('hangingprotocols');
|
||||
});
|
||||
|
||||
Template.lesionTracker.events({
|
||||
'click .js-toggle-studyList': function() {
|
||||
'click .js-toggle-studyList'() {
|
||||
const contentId = Session.get('activeContentId');
|
||||
|
||||
if (contentId !== worklistContentId) {
|
||||
@@ -38,7 +36,7 @@ Template.lesionTracker.events({
|
||||
Session.set('defaultSignInMessage', 'Tumor tracking in your browser.');
|
||||
|
||||
Template.lesionTracker.helpers({
|
||||
studyListToggleText: function() {
|
||||
studyListToggleText() {
|
||||
const contentId = Session.get('activeContentId');
|
||||
|
||||
// If the Viewer has not been opened yet, 'Back to viewer' should
|
||||
@@ -54,7 +52,7 @@ Template.lesionTracker.helpers({
|
||||
return 'Study list';
|
||||
}
|
||||
},
|
||||
onStudyList: function() {
|
||||
onStudyList() {
|
||||
return (Session.get('activeContentId') === 'worklistTab');
|
||||
}
|
||||
});
|
||||
@@ -72,14 +72,3 @@ img.logoImage
|
||||
color: $textSecondaryColor
|
||||
font-size: 30px
|
||||
font-weight: 200
|
||||
|
||||
// Override Viewerbase's borders
|
||||
#imageViewerViewports .viewportContainer
|
||||
border: none !important
|
||||
outline: 0 !important // Prevent blue outline in Chrome
|
||||
|
||||
&:hover
|
||||
&.active
|
||||
&:hover.active
|
||||
border: none !important
|
||||
outline: 0 !important // Prevent blue outline in Chrome
|
||||
@@ -1,3 +0,0 @@
|
||||
<template name="lesionTrackerLayout">
|
||||
{{>yield }}
|
||||
</template>
|
||||
@@ -26,6 +26,8 @@ Template.viewer.onCreated(() => {
|
||||
instance.data.state.set('leftSidebar', Session.get('leftSidebar'));
|
||||
instance.data.state.set('rightSidebar', Session.get('rightSidebar'));
|
||||
|
||||
instance.subscribe('hangingprotocols');
|
||||
|
||||
Session.set('currentTimepointId', instance.data.currentTimepointId);
|
||||
|
||||
const contentId = instance.data.contentId;
|
||||
@@ -49,18 +51,6 @@ Template.viewer.onCreated(() => {
|
||||
OHIF.viewer.defaultHotkeys.bidirectional = 'T'; // Target
|
||||
OHIF.viewer.defaultHotkeys.nonTarget = 'N'; // Non-target
|
||||
|
||||
if (isTouchDevice()) {
|
||||
OHIF.viewer.tooltipConfig = {
|
||||
trigger: 'manual'
|
||||
};
|
||||
} else {
|
||||
OHIF.viewer.tooltipConfig = {
|
||||
trigger: 'hover'
|
||||
};
|
||||
}
|
||||
|
||||
OHIF.viewer.updateImageSynchronizer = new cornerstoneTools.Synchronizer('CornerstoneNewImage', cornerstoneTools.updateImageSynchronizer);
|
||||
|
||||
if (ViewerData[contentId].loadedSeriesData) {
|
||||
log.info('Reloading previous loadedSeriesData');
|
||||
OHIF.viewer.loadedSeriesData = ViewerData[contentId].loadedSeriesData;
|
||||
@@ -68,20 +58,7 @@ Template.viewer.onCreated(() => {
|
||||
} else {
|
||||
log.info('Setting default ViewerData');
|
||||
OHIF.viewer.loadedSeriesData = {};
|
||||
|
||||
ViewerData[contentId].loadedSeriesData = OHIF.viewer.loadedSeriesData;
|
||||
|
||||
// Update the viewer data object
|
||||
if (!instance.data.timepointIds || instance.data.timepointIds.length <= 1) {
|
||||
// Update the viewer data object
|
||||
ViewerData[contentId].viewportColumns = 1;
|
||||
ViewerData[contentId].viewportRows = 1;
|
||||
} else if (instance.data.timepointIds.length > 1) {
|
||||
ViewerData[contentId].viewportColumns = 2;
|
||||
ViewerData[contentId].viewportRows = 1;
|
||||
}
|
||||
|
||||
ViewerData[contentId].activeViewport = 0;
|
||||
ViewerData[contentId].loadedSeriesData = {};
|
||||
Session.set('ViewerData', ViewerData);
|
||||
}
|
||||
|
||||
@@ -108,11 +85,8 @@ Template.viewer.onCreated(() => {
|
||||
instance.subscribe('singlePatientMeasurements', dataContext.studies[0].patientId);
|
||||
instance.subscribe('singlePatientImageMeasurements', dataContext.studies[0].patientId);
|
||||
instance.subscribe('singlePatientAdditionalFindings', dataContext.studies[0].patientId);
|
||||
|
||||
const subscriptionsReady = instance.subscriptionsReady();
|
||||
log.info('autorun viewer.js. Ready: ' + subscriptionsReady);
|
||||
|
||||
if (subscriptionsReady) {
|
||||
|
||||
if (instance.subscriptionsReady()) {
|
||||
// Set buttons as enabled/disabled when Timepoints collection is ready
|
||||
timepointAutoCheck(dataContext);
|
||||
|
||||
|
||||
@@ -6,6 +6,23 @@
|
||||
display: flex
|
||||
flex-flow: column wrap
|
||||
height: 100%
|
||||
width: 100%
|
||||
margin: 0
|
||||
padding: 0
|
||||
width: 100%
|
||||
|
||||
|
||||
#imageViewerViewports
|
||||
.viewportContainer
|
||||
border: none !important
|
||||
outline: 0 !important // Prevent blue outline in Chrome
|
||||
|
||||
&:hover
|
||||
&.active
|
||||
&:hover.active
|
||||
border: none !important
|
||||
outline: 0 !important // Prevent blue outline in Chrome
|
||||
|
||||
&:not(:last-child)
|
||||
.removable
|
||||
.imageViewerViewport
|
||||
border-right: $uiBorderThickness solid #436270
|
||||
@@ -0,0 +1,47 @@
|
||||
Meteor.startup(function() {
|
||||
toolManager.addTool('bidirectional', {
|
||||
mouse: cornerstoneTools.bidirectional,
|
||||
touch: cornerstoneTools.bidirectionalTouch
|
||||
});
|
||||
|
||||
toolManager.addTool('nonTarget', {
|
||||
mouse: cornerstoneTools.nonTarget,
|
||||
touch: cornerstoneTools.nonTargetTouch
|
||||
});
|
||||
|
||||
toolManager.addTool('scaleOverlayTool', {
|
||||
mouse: cornerstoneTools.scaleOverlayTool,
|
||||
touch: cornerstoneTools.scaleOverlayTool
|
||||
});
|
||||
|
||||
toolManager.addTool('deleteLesionKeyboardTool', {
|
||||
mouse: cornerstoneTools.deleteLesionKeyboardTool,
|
||||
touch: cornerstoneTools.deleteLesionKeyboardTool
|
||||
});
|
||||
|
||||
toolManager.addTool('crTool', {
|
||||
mouse: cornerstoneTools.crTool,
|
||||
touch: cornerstoneTools.crToolTouch
|
||||
});
|
||||
|
||||
toolManager.addTool('unTool', {
|
||||
mouse: cornerstoneTools.unTool,
|
||||
touch: cornerstoneTools.unToolTouch
|
||||
});
|
||||
|
||||
toolManager.addTool('exTool', {
|
||||
mouse: cornerstoneTools.exTool,
|
||||
touch: cornerstoneTools.exToolTouch
|
||||
});
|
||||
|
||||
var states = toolManager.getToolDefaultStates();
|
||||
states.deactivate.push('bidirectional');
|
||||
states.deactivate.push('nonTarget');
|
||||
states.deactivate.push('length');
|
||||
states.deactivate.push('crTool');
|
||||
states.deactivate.push('unTool');
|
||||
states.deactivate.push('exTool');
|
||||
|
||||
states.activate.push('deleteLesionKeyboardTool');
|
||||
toolManager.setToolDefaultStates(states);
|
||||
});
|
||||
@@ -55,6 +55,8 @@ Package.onUse(function(api) {
|
||||
], 'client', {
|
||||
bare: true
|
||||
});
|
||||
|
||||
api.addFiles('client/tools.js', 'client');
|
||||
|
||||
// UI Components
|
||||
api.addFiles('client/components/viewer/viewer.html', 'client');
|
||||
@@ -81,8 +83,6 @@ Package.onUse(function(api) {
|
||||
api.addFiles('client/components/lesionTracker/lesionTracker.styl', 'client');
|
||||
api.addFiles('client/components/lesionTracker/lesionTracker.js', 'client');
|
||||
|
||||
api.addFiles('client/components/lesionTrackerLayout/lesionTrackerLayout.html', 'client');
|
||||
|
||||
api.addFiles('client/components/additionalFindings/additionalFindings.html', 'client');
|
||||
api.addFiles('client/components/additionalFindings/additionalFindings.styl', 'client');
|
||||
api.addFiles('client/components/additionalFindings/additionalFindings.js', 'client');
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<template name="emailVerification">
|
||||
<div id="emailVerification">
|
||||
<div id="emailVerificationContent">
|
||||
<h3>Verify Your Email Address</h3>
|
||||
<p>We need to verify your email address. We've sent an email to <b>{{emailAddress}}</b> to verify your address. Please click the link in your email to continue.</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,5 @@
|
||||
Template.emailVerification.helpers({
|
||||
emailAddress: function() {
|
||||
return Meteor.user().emails[0].address;
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
#emailVerification
|
||||
#emailVerificationContent
|
||||
position: absolute
|
||||
top: 0
|
||||
bottom: 0
|
||||
left: 0
|
||||
right: 0
|
||||
margin: auto
|
||||
width: 60%
|
||||
height: 20%
|
||||
z-index: 100
|
||||
border-radius: 5px
|
||||
padding: 10px 20px 10px 20px
|
||||
background-color: rgba(255,255,255,1)
|
||||
outline: none
|
||||
@@ -0,0 +1,3 @@
|
||||
<template name="layout">
|
||||
{{>yield }}
|
||||
</template>
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
<template name="relatedStudySelect">
|
||||
<div class="relatedStudySelect">
|
||||
<label>Study:</label>
|
||||
<span class="loading"><i class="fa fa-spinner fa-spin"></i></span>
|
||||
<select id="selectStudyDate">
|
||||
{{#each relatedStudies}}
|
||||
<option value="{{studyInstanceUid}}" selected={{selected}}>{{formatDA studyDate}}: {{studyDescription}}</option>
|
||||
{{/each}}
|
||||
</select>
|
||||
</div>
|
||||
</template>
|
||||
-105
@@ -1,105 +0,0 @@
|
||||
Template.relatedStudySelect.helpers({
|
||||
/**
|
||||
* Returns an array of studies that are related to the current study by patient ID.
|
||||
* The value for 'selected' for the currently loaded study is set to true, so that
|
||||
* this becomes the current option in the combo box.
|
||||
*
|
||||
* @returns {*} Array of studies that are related to the current study by patient ID
|
||||
*/
|
||||
relatedStudies: function() {
|
||||
// Check which study is currently loaded into the study browser
|
||||
var currentStudyInBrowser = ViewerStudies.findOne({
|
||||
selected: true
|
||||
});
|
||||
|
||||
// Find all studies in the Worklist which have the same patientId as the currently selected study
|
||||
var relatedStudies = WorklistStudies.find({
|
||||
patientId: currentStudyInBrowser.patientId
|
||||
}, {
|
||||
sort: {
|
||||
studyDate: -1
|
||||
}
|
||||
}).fetch();
|
||||
|
||||
// If no Study / Timepoint associated studies exist, just
|
||||
// return the list of loaded studies
|
||||
if (!relatedStudies.length) {
|
||||
return ViewerStudies.find();
|
||||
}
|
||||
|
||||
// Modify the array of related studies so the default option is the currently selected study
|
||||
relatedStudies.forEach(function(study, index) {
|
||||
// If the studyInstanceUid matches that of the current study in the browser,
|
||||
// Set this to 'selected', so that it becomes the default option
|
||||
if (study.studyInstanceUid === currentStudyInBrowser.studyInstanceUid) {
|
||||
relatedStudies[index].selected = true;
|
||||
}
|
||||
});
|
||||
|
||||
// Use this array to populate the combo box
|
||||
return relatedStudies;
|
||||
}
|
||||
});
|
||||
|
||||
Template.relatedStudySelect.events({
|
||||
/**
|
||||
* When the study date selector combo box is changed, we will
|
||||
* hide the select box, temporarily display a loading sign, and grab
|
||||
* the selected study. Once the study has been retrieved it is added
|
||||
* into the ViewerStudies collection and set as selected. This reactively
|
||||
* populated the thumbnail browser.
|
||||
*
|
||||
* @param e The select box change event
|
||||
*/
|
||||
'change select#selectStudyDate': function(e) {
|
||||
var selectBox = $(e.currentTarget);
|
||||
var studyInstanceUid = selectBox.val();
|
||||
|
||||
// Hide the select box
|
||||
selectBox.css('display', 'none');
|
||||
|
||||
// Show the loading indicator
|
||||
var loadingIndicator = selectBox.siblings('.loading');
|
||||
loadingIndicator.css('display', 'block');
|
||||
|
||||
getStudyMetadata(studyInstanceUid, function(study) {
|
||||
sortStudy(study);
|
||||
|
||||
// Hide the loading indicator
|
||||
loadingIndicator.css('display', 'none');
|
||||
|
||||
// Show the select box again
|
||||
selectBox.css('display', 'block');
|
||||
|
||||
// Set "Selected" to false for the entire collection
|
||||
ViewerStudies.update({}, {
|
||||
$set: {
|
||||
selected: false
|
||||
}
|
||||
}, {
|
||||
multi: true
|
||||
});
|
||||
|
||||
// Check if this study already exists in the ViewerStudies collection
|
||||
// of loaded studies. If it does, set it's 'selected' value to true.
|
||||
var existingStudy = ViewerStudies.findOne({
|
||||
studyInstanceUid: studyInstanceUid
|
||||
});
|
||||
|
||||
if (existingStudy) {
|
||||
// Set the current finding in the collection to true
|
||||
ViewerStudies.update(existingStudy._id, {
|
||||
$set: {
|
||||
selected: true
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// If the study does not exist, add the 'selected' key to the object
|
||||
// with the value True, and insert it into the ViewerStudies Collection
|
||||
study.selected = true;
|
||||
ViewerStudies.insert(study);
|
||||
});
|
||||
}
|
||||
});
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
.relatedStudySelect
|
||||
margin: 0 auto 15px
|
||||
text-align: center
|
||||
width: 100px
|
||||
|
||||
#selectStudyDate
|
||||
color: black
|
||||
background-color: #666
|
||||
border-color: #666
|
||||
width: 96%
|
||||
margin: 0 auto
|
||||
|
||||
label
|
||||
font-weight: normal
|
||||
color: #666
|
||||
float: left
|
||||
padding-left: 2%
|
||||
|
||||
.loading
|
||||
display: none
|
||||
color: white
|
||||
text-align: center
|
||||
|
||||
@@ -29,12 +29,4 @@ Template.gridLayout.helpers({
|
||||
|
||||
return viewportData;
|
||||
}
|
||||
});
|
||||
|
||||
Template.gridLayout.onRendered(function() {
|
||||
OHIF.viewer.updateImageSynchronizer = new cornerstoneTools.Synchronizer('CornerstoneNewImage', cornerstoneTools.updateImageSynchronizer);
|
||||
});
|
||||
|
||||
Template.gridLayout.onDestroyed(function() {
|
||||
OHIF.viewer.updateImageSynchronizer.destroy();
|
||||
});
|
||||
});
|
||||
@@ -2,19 +2,4 @@
|
||||
|
||||
#imageViewerViewports
|
||||
height: 100%
|
||||
width: 100%
|
||||
|
||||
.viewportContainer
|
||||
float: left
|
||||
border: $viewportBorderThickness solid $viewportBorderColor
|
||||
|
||||
&.active, &:hover.active
|
||||
border: $viewportBorderThickness solid $viewportBorderColorActive
|
||||
|
||||
&:hover
|
||||
border: $viewportBorderThickness solid $viewportBorderColorHover
|
||||
|
||||
.removable
|
||||
width: 100%
|
||||
height: 100%
|
||||
position: relative // Necessary so that the viewportOverlay is on top of the viewports
|
||||
width: 100%
|
||||
+5
@@ -25,6 +25,11 @@ function loadSeriesIntoViewport(data, templateData) {
|
||||
var viewportIndex = $('.imageViewerViewport').index(element);
|
||||
|
||||
layoutManager = layoutManager || window.layoutManager;
|
||||
layoutManager.viewportData = layoutManager.viewportData || {};
|
||||
if (layoutManager.viewportData[viewportIndex] === undefined) {
|
||||
layoutManager.viewportData[viewportIndex] = {};
|
||||
}
|
||||
|
||||
layoutManager.viewportData[viewportIndex].viewportIndex = viewportIndex;
|
||||
|
||||
// Get the contentID of the current worklist tab, if the viewport is running
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
Template.viewerMain.onCreated(() => {
|
||||
// Attach the Window resize listener
|
||||
$(window).on('resize', handleResize);
|
||||
|
||||
// Create the synchronizer used to update reference lines
|
||||
OHIF.viewer.updateImageSynchronizer = new cornerstoneTools.Synchronizer('CornerstoneNewImage', cornerstoneTools.updateImageSynchronizer);
|
||||
});
|
||||
|
||||
Template.viewerMain.onRendered(() => {
|
||||
@@ -21,6 +24,6 @@ Template.viewerMain.onDestroyed(() => {
|
||||
// Remove the Window resize listener
|
||||
$(window).off('resize', handleResize);
|
||||
|
||||
// Destory the synchronizer used to update reference lines
|
||||
// Destroy the synchronizer used to update reference lines
|
||||
OHIF.viewer.updateImageSynchronizer.destroy();
|
||||
});
|
||||
@@ -7,11 +7,22 @@
|
||||
#layoutManagerTarget
|
||||
width: 100%
|
||||
height: 100%
|
||||
|
||||
transition(all 0.3s ease)
|
||||
|
||||
#imageViewerViewports
|
||||
.viewportContainer:not(:last-child)
|
||||
.viewportContainer
|
||||
float: left
|
||||
border: $viewportBorderThickness solid $viewportBorderColor
|
||||
|
||||
&:hover
|
||||
border: $viewportBorderThickness solid $viewportBorderColorHover
|
||||
|
||||
&.active, &:hover.active
|
||||
border: $viewportBorderThickness solid $viewportBorderColorActive
|
||||
|
||||
.removable
|
||||
.imageViewerViewport
|
||||
border-right: $uiBorderThickness solid #436270
|
||||
width: 100%
|
||||
height: 100%
|
||||
position: relative // Necessary so that the viewportOverlay is on top of the viewports
|
||||
|
||||
|
||||
@@ -11,13 +11,13 @@
|
||||
<div>{{formatDA studyDate}} {{formatTM studyTime}}</div>
|
||||
</div>
|
||||
<div class="bottomright dicomTag">
|
||||
<div>Zoom: {{formatNumberPrecision zoom 2}}%</div>
|
||||
<div>{{#if zoom}}Zoom: {{formatNumberPrecision zoom 2}}%{{/if}}</div>
|
||||
<div>{{compression}}</div>
|
||||
<div>{{wwwc}}</div>
|
||||
</div>
|
||||
<div class="bottomleft dicomTag">
|
||||
<div>Ser: {{seriesNumber}}</div>
|
||||
<div>Img: {{imageNumber}} ({{imageIndex}}/{{numImages}})</div>
|
||||
<div>{{#if seriesNumber}}Ser: {{seriesNumber}}{{/if}}</div>
|
||||
<div>{{#if numImages}}Img: {{imageNumber}} ({{imageIndex}}/{{numImages}}){{/if}}</div>
|
||||
<div>{{#if frameRate}}{{frameRate}} FPS{{/if}}</div>
|
||||
<div>{{imageDimensions}}</div>
|
||||
<div>{{seriesDescription}}</div>
|
||||
@@ -33,12 +33,12 @@
|
||||
<div>{{formatDA studyDate}} {{formatTM studyTime}}</div>
|
||||
</div>
|
||||
<div class="bottomright dicomTag">
|
||||
<div>Ser: {{seriesNumber}}</div>
|
||||
<div>Img: {{imageNumber}} ({{imageIndex}}/{{numImages}})</div>
|
||||
<div>{{#if seriesNumber}}Ser: {{seriesNumber}}{{/if}}</div>
|
||||
<div>{{#if numImages}}Img: {{imageNumber}} ({{imageIndex}}/{{numImages}}){{/if}}</div>
|
||||
<div>{{#if frameRate}}{{frameRate}} FPS{{/if}}</div>
|
||||
<div>{{imageDimensions}}</div>
|
||||
<div>{{seriesDescription}}</div>
|
||||
<div>Zoom: {{formatNumberPrecision zoom 2}}%</div>
|
||||
<div>{{#if zoom}}Zoom: {{formatNumberPrecision zoom 2}}%{{/if}}</div>
|
||||
<div>{{compression}}</div>
|
||||
<div>{{wwwc}}</div>
|
||||
</div>
|
||||
@@ -53,12 +53,12 @@
|
||||
<div>{{formatDA studyDate}} {{formatTM studyTime}}</div>
|
||||
</div>
|
||||
<div class="bottomleft dicomTag">
|
||||
<div>Ser: {{seriesNumber}}</div>
|
||||
<div>Img: {{imageNumber}} ({{imageIndex}}/{{numImages}})</div>
|
||||
<div>{{#if seriesNumber}}Ser: {{seriesNumber}}{{/if}}</div>
|
||||
<div>{{#if numImages}}Img: {{imageNumber}} ({{imageIndex}}/{{numImages}}){{/if}}</div>
|
||||
<div>{{#if frameRate}}{{frameRate}} FPS{{/if}}</div>
|
||||
<div>{{imageDimensions}}</div>
|
||||
<div>{{seriesDescription}}</div>
|
||||
<div>Zoom: {{formatNumberPrecision zoom 2}}%</div>
|
||||
<div>{{#if zoom}}Zoom: {{formatNumberPrecision zoom 2}}%{{/if}}</div>
|
||||
<div>{{compression}}</div>
|
||||
<div>{{wwwc}}</div>
|
||||
</div>
|
||||
|
||||
@@ -133,12 +133,12 @@ Template.viewportOverlay.helpers({
|
||||
Session.get('CornerstoneImageRendered' + this.viewportIndex);
|
||||
var element = getElementIfNotEmpty(this.viewportIndex);
|
||||
if (!element) {
|
||||
return '';
|
||||
return;
|
||||
}
|
||||
|
||||
var viewport = cornerstone.getViewport(element);
|
||||
if (!viewport) {
|
||||
return '';
|
||||
return;
|
||||
}
|
||||
|
||||
return (viewport.scale * 100.0);
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
|
||||
Meteor.startup(function() {
|
||||
var debug = false;
|
||||
|
||||
if (debug === true) {
|
||||
// http://www.meteorpedia.com/read/Debugging_Reactivity
|
||||
|
||||
Meteor.autorun(function(computation) {
|
||||
computation.onInvalidate(function() {
|
||||
console.trace();
|
||||
});
|
||||
});
|
||||
|
||||
var wrappedFind = Meteor.Collection.prototype.find;
|
||||
|
||||
Meteor.Collection.prototype.find = function() {
|
||||
var cursor = wrappedFind.apply(this, arguments);
|
||||
var collectionName = this._name || this._debugName;
|
||||
|
||||
/*cursor.observeChanges({
|
||||
added: function(id, fields) {
|
||||
console.log(collectionName, 'added', id, fields);
|
||||
},
|
||||
changed: function(id, fields) {
|
||||
console.log(collectionName, 'changed', id, fields);
|
||||
},
|
||||
movedBefore: function(id, before) {
|
||||
console.log(collectionName, 'movedBefore', id, before);
|
||||
},
|
||||
removed: function(id) {
|
||||
console.log(collectionName, 'removed', id);
|
||||
}
|
||||
});*/
|
||||
|
||||
cursor.observe({
|
||||
added: function(data) {
|
||||
console.log(collectionName, 'added', data);
|
||||
},
|
||||
changed: function(data) {
|
||||
console.log(collectionName, 'changed', data);
|
||||
},
|
||||
removed: function(data) {
|
||||
console.log(collectionName, 'removed', data);
|
||||
}
|
||||
});
|
||||
|
||||
return cursor;
|
||||
};
|
||||
|
||||
function logRenders() {
|
||||
Object.keys(Template).forEach(function(name) {
|
||||
if (name.indexOf('_') > -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
var template = Template[name];
|
||||
var oldRender = template.rendered;
|
||||
var counter = 0;
|
||||
|
||||
template.rendered = function() {
|
||||
console.log(name, 'render count: ', ++counter);
|
||||
oldRender && oldRender.apply(this, arguments);
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
logRenders();
|
||||
}
|
||||
});
|
||||
@@ -44,7 +44,7 @@ importStudies = function(filesToImport, importCallback) {
|
||||
|
||||
if (fileUploadStatus.numberOfFilesFailed > 0) {
|
||||
//TODO: Some files failed to upload, so let user know
|
||||
console.log("Failed to upload " + fileUploadStatus.numberOfFilesFailed + " of " + numberOfFilesToUpload + " files");
|
||||
log.info("Failed to upload " + fileUploadStatus.numberOfFilesFailed + " of " + numberOfFilesToUpload + " files");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -34,6 +34,7 @@ Package.onUse(function(api) {
|
||||
// ---------- Components ----------
|
||||
|
||||
// Basic components
|
||||
api.addFiles('client/components/basic/layout/layout.html', 'client');
|
||||
api.addFiles('client/components/basic/loadingText/loadingText.html', 'client');
|
||||
api.addFiles('client/components/basic/loadingText/loadingText.styl', 'client');
|
||||
|
||||
@@ -44,15 +45,15 @@ Package.onUse(function(api) {
|
||||
api.addFiles('client/components/basic/confirmDeleteDialog/confirmDeleteDialog.styl', 'client');
|
||||
api.addFiles('client/components/basic/confirmDeleteDialog/confirmDeleteDialog.js', 'client');
|
||||
|
||||
api.addFiles('client/components/basic/emailVerification/emailVerification.html', 'client');
|
||||
api.addFiles('client/components/basic/emailVerification/emailVerification.styl', 'client');
|
||||
api.addFiles('client/components/basic/emailVerification/emailVerification.js', 'client');
|
||||
|
||||
// Study Browser components
|
||||
api.addFiles('client/components/studyBrowser/studyBrowser/studyBrowser.html', 'client');
|
||||
api.addFiles('client/components/studyBrowser/studyBrowser/studyBrowser.js', 'client');
|
||||
api.addFiles('client/components/studyBrowser/studyBrowser/studyBrowser.styl', 'client');
|
||||
|
||||
api.addFiles('client/components/studyBrowser/relatedStudySelect/relatedStudySelect.html', 'client');
|
||||
api.addFiles('client/components/studyBrowser/relatedStudySelect/relatedStudySelect.js', 'client');
|
||||
api.addFiles('client/components/studyBrowser/relatedStudySelect/relatedStudySelect.styl', 'client');
|
||||
|
||||
api.addFiles('client/components/studyBrowser/thumbnailEntry/thumbnailEntry.html', 'client');
|
||||
api.addFiles('client/components/studyBrowser/thumbnailEntry/thumbnailEntry.js', 'client');
|
||||
api.addFiles('client/components/studyBrowser/thumbnailEntry/thumbnailEntry.styl', 'client');
|
||||
@@ -139,6 +140,7 @@ Package.onUse(function(api) {
|
||||
api.addFiles('lib/setMammogramViewportAlignment.js', 'client');
|
||||
api.addFiles('lib/isImage.js', 'client');
|
||||
api.addFiles('lib/sopClassDictionary.js', 'client');
|
||||
api.addFiles('lib/debugReactivity.js', 'client');
|
||||
|
||||
api.export('resizeViewportElements', 'client');
|
||||
api.export('handleResize', 'client');
|
||||
|
||||
@@ -5,8 +5,10 @@
|
||||
</div>
|
||||
<div class="dialogContent">
|
||||
<div class="progress">
|
||||
<div class="progress-bar progress-bar-striped active" role="progressbar" style="width:{{progressStatus}}">
|
||||
{{progressStatus}}
|
||||
<div class="progress-bar progress-bar-striped active"
|
||||
role="progressbar"
|
||||
style="width:{{progressStatus}}">
|
||||
{{formatNumberPrecision progressStatus 0}}%
|
||||
</div>
|
||||
</div>
|
||||
<div id="message">
|
||||
|
||||
@@ -1,56 +1,69 @@
|
||||
progressDialog = {
|
||||
'show': function(title, numberOfTotal) {
|
||||
Session.set("progressDialogSettings", { title: title, numberOfCompleted: 0, numberOfTotal: numberOfTotal });
|
||||
show: function(title, numberOfTotal) {
|
||||
Session.set('progressDialogSettings', {
|
||||
title: title,
|
||||
numberOfCompleted: 0,
|
||||
numberOfTotal: numberOfTotal
|
||||
});
|
||||
|
||||
$('#progressDialog').css('display', 'block');
|
||||
},
|
||||
'update': function(numberOfCompleted) {
|
||||
var progressDialogSettings = Session.get("progressDialogSettings");
|
||||
update: function(numberOfCompleted) {
|
||||
var progressDialogSettings = Session.get('progressDialogSettings');
|
||||
progressDialogSettings.numberOfCompleted = numberOfCompleted;
|
||||
|
||||
Session.set("progressDialogSettings", progressDialogSettings);
|
||||
Session.set('progressDialogSettings', progressDialogSettings);
|
||||
|
||||
if (progressDialogSettings.numberOfCompleted === progressDialogSettings.numberOfTotal) {
|
||||
progressDialog.close();
|
||||
}
|
||||
},
|
||||
'close': function() {
|
||||
Session.set("progressDialogSettings", { title: "", numberOfCompleted: 0, numberOfTotal: 1 });
|
||||
close: function() {
|
||||
Session.set('progressDialogSettings', {
|
||||
title: '',
|
||||
numberOfCompleted: 0,
|
||||
numberOfTotal: 1
|
||||
});
|
||||
|
||||
$('#progressDialog').css('display', 'none');
|
||||
},
|
||||
'setMessage': function(message) {
|
||||
var progressDialogSettings = Session.get("progressDialogSettings");
|
||||
setMessage: function(message) {
|
||||
let progressDialogSettings = Session.get('progressDialogSettings');
|
||||
progressDialogSettings.message = message;
|
||||
Session.set("progressDialogSettings", progressDialogSettings);
|
||||
Session.set('progressDialogSettings', progressDialogSettings);
|
||||
}
|
||||
};
|
||||
|
||||
Template.progressDialog.helpers({
|
||||
'progressDialogTitle': function () {
|
||||
if (Session.get("progressDialogSettings") && Session.get("progressDialogSettings").title) {
|
||||
return Session.get("progressDialogSettings").title;
|
||||
progressDialogTitle() {
|
||||
var settings = Session.get('progressDialogSettings');
|
||||
if (!settings) {
|
||||
return;
|
||||
}
|
||||
|
||||
return "";
|
||||
return settings.title;
|
||||
},
|
||||
'progressStatus': function() {
|
||||
var numberOfCompleted = 0;
|
||||
if (Session.get("progressDialogSettings") && Session.get("progressDialogSettings").numberOfCompleted) {
|
||||
numberOfCompleted = Session.get("progressDialogSettings").numberOfCompleted;
|
||||
|
||||
progressStatus() {
|
||||
const settings = Session.get('progressDialogSettings');
|
||||
if (!settings) {
|
||||
return;
|
||||
}
|
||||
|
||||
var numberofTotal = 1;
|
||||
if (Session.get("progressDialogSettings") && Session.get("progressDialogSettings").numberOfTotal) {
|
||||
numberofTotal = Session.get("progressDialogSettings").numberOfTotal;
|
||||
if (settings.numberOfCompleted === undefined ||
|
||||
settings.numberOfTotal === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
return parseInt((numberOfCompleted / numberofTotal) * 100) + "%";
|
||||
return settings.numberOfCompleted / settings.numberOfTotal;
|
||||
},
|
||||
'progressMessage': function() {
|
||||
var progressDialogSettings = Session.get("progressDialogSettings");
|
||||
if (progressDialogSettings && progressDialogSettings.message) {
|
||||
return progressDialogSettings.message;
|
||||
|
||||
progressMessage() {
|
||||
var settings = Session.get('progressDialogSettings');
|
||||
if (!settings) {
|
||||
return;
|
||||
}
|
||||
return;
|
||||
|
||||
return settings.message;
|
||||
}
|
||||
});
|
||||
@@ -1,12 +1,4 @@
|
||||
<template name="worklist">
|
||||
<ul class="nav noselect" role="tablist" id="tablist">
|
||||
<li role="presentation" class="tabTitle active">
|
||||
<a data-target="#worklistTab" role="tab" data-toggle="tab">Study List</a>
|
||||
</li>
|
||||
{{#each worklistTabs }}
|
||||
{{>tabTitle }}
|
||||
{{/each }}
|
||||
</ul>
|
||||
<div id="worklistTabs" class="tab-content">
|
||||
<div role="tabpanel" class="tab-pane active" id="worklistTab">
|
||||
<div class="worklistContainer">
|
||||
|
||||
@@ -12,59 +12,6 @@ body
|
||||
background-color: black
|
||||
margin: 0 auto
|
||||
color: white
|
||||
|
||||
#tabs
|
||||
width: 100%
|
||||
|
||||
#tablist
|
||||
border-bottom: 1px solid #424242
|
||||
background-color: #202020
|
||||
height: 41px
|
||||
|
||||
a:hover
|
||||
background-color: transparent
|
||||
|
||||
.tabTitle
|
||||
background-color: #202020
|
||||
border-color: #424242
|
||||
float: left
|
||||
line-height: 30px
|
||||
|
||||
&:hover
|
||||
color: black
|
||||
background-color: white
|
||||
|
||||
button.close
|
||||
color: black
|
||||
|
||||
&.active
|
||||
background-color: #424242
|
||||
border-color: #424242
|
||||
|
||||
&:hover
|
||||
background-color: #424242
|
||||
cursor: none
|
||||
|
||||
a
|
||||
color: white
|
||||
|
||||
button.close
|
||||
color: white
|
||||
|
||||
a
|
||||
padding: 5px 15px
|
||||
cursor: pointer
|
||||
color: #424242
|
||||
text-decoration: none
|
||||
|
||||
button.close
|
||||
margin: 4px 0 4px 8px
|
||||
text-shadow: none
|
||||
color: white
|
||||
text-decoration: none
|
||||
|
||||
&:hover
|
||||
color: red
|
||||
|
||||
.tab-content
|
||||
width: 100%
|
||||
|
||||
@@ -8,8 +8,8 @@ Template.worklistResult.helpers({
|
||||
* Returns a sorted instance of the WorklistStudies Collection
|
||||
* by Patient name and Study Date in Ascending order.
|
||||
*/
|
||||
studies: function() {
|
||||
var sortOption = Session.get('sortOption');
|
||||
studies() {
|
||||
const sortOption = Session.get('sortOption');
|
||||
if (sortOption) {
|
||||
return WorklistStudies.find({}, {
|
||||
sort: sortOption
|
||||
@@ -24,22 +24,24 @@ Template.worklistResult.helpers({
|
||||
});
|
||||
},
|
||||
|
||||
numberOfStudies: function() {
|
||||
numberOfStudies() {
|
||||
return WorklistStudies.find().count();
|
||||
},
|
||||
|
||||
showLoadingText: function() {
|
||||
showLoadingText() {
|
||||
return Session.get('searchResults').showLoadingText;
|
||||
},
|
||||
|
||||
showNotFoundMessage: function() {
|
||||
showNotFoundMessage() {
|
||||
return Session.get('searchResults').showNotFoundMessage;
|
||||
},
|
||||
|
||||
sortingColumnsIcons: function() {
|
||||
var sortingColumnsIcons = {};
|
||||
Object.keys(Template.instance().sortingColumns.keys).forEach(function(key) {
|
||||
var value = Template.instance().sortingColumns.get(key);
|
||||
sortingColumnsIcons() {
|
||||
const instance = Template.instance();
|
||||
|
||||
let sortingColumnsIcons = {};
|
||||
Object.keys(instance.sortingColumns.keys).forEach(key => {
|
||||
const value = instance.sortingColumns.get(key);
|
||||
|
||||
if (value === 1) {
|
||||
sortingColumnsIcons[key] = 'fa fa-fw fa-sort-up';
|
||||
@@ -102,10 +104,10 @@ function replaceUndefinedColumnValue(text) {
|
||||
* Convert string to study date
|
||||
*/
|
||||
function convertStringToStudyDate(dateStr) {
|
||||
var y = dateStr.substring(0, 4);
|
||||
var m = dateStr.substring(4, 6);
|
||||
var d = dateStr.substring(6, 8);
|
||||
var newDateStr = m + '/' + d + '/' + y;
|
||||
const y = dateStr.substring(0, 4);
|
||||
const m = dateStr.substring(4, 6);
|
||||
const d = dateStr.substring(6, 8);
|
||||
const newDateStr = m + '/' + d + '/' + y;
|
||||
return new Date(newDateStr);
|
||||
}
|
||||
|
||||
@@ -115,7 +117,7 @@ function convertStringToStudyDate(dateStr) {
|
||||
*/
|
||||
function search() {
|
||||
// Show loading message
|
||||
var searchResults = Session.get('searchResults');
|
||||
let searchResults = Session.get('searchResults');
|
||||
searchResults.showLoadingText = true;
|
||||
searchResults.showNotFoundMessage = false;
|
||||
Session.set('searchResults', searchResults);
|
||||
@@ -130,12 +132,12 @@ function search() {
|
||||
|
||||
// Make sure that modality has a reasonable value, since it is occasionally
|
||||
// returned as 'undefined'
|
||||
var modality = replaceUndefinedColumnValue($('input#modality').val());
|
||||
const modality = replaceUndefinedColumnValue($('input#modality').val());
|
||||
|
||||
// Clear all current studies
|
||||
WorklistStudies.remove({});
|
||||
|
||||
Meteor.call('WorklistSearch', filter, function(error, studies) {
|
||||
Meteor.call('WorklistSearch', filter, (error, studies) => {
|
||||
if (error) {
|
||||
log.warn(error);
|
||||
return;
|
||||
@@ -150,7 +152,7 @@ function search() {
|
||||
}
|
||||
|
||||
// Loop through all identified studies
|
||||
studies.forEach(function(study) {
|
||||
studies.forEach(study => {
|
||||
// Search the rest of the parameters that aren't done via the server call
|
||||
if (isIndexOf(study.modalities, modality) &&
|
||||
(new Date(studyDateFrom).setHours(0, 0, 0, 0) <= convertStringToStudyDate(study.studyDate) || !studyDateFrom || studyDateFrom === '') &&
|
||||
@@ -173,36 +175,38 @@ function search() {
|
||||
});
|
||||
}
|
||||
|
||||
Template.worklistResult.onCreated(function() {
|
||||
this.sortOption = new ReactiveVar();
|
||||
this.sortingColumns = new ReactiveDict();
|
||||
Template.worklistResult.onCreated(() => {
|
||||
let instance = Template.instance();
|
||||
instance.sortOption = new ReactiveVar();
|
||||
instance.sortingColumns = new ReactiveDict();
|
||||
|
||||
// Retrieve all studies
|
||||
search();
|
||||
|
||||
// Set sortOption
|
||||
var sortOptionSession = Session.get('sortOption');
|
||||
const sortOptionSession = Session.get('sortOption');
|
||||
if (sortOptionSession) {
|
||||
this.sortingColumns.set(sortOptionSession);
|
||||
instance.sortingColumns.set(sortOptionSession);
|
||||
} else {
|
||||
this.sortingColumns.set('patientName', 1);
|
||||
this.sortingColumns.set('studyDate', 1);
|
||||
this.sortingColumns.set('patientId', 0);
|
||||
this.sortingColumns.set('accessionNumber', 0);
|
||||
this.sortingColumns.set('studyDescription', 0);
|
||||
this.sortingColumns.set('modality', 0);
|
||||
this.sortingColumns.set('numberOfStudyRelatedInstances', 0);
|
||||
instance.sortingColumns.set({
|
||||
patientName: 1,
|
||||
studyDate: 1,
|
||||
patientId: 0,
|
||||
accessionNumber: 0,
|
||||
studyDescription: 0,
|
||||
modality: 0,
|
||||
numberOfStudyRelatedInstances: 0
|
||||
});
|
||||
}
|
||||
|
||||
var self = this;
|
||||
if (Worklist.subscriptions) {
|
||||
Worklist.subscriptions.forEach(function(collectionName) {
|
||||
self.subscribe(collectionName);
|
||||
Worklist.subscriptions.forEach(collectionName => {
|
||||
instance.subscribe(collectionName);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Template.worklistResult.onRendered(function() {
|
||||
Template.worklistResult.onRendered(() => {
|
||||
const instance = Template.instance();
|
||||
|
||||
// Initialize daterangepicker
|
||||
@@ -215,29 +219,33 @@ Template.worklistResult.onRendered(function() {
|
||||
});
|
||||
});
|
||||
|
||||
function resetSortingColumns(template, sortingColumn) {
|
||||
Object.keys(template.sortingColumns.keys).forEach(function(key) {
|
||||
function resetSortingColumns(instance, sortingColumn) {
|
||||
Object.keys(instance.sortingColumns.keys).forEach(key => {
|
||||
if (key !== sortingColumn) {
|
||||
template.sortingColumns.set(key, null);
|
||||
instance.sortingColumns.set(key, null);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Template.worklistResult.events({
|
||||
'keydown input': function(e) {
|
||||
if (e.which === 13) { // Enter
|
||||
'keydown input'(event) {
|
||||
if (event.which === 13) { // Enter
|
||||
search();
|
||||
}
|
||||
},
|
||||
'onsearch input': function() {
|
||||
|
||||
'onsearch input'() {
|
||||
search();
|
||||
},
|
||||
'change #studyDate': function(e, template) {
|
||||
var dateRange = $(e.currentTarget).val();
|
||||
|
||||
'change #studyDate'(event) {
|
||||
let dateRange = $(event.currentTarget).val();
|
||||
|
||||
// Remove all space chars
|
||||
dateRange = dateRange.replace(/ /g, '');
|
||||
|
||||
// Split dateRange into subdates
|
||||
var dates = dateRange.split('-');
|
||||
const dates = dateRange.split('-');
|
||||
studyDateFrom = dates[0];
|
||||
studyDateTo = dates[1];
|
||||
|
||||
@@ -245,23 +253,26 @@ Template.worklistResult.events({
|
||||
search();
|
||||
}
|
||||
},
|
||||
'click div.sortingCell': function(e, template) {
|
||||
var elementId = e.currentTarget.id;
|
||||
// Remove _ from id
|
||||
var columnName = elementId.replace('_', '');
|
||||
|
||||
var sortOption = {};
|
||||
resetSortingColumns(template, columnName);
|
||||
var columnObject = template.sortingColumns.get(columnName);
|
||||
'click div.sortingCell'(event, instance) {
|
||||
const elementId = event.currentTarget.id;
|
||||
|
||||
// Remove _ from id
|
||||
const columnName = elementId.replace('_', '');
|
||||
|
||||
let sortOption = {};
|
||||
resetSortingColumns(instance, columnName);
|
||||
|
||||
const columnObject = instance.sortingColumns.get(columnName);
|
||||
if (columnObject) {
|
||||
template.sortingColumns.set(columnName, columnObject * -1);
|
||||
instance.sortingColumns.set(columnName, columnObject * -1);
|
||||
sortOption[columnName] = columnObject * -1;
|
||||
} else {
|
||||
template.sortingColumns.set(columnName, 1);
|
||||
instance.sortingColumns.set(columnName, 1);
|
||||
sortOption[columnName] = 1;
|
||||
}
|
||||
|
||||
template.sortOption.set(sortOption);
|
||||
instance.sortOption.set(sortOption);
|
||||
Session.set('sortOption', sortOption);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
Template.worklistToolbar.onCreated(() => {
|
||||
Meteor.call('importSupported', function(error, result) {
|
||||
Meteor.call('importSupported', (error, result) => {
|
||||
if (error || !result) {
|
||||
Session.set('importSupported', false);
|
||||
} else {
|
||||
|
||||
@@ -50,7 +50,6 @@ switchToTab = function(contentId) {
|
||||
}
|
||||
|
||||
var studies = ViewerData[contentId].studies;
|
||||
|
||||
if (studies) {
|
||||
// ViewerData already has the meta data (in cases when worklist is launched externally)
|
||||
viewStudiesInTab(contentId, studies);
|
||||
|
||||
Reference in new issue
Block a user