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:
1 parent
c511edd419
commit
ab4d4c9008
537 files changed
+5122
-3545
No files matched your search
+24
@@ -0,0 +1,24 @@
|
||||
<template name="measurementTableHeaderRow">
|
||||
<div class="measurementTableHeaderRow">
|
||||
{{ #if anyUnmarkedLesionsLeft}}
|
||||
<div class="add js-setTool">
|
||||
<svg>
|
||||
<use xlink:href=/packages/ohif_viewerbase/assets/icons.svg#icon-ui-add></use>
|
||||
</svg>
|
||||
</div>
|
||||
{{ /if }}
|
||||
<div class="type">
|
||||
{{measurementType.name}}
|
||||
</div>
|
||||
<div class="max {{ # if gt numberOfMeasurements maxNumMeasurements }}warning{{/if}}">
|
||||
{{ #if maxNumMeasurements }}
|
||||
<p class="maxNumMeasurements">
|
||||
Max {{maxNumMeasurements}}
|
||||
</p>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="numberOfMeasurements">
|
||||
{{numberOfMeasurements}}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
Template.measurementTableHeaderRow.onCreated(() => {
|
||||
const instance = Template.instance();
|
||||
instance.maxNumMeasurements = new ReactiveVar();
|
||||
|
||||
if (!instance.data.timepointApi) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the current timepoint
|
||||
const current = instance.data.timepointApi.current();
|
||||
|
||||
// Stop here if no timepoint was found
|
||||
if (!current) {
|
||||
console.warn('No current timepoint found?');
|
||||
return;
|
||||
}
|
||||
|
||||
const timepointType = current.timepointType;
|
||||
|
||||
// TODO: Check if we have criteria where maximum limits are applied to
|
||||
// Non-Targets and/or New Lesions
|
||||
if (timepointType === 'baseline' && instance.data.id === 'target') {
|
||||
instance.autorun(() => {
|
||||
// Identify which Trial Conformance Criteria are currently being used
|
||||
// Note that there may be more than one.
|
||||
const criteriaTypes = TrialCriteriaTypes.find({
|
||||
selected: true
|
||||
}).map(function(criteria) {
|
||||
return criteria.id;
|
||||
});
|
||||
|
||||
const currentConstraints = getTrialCriteriaConstraints(criteriaTypes);
|
||||
if (!currentConstraints) {
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: Fix Trial Conformance Criteria, it appears that totalNumberOfLesions
|
||||
// is applied to both Targets and Non-Targets, when it should typically only be
|
||||
// for Targets
|
||||
const criteria = currentConstraints[timepointType];
|
||||
const maxNumMeasurements = criteria.group.totalNumberOfLesions.numericality.lessThanOrEqualTo;
|
||||
instance.maxNumMeasurements.set(maxNumMeasurements);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Template.measurementTableHeaderRow.helpers({
|
||||
numberOfMeasurements() {
|
||||
return Template.instance().data.measurements.length;
|
||||
},
|
||||
|
||||
maxNumMeasurements() {
|
||||
return Template.instance().maxNumMeasurements.get();
|
||||
},
|
||||
|
||||
anyUnmarkedLesionsLeft() {
|
||||
const instance = Template.instance();
|
||||
const measurementType = instance.data.measurementType;
|
||||
const measurementApi = instance.data.measurementApi;
|
||||
|
||||
// TODO: Add selector to check if there are unmarked lesions
|
||||
//return measurementApi.fetch(measurementType.id).length;
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
Template.measurementTableHeaderRow.events({
|
||||
'click .js-setTool'(event, instance) {
|
||||
const measurementType = instance.data.measurementType;
|
||||
toolManager.setActiveTool(measurementType.cornerstoneToolType);
|
||||
}
|
||||
});
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
@import "{design}/app"
|
||||
|
||||
$headerRowHeight = 63px
|
||||
|
||||
.measurementTableHeaderRow
|
||||
theme('background-color', '$uiGrayDarker')
|
||||
theme('color', '$textSecondaryColor')
|
||||
display: flex
|
||||
theme('fill', '$textSecondaryColor')
|
||||
height: $headerRowHeight
|
||||
line-height: $headerRowHeight
|
||||
margin-top: 2px
|
||||
width: 100%
|
||||
|
||||
&.inactive .add
|
||||
cursor: not-allowed
|
||||
|
||||
svg
|
||||
fill: #5A666D
|
||||
|
||||
div
|
||||
align-items: stretch
|
||||
flex: 1
|
||||
justify-content: space-around
|
||||
text-align: center
|
||||
|
||||
.add
|
||||
cursor: pointer
|
||||
max-width: 30px
|
||||
padding-left: 2px
|
||||
|
||||
svg
|
||||
fill: #C1D8E3
|
||||
height: $headerRowHeight
|
||||
max-width: 11px
|
||||
|
||||
&:hover
|
||||
theme('fill', '$hoverColor')
|
||||
|
||||
&:active
|
||||
theme('fill', '$activeColor')
|
||||
|
||||
.type
|
||||
theme('color', '$textSecondaryColor')
|
||||
font-size: 22px
|
||||
font-weight: 300
|
||||
line-height: $headerRowHeight
|
||||
padding: 0 10px
|
||||
text-align: left
|
||||
|
||||
.numberOfMeasurements
|
||||
theme('color', '$uiSkyBlue')
|
||||
float: right
|
||||
font-weight: 300
|
||||
font-size: 40px
|
||||
max-width: 54px
|
||||
height: $headerRowHeight
|
||||
line-height: 66px
|
||||
|
||||
.max
|
||||
height: $headerRowHeight
|
||||
max-width: 64px
|
||||
text-align: right
|
||||
|
||||
.maxNumMeasurements
|
||||
theme('background-color', '$textSecondaryColor')
|
||||
border-radius: 3px
|
||||
color: black
|
||||
display: table
|
||||
font-size: 12px
|
||||
font-weight: 500
|
||||
height: 19px
|
||||
line-height: 17px
|
||||
margin-left: auto
|
||||
margin-top: 22px
|
||||
padding: 2px 6px 0
|
||||
text-transform: uppercase
|
||||
transition($sidebarTransition)
|
||||
|
||||
&.warning
|
||||
.maxNumMeasurements
|
||||
theme('background-color', '$uiYellow')
|
||||
theme('color', '$textPrimaryColor')
|
||||
Reference in new issue
Block a user