Removing contextMenu templates and title from tabs
This commit is contained in:
1 parent
485f82f64c
commit
0cf4dbf13f
16 files changed
+27
-77
No files matched your search
@@ -92,7 +92,7 @@ Template.viewer.onCreated(() => {
|
|||||||
OHIF.log.info('Setting default ViewerData');
|
OHIF.log.info('Setting default ViewerData');
|
||||||
OHIF.viewer.loadedSeriesData = {};
|
OHIF.viewer.loadedSeriesData = {};
|
||||||
ViewerData[contentId].loadedSeriesData = {};
|
ViewerData[contentId].loadedSeriesData = {};
|
||||||
Session.set('ViewerData', ViewerData);
|
Session.setPersistent('ViewerData', ViewerData);
|
||||||
}
|
}
|
||||||
|
|
||||||
Session.set('activeViewport', ViewerData[contentId].activeViewport || false);
|
Session.set('activeViewport', ViewerData[contentId].activeViewport || false);
|
||||||
|
|||||||
@@ -15,9 +15,7 @@ Router.configure({
|
|||||||
|
|
||||||
Router.onBeforeAction('loading');
|
Router.onBeforeAction('loading');
|
||||||
|
|
||||||
const data = {
|
const data = {};
|
||||||
additionalTemplates: []
|
|
||||||
};
|
|
||||||
|
|
||||||
const routerOptions = { data };
|
const routerOptions = { data };
|
||||||
|
|
||||||
@@ -29,7 +27,7 @@ Router.route('/', function() {
|
|||||||
} else {
|
} else {
|
||||||
const contentId = Session.get('activeContentId');
|
const contentId = Session.get('activeContentId');
|
||||||
if (!contentId) {
|
if (!contentId) {
|
||||||
Session.set('activeContentId', 'studylistTab');
|
Session.setPersistent('activeContentId', 'studylistTab');
|
||||||
}
|
}
|
||||||
|
|
||||||
this.render('app', routerOptions);
|
this.render('app', routerOptions);
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
<title>OHIF Viewer</title>
|
<title>OHIF Viewer</title>
|
||||||
<meta name="description" content="Open Health Imaging Foundation DICOM Viewer">
|
<meta name="description" content="Open Health Imaging Foundation DICOM Viewer">
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1,maximum-scale=1,user-scalable=no">
|
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1,maximum-scale=1,user-scalable=no">
|
||||||
|
<link rel="shortcut icon" type="image/png" href="/images/logo.png" sizes="16x16 32x32 64x64">
|
||||||
<!--Best display for mobile devices-->
|
<!--Best display for mobile devices-->
|
||||||
<meta http-equiv="cleartype" content="on">
|
<meta http-equiv="cleartype" content="on">
|
||||||
<meta name="MobileOptimized" content="320">
|
<meta name="MobileOptimized" content="320">
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
@@ -7,7 +7,7 @@ import { OHIF } from 'meteor/ohif:core';
|
|||||||
* @param timepointId The UID of the Timepoint to be opened
|
* @param timepointId The UID of the Timepoint to be opened
|
||||||
* @param title The title to be used for the tab heading
|
* @param title The title to be used for the tab heading
|
||||||
*/
|
*/
|
||||||
OHIF.lesiontracker.openNewTabWithTimepoint = (timepointId, title) => {
|
OHIF.lesiontracker.openNewTabWithTimepoint = timepointId => {
|
||||||
const contentId = 'viewerTab';
|
const contentId = 'viewerTab';
|
||||||
|
|
||||||
const Timepoints = StudyList.timepointApi.timepoints;
|
const Timepoints = StudyList.timepointApi.timepoints;
|
||||||
@@ -29,7 +29,6 @@ OHIF.lesiontracker.openNewTabWithTimepoint = (timepointId, title) => {
|
|||||||
|
|
||||||
// Update the ViewerData global object
|
// Update the ViewerData global object
|
||||||
ViewerData[contentId] = {
|
ViewerData[contentId] = {
|
||||||
title: title,
|
|
||||||
contentId: contentId,
|
contentId: contentId,
|
||||||
studyInstanceUids: data.studyInstanceUids,
|
studyInstanceUids: data.studyInstanceUids,
|
||||||
timepointIds: data.timepointIds,
|
timepointIds: data.timepointIds,
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
|
import { Meteor } from 'meteor/meteor';
|
||||||
import { OHIF } from 'meteor/ohif:core';
|
import { OHIF } from 'meteor/ohif:core';
|
||||||
import { Viewerbase } from 'meteor/ohif:viewerbase';
|
|
||||||
|
|
||||||
Meteor.startup(function() {
|
Meteor.startup(function() {
|
||||||
StudyList.callbacks['dblClickOnStudy'] = dblClickOnStudy;
|
StudyList.callbacks.dblClickOnStudy = dblClickOnStudy;
|
||||||
StudyList.callbacks['middleClickOnStudy'] = dblClickOnStudy;
|
StudyList.callbacks.middleClickOnStudy = dblClickOnStudy;
|
||||||
|
|
||||||
StudyList.timepointApi = new OHIF.measurements.TimepointApi();
|
StudyList.timepointApi = new OHIF.measurements.TimepointApi();
|
||||||
StudyList.timepointApi.retrieveTimepoints();
|
StudyList.timepointApi.retrieveTimepoints();
|
||||||
@@ -12,28 +12,21 @@ Meteor.startup(function() {
|
|||||||
/**
|
/**
|
||||||
* Lesion Tracker method including Timepoints / other studies
|
* Lesion Tracker method including Timepoints / other studies
|
||||||
*/
|
*/
|
||||||
function dblClickOnStudy(data) {
|
const dblClickOnStudy = data => {
|
||||||
// Use the formatPN template helper to clean up the patient name
|
|
||||||
let title = Viewerbase.helpers.formatPN(data.patientName);
|
|
||||||
|
|
||||||
const instance = Template.instance();
|
|
||||||
|
|
||||||
// Find the relevant timepoint given the clicked-on study
|
// Find the relevant timepoint given the clicked-on study
|
||||||
const timepointApi = StudyList.timepointApi;
|
const timepointApi = StudyList.timepointApi;
|
||||||
if (!timepointApi) {
|
if (!timepointApi) {
|
||||||
console.log('No timepoint api on dbl-clicked study?');
|
OHIF.log.warn('No timepoint api on dbl-clicked study?');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const timepoint = timepointApi.study(data.studyInstanceUid)[0];
|
const timepoint = timepointApi.study(data.studyInstanceUid)[0];
|
||||||
if (timepoint) {
|
if (timepoint) {
|
||||||
// Add the Timepoint name to the Patient name to create the tab title
|
OHIF.lesiontracker.openNewTabWithTimepoint(timepoint.timepointId);
|
||||||
title += ' ' + timepointApi.name(timepoint);
|
|
||||||
OHIF.lesiontracker.openNewTabWithTimepoint(timepoint.timepointId, title);
|
|
||||||
} else {
|
} else {
|
||||||
open(data.studyInstanceUid, title);
|
openTab(data.studyInstanceUid);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Opens a study
|
* Opens a study
|
||||||
@@ -41,14 +34,13 @@ function dblClickOnStudy(data) {
|
|||||||
* @param studyInstanceUid The UID of the Study to be opened
|
* @param studyInstanceUid The UID of the Study to be opened
|
||||||
* @param title The title to be used for the tab heading
|
* @param title The title to be used for the tab heading
|
||||||
*/
|
*/
|
||||||
function open(studyInstanceUid, title) {
|
const openTab = studyInstanceUid => {
|
||||||
const contentId = 'viewerTab';
|
const contentId = 'viewerTab';
|
||||||
|
|
||||||
ViewerData = window.ViewerData || ViewerData;
|
ViewerData = window.ViewerData || ViewerData;
|
||||||
|
|
||||||
// Update the ViewerData global object
|
// Update the ViewerData global object
|
||||||
ViewerData[contentId] = {
|
ViewerData[contentId] = {
|
||||||
title: title,
|
|
||||||
contentId: contentId,
|
contentId: contentId,
|
||||||
isUnassociatedStudy: true,
|
isUnassociatedStudy: true,
|
||||||
studyInstanceUids: [studyInstanceUid]
|
studyInstanceUids: [studyInstanceUid]
|
||||||
@@ -56,4 +48,4 @@ function open(studyInstanceUid, title) {
|
|||||||
|
|
||||||
// Switch to the new tab
|
// Switch to the new tab
|
||||||
switchToTab(contentId);
|
switchToTab(contentId);
|
||||||
}
|
};
|
||||||
@@ -43,7 +43,6 @@ const viewStudies = () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const title = selectedStudies[0].patientName;
|
|
||||||
const studyInstanceUids = selectedStudies.map(study => study.studyInstanceUid);
|
const studyInstanceUids = selectedStudies.map(study => study.studyInstanceUid);
|
||||||
const contentId = 'viewerTab';
|
const contentId = 'viewerTab';
|
||||||
|
|
||||||
@@ -51,7 +50,6 @@ const viewStudies = () => {
|
|||||||
|
|
||||||
// Update the ViewerData global object
|
// Update the ViewerData global object
|
||||||
ViewerData[contentId] = {
|
ViewerData[contentId] = {
|
||||||
title: title,
|
|
||||||
contentId: contentId,
|
contentId: contentId,
|
||||||
studyInstanceUids: studyInstanceUids
|
studyInstanceUids: studyInstanceUids
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
import './studyContextMenu.html';
|
|
||||||
import './studyContextMenu.js';
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
<template name="studyContextMenu">
|
|
||||||
{{#dropdownForm}}
|
|
||||||
<li><a id="viewSeriesDetails" type="button"
|
|
||||||
title="View Series Details"
|
|
||||||
>View Series Details</a></li>
|
|
||||||
<li class="disabled"><a class="disabled">Anonymize</a></li>
|
|
||||||
<li class="disabled"><a class="disabled">Send</a></li>
|
|
||||||
<li class="divider" role="separator"></li>
|
|
||||||
<li class="disabled"><a class="disabled">Delete</a></li>
|
|
||||||
<li><a id="exportSelectedStudies" title="Export Selected Studies">Export</a></li>
|
|
||||||
{{/dropdownForm}}
|
|
||||||
</template>
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
import { Meteor } from 'meteor/meteor';
|
|
||||||
import { OHIF } from 'meteor/ohif:core';
|
|
||||||
|
|
||||||
Meteor.startup(() => {
|
|
||||||
OHIF.studylist.dropdown.setItems([{
|
|
||||||
action: OHIF.studylist.viewSeriesDetails,
|
|
||||||
text: 'View Series Details'
|
|
||||||
}, {
|
|
||||||
text: 'Anonymize',
|
|
||||||
disabled: true
|
|
||||||
}, {
|
|
||||||
text: 'Send',
|
|
||||||
disabled: true,
|
|
||||||
separatorAfter: true
|
|
||||||
}, {
|
|
||||||
text: 'Delete',
|
|
||||||
disabled: true
|
|
||||||
}, {
|
|
||||||
action: OHIF.studylist.exportSelectedStudies,
|
|
||||||
text: 'Export',
|
|
||||||
title: 'Export Selected Studies'
|
|
||||||
}]);
|
|
||||||
});
|
|
||||||
@@ -10,7 +10,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{#each templateName in additionalTemplates}}
|
|
||||||
{{>Template.dynamic template=templateName}}
|
|
||||||
{{/each}}
|
|
||||||
</template>
|
</template>
|
||||||
@@ -31,7 +31,7 @@ Template.studylist.onRendered(() => {
|
|||||||
const instance = Template.instance();
|
const instance = Template.instance();
|
||||||
if (instance.data && instance.data.studyInstanceUid) {
|
if (instance.data && instance.data.studyInstanceUid) {
|
||||||
const studyInstanceUid = instance.data.studyInstanceUid;
|
const studyInstanceUid = instance.data.studyInstanceUid;
|
||||||
openNewTab(studyInstanceUid, studyInstanceUid);
|
openNewTab(studyInstanceUid);
|
||||||
} else {
|
} else {
|
||||||
// If there is a tab set as active in the Session,
|
// If there is a tab set as active in the Session,
|
||||||
// switch to that now.
|
// switch to that now.
|
||||||
|
|||||||
@@ -1,22 +1,23 @@
|
|||||||
|
import { Random } from 'meteor/random';
|
||||||
|
import { OHIF } from 'meteor/ohif:core';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Opens a new tab in the tabbed studylist environment using
|
* Opens a new tab in the tabbed studylist environment using
|
||||||
* a given study and new tab title.
|
* a given study and new tab title.
|
||||||
*
|
*
|
||||||
* @param studyInstanceUid The UID of the Study to be opened
|
* @param studyInstanceUid The UID of the Study to be opened
|
||||||
* @param title The title to be used for the tab heading
|
|
||||||
*/
|
*/
|
||||||
openNewTab = function(studyInstanceUid, title) {
|
const openNewTab = studyInstanceUid => {
|
||||||
console.log('openNewTab');
|
OHIF.log.info('openNewTab');
|
||||||
|
|
||||||
// Generate a unique ID to represent this tab
|
// Generate a unique ID to represent this tab
|
||||||
// We can't just use the Mongo entry ID because
|
// We can't just use the Mongo entry ID because
|
||||||
// then it will change after hot-reloading.
|
// then it will change after hot-reloading.
|
||||||
var contentId = Random.id();
|
const contentId = Random.id();
|
||||||
|
|
||||||
// Update the ViewerData global object
|
// Update the ViewerData global object
|
||||||
ViewerData = window.ViewerData || ViewerData;
|
ViewerData = window.ViewerData || ViewerData;
|
||||||
ViewerData[contentId] = {
|
ViewerData[contentId] = {
|
||||||
title: title,
|
|
||||||
contentId: contentId,
|
contentId: contentId,
|
||||||
studyInstanceUids: [studyInstanceUid]
|
studyInstanceUids: [studyInstanceUid]
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -22,9 +22,7 @@ StudyList.callbacks.dblClickOnStudy = dblClickOnStudy;
|
|||||||
StudyList.callbacks.middleClickOnStudy = dblClickOnStudy;
|
StudyList.callbacks.middleClickOnStudy = dblClickOnStudy;
|
||||||
|
|
||||||
function dblClickOnStudy(data) {
|
function dblClickOnStudy(data) {
|
||||||
// Use the formatPN template helper to clean up the patient name
|
openNewTab(data.studyInstanceUid);
|
||||||
var title = Viewerbase.helpers.formatPN(data.patientName);
|
|
||||||
openNewTab(data.studyInstanceUid, title);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let currentServerChangeHandlerFirstRun = true;
|
let currentServerChangeHandlerFirstRun = true;
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ import { Meteor } from 'meteor/meteor';
|
|||||||
import { OHIF } from 'meteor/ohif:core';
|
import { OHIF } from 'meteor/ohif:core';
|
||||||
|
|
||||||
OHIF.user.getName = () => {
|
OHIF.user.getName = () => {
|
||||||
|
const user = Meteor.user();
|
||||||
|
if (!user) return '';
|
||||||
const nameSplit = Meteor.user().profile.fullName.split(' ');
|
const nameSplit = Meteor.user().profile.fullName.split(' ');
|
||||||
const lastName = nameSplit[nameSplit.length - 1];
|
const lastName = nameSplit[nameSplit.length - 1];
|
||||||
nameSplit[nameSplit.length - 1] = lastName.substr(0, 1) + '.';
|
nameSplit[nameSplit.length - 1] = lastName.substr(0, 1) + '.';
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ Package.onUse(function(api) {
|
|||||||
api.use('stylus');
|
api.use('stylus');
|
||||||
api.use('momentjs:moment');
|
api.use('momentjs:moment');
|
||||||
api.use('validatejs');
|
api.use('validatejs');
|
||||||
|
api.use('u2622:persistent-session');
|
||||||
|
|
||||||
// Our custom packages
|
// Our custom packages
|
||||||
api.use('ohif:design');
|
api.use('ohif:design');
|
||||||
|
|||||||
Reference in new issue
Block a user