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,22 @@
<template name="toolbarSectionButton">
{{#if this.buttonTemplateName}}
{{>UI.dynamic template=this.buttonTemplateName data=this}}
{{else}}
<div id="{{this.id}}"
class="toolbarSectionButton rp-x-1 {{this.classes}} {{activeClass}} {{#if this.disabled}}disabled{{/if}} {{#if this.disableFunction}}{{#if (disableButton)}}disabled{{/if}}{{/if}}"
title="{{this.title}}">
<div class="svgContainer">
{{#if this.svgLink}}
<svg>
<use xlink:href={{this.svgLink}}></use>
</svg>
{{else}}
<i class={{iconClasses}}></i>
{{/if}}
</div>
<div class="buttonLabel">
{{this.title}}
</div>
</div>
{{/if}}
</template>
@@ -0,0 +1,54 @@
import { OHIF } from 'meteor/ohif:core';
Template.toolbarSectionButton.helpers({
activeClass() {
// TODO: Find a way to prevent the 'flash' after a click, but before this helper runs
const instance = Template.instance();
// Check if the current tool is the active one
if (instance.data.id === Session.get('ToolManagerActiveTool')) {
// Return the active class
return 'active';
}
},
disableButton() {
return this.disableFunction();
}
});
Template.toolbarSectionButton.events({
'click .imageViewerTool'(event, instance) {
// Stop here if the tool is disabled
if ($(event.currentTarget).hasClass('disabled')) {
return;
}
const tool = event.currentTarget.id;
const elements = instance.$('.imageViewerViewport');
const activeTool = toolManager.getActiveTool();
if (tool === activeTool) {
const defaultTool = toolManager.getDefaultTool();
log.info('Setting active tool to: ' + defaultTool);
toolManager.setActiveTool(defaultTool, elements);
} else {
log.info('Setting active tool to: ' + tool);
toolManager.setActiveTool(tool, elements);
}
},
'click .imageViewerCommand'(event, instance) {
// Stop here if the tool is disabled
if ($(event.currentTarget).hasClass('disabled')) {
return;
}
const command = event.currentTarget.id;
if (!OHIF.viewer.functionList || !OHIF.viewer.functionList.hasOwnProperty(command)) {
return;
}
const activeViewport = Session.get('activeViewport');
const element = $('.imageViewerViewport').get(activeViewport);
OHIF.viewer.functionList[command](element);
}
});
@@ -0,0 +1,61 @@
@import "{design}/app"
.toolbarSectionButton
display: inline-block
theme('color', '$defaultColor')
theme('fill', '$defaultColor')
theme('stroke', '$defaultColor')
min-width: 30px
cursor: pointer
text-align: center
&.disabled
opacity: 0.5
cursor: not-allowed
&:hover
i,
.buttonLabel
theme('color', '$textSecondaryColor')
.buttonLabel
theme('color', '$textSecondaryColor')
font-size: 12px
font-weight: 500
.svgContainer
margin: 0 auto
text-align: center
i
theme('color', '$textSecondaryColor')
font-size: 18px
line-height: 30px
svg
background-color: transparent
margin: 2px
width: 21px
height: 21px
&:hover
.buttonLabel
theme('color', '$hoverColor')
svg
theme('fill', '$hoverColor')
theme('stroke', '$hoverColor')
i
theme('color', '$hoverColor')
&:active, &.active
.buttonLabel
theme('color', '$activeColor')
svg
theme('fill', '$activeColor')
theme('stroke', '$activeColor')
i
theme('color', '$activeColor')