Work on refactoring measurements out of Lesion Tracker package

- Removed AssociatedStudies Collection
- Measurement API is generated from configuration files
- Data exchange methods are defined in configuration
This commit is contained in:
Erik Ziegler committed 2016-11-15 08:21:46 +01:00
1 parent c511edd419
commit ab4d4c9008
537 files changed
+5122 -3545

No files matched your search

@@ -0,0 +1,41 @@
<template name="toolbarSection">
<div class="toolbarSection noselect p-x-2">
<div class="clearfix">
<div class="pull-left m-t-1">
{{>roundedButtonGroup leftSidebarToggleButtonData}}
</div>
{{>toolbarSectionTools toolbarButtons=toolbarButtons extraToolbarButtons=extraToolbarButtons}}
{{#if splitView}}
{{>studySeriesQuickSwitch (clone this side="right" viewportIndex=1)}}
{{>studySeriesQuickSwitch (clone this side="left" viewportIndex=0)}}
{{else}}
{{>studySeriesQuickSwitch (clone this side="middle" viewportIndex=0)}}
{{/if}}
<div class="toolbarSectionEntry pull-right rm-l-1 p-x-1">
{{>caseProgress}}
</div>
<div class="pull-right m-t-1 rm-x-1">
{{>roundedButtonGroup rightSidebarToggleButtonData}}
</div>
<div id="toggleHUD" class="toolbarSectionButton pull-right rp-x-1 m-t-1 rm-r-3 {{#if session 'measurementTableHudOpen'}}active{{/if}}">
<div class="svgContainer">
<svg>
<use xlink:href="/packages/ohif_viewerbase/assets/icons.svg#icon-hud"></use>
</svg>
</div>
<div class="buttonLabel">HUD</div>
</div>
<div class="toolbarSectionButton pull-right rp-x-1 m-t-1 rm-r-1" data-toggle="modal" data-target="#optionsModal">
<div class="svgContainer">
<svg>
<use xlink:href="/packages/ohif_viewerbase/assets/icons.svg#icon-trial-info"></use>
</svg>
</div>
<div class="buttonLabel">Trial</div>
</div>
</div>
</div>
</template>
@@ -0,0 +1,169 @@
import { OHIF } from 'meteor/ohif:core';
Template.toolbarSection.helpers({
// Returns true if the view shall be split in two viewports
splitView() {
// Run this computation every time the viewports are updated
Session.get('LayoutManagerUpdated');
// Stops here if layout manager is not defined yet
if (!window.layoutManager) {
return;
}
return window.layoutManager.viewportData.length > 1;
},
leftSidebarToggleButtonData() {
const instance = Template.instance();
return {
toggleable: true,
key: 'leftSidebar',
value: instance.data.state,
options: [{
value: 'studies',
svgLink: '/packages/ohif_viewerbase/assets/icons.svg#icon-studies',
svgWidth: 15,
svgHeight: 13,
bottomLabel: 'Studies'
}]
};
},
rightSidebarToggleButtonData() {
const instance = Template.instance();
return {
toggleable: true,
key: 'rightSidebar',
value: instance.data.state,
options: [{
value: 'measurements',
svgLink: '/packages/ohif_viewerbase/assets/icons.svg#icon-measurements-lesions',
svgWidth: 18,
svgHeight: 10,
bottomLabel: 'Measurements'
}]
};
},
toolbarButtons() {
// Check if the measure tools shall be disabled
const isToolDisabled = false; //!Template.instance().data.timepointApi;
const buttonData = [];
buttonData.push({
id: 'zoom',
title: 'Zoom',
classes: 'imageViewerTool',
svgLink: '/packages/ohif_viewerbase/assets/icons.svg#icon-tools-zoom'
});
buttonData.push({
id: 'wwwc',
title: 'Levels',
classes: 'imageViewerTool',
svgLink: '/packages/ohif_viewerbase/assets/icons.svg#icon-tools-levels'
});
buttonData.push({
id: 'pan',
title: 'Pan',
classes: 'imageViewerTool',
svgLink: '/packages/ohif_viewerbase/assets/icons.svg#icon-tools-pan'
});
/*
TODO: design the link functionality
Commenting this out until we build this tool
buttonData.push({
id: 'link',
title: 'Link',
classes: 'imageViewerCommand toolbarSectionButton',
svgLink: '/packages/ohif_viewerbase/assets/icons.svg#icon-tools-link'
});*/
buttonData.push({
id: 'bidirectional',
title: 'Target',
classes: 'imageViewerTool rm-l-3',
svgLink: '/packages/ohif_viewerbase/assets/icons.svg#icon-tools-measure-target',
disabled: isToolDisabled
});
buttonData.push({
id: 'nonTarget',
title: 'Non-Target',
classes: 'imageViewerTool toolbarSectionButton',
svgLink: '/packages/ohif_viewerbase/assets/icons.svg#icon-tools-measure-non-target',
disabled: isToolDisabled
});
buttonData.push({
id: 'length',
title: 'Temp',
classes: 'imageViewerTool toolbarSectionButton',
svgLink: '/packages/ohif_viewerbase/assets/icons.svg#icon-tools-measure-temp'
});
return buttonData;
},
extraToolbarButtons() {
// Check if the measure tools shall be disabled
const isToolDisabled = false; //!Template.instance().data.timepointApi.currentTimepointId;
const buttonData = [];
// TODO: Get real icons for CR / UN / EX
buttonData.push({
id: 'crTool',
title: 'CR Tool',
classes: 'imageViewerTool toolbarSectionButton',
svgLink: '/packages/ohif_viewerbase/assets/icons.svg#icon-tools-measure-temp',
disabled: isToolDisabled
});
buttonData.push({
id: 'unTool',
title: 'UN Tool',
classes: 'imageViewerTool toolbarSectionButton',
svgLink: '/packages/ohif_viewerbase/assets/icons.svg#icon-tools-measure-temp',
disabled: isToolDisabled
});
buttonData.push({
id: 'exTool',
title: 'EX Tool',
classes: 'imageViewerTool toolbarSectionButton',
svgLink: '/packages/ohif_viewerbase/assets/icons.svg#icon-tools-measure-temp',
disabled: isToolDisabled
});
return buttonData;
}
});
Template.toolbarSection.events({
'click #toggleHUD'() {
const state = Session.get('measurementTableHudOpen');
Session.set('measurementTableHudOpen', !state);
}
});
Template.toolbarSection.onRendered(function() {
// Set disabled/enabled tool buttons that are set in toolManager
const states = toolManager.getToolDefaultStates();
const disabledToolButtons = states.disabledToolButtons;
const allToolbarButtons = $('#toolbar').find('button');
if (disabledToolButtons && disabledToolButtons.length > 0) {
for (var i = 0; i < allToolbarButtons.length; i++) {
const toolbarButton = allToolbarButtons[i];
$(toolbarButton).prop('disabled', false);
const index = disabledToolButtons.indexOf($(toolbarButton).attr('id'));
if (index !== -1) {
$(toolbarButton).prop('disabled', true);
}
}
}
});
@@ -0,0 +1,24 @@
@import "{design}/app"
.toolbarSection
theme('border-bottom', '%s solid $uiBorderColor' % $uiBorderThickness)
flex: 0 0 auto
height: $toolbarHeight
overflow: hidden
padding-top: 6px
position: relative
transition(height 300ms ease)
width: 100%
&.expanded
height: $toolbarHeight + $toolbarDrawerHeight
.toolbarSectionEntry
theme('color', '$defaultColor')
cursor: pointer
display: inline-block
theme('fill', '$defaultColor')
margin-top: 3px
min-width: 30px
theme('stroke', '$defaultColor')
text-align: center