PWV-15: Creating routing branch
This commit is contained in:
1 parent
e618e32341
commit
efb4ca23b5
24 files changed
+158
-437
No files matched your search
@@ -7,7 +7,3 @@ import './optionsModal/optionsModal.js';
|
||||
|
||||
import './optionsModal/recistDescription/recistDescription.html';
|
||||
import './optionsModal/irRCDescription/irRCDescription.html';
|
||||
|
||||
import './measurementLocationDialog/measurementLocationDialog.html';
|
||||
import './measurementLocationDialog/measurementLocationDialog.js';
|
||||
import './measurementLocationDialog/measurementLocationDialog.styl';
|
||||
-38
@@ -1,38 +0,0 @@
|
||||
<template name="measurementLocationDialog">
|
||||
<div id="measurementLocationDialog" class="dialog-animated" tabindex="0">
|
||||
<div class="dialogHeader">
|
||||
<h4>Select Location</h4>
|
||||
</div>
|
||||
<div class="dialogContent">
|
||||
<div class="measurementLocation">
|
||||
<label>Location</label>
|
||||
<select class="selectMeasurementLocation">
|
||||
<option value="-1"></option>
|
||||
{{ #each measurementLocations}}
|
||||
<option value='{{_id}}'>{{location}}</option>
|
||||
{{ /each}}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="measurementLocationRelabelDialog" class="dialog-animated" tabindex="0">
|
||||
<div class="dialogHeader">
|
||||
<h4>Change Location</h4>
|
||||
</div>
|
||||
<a></a>
|
||||
<div class="dialogContent">
|
||||
<div class="measurementLocation">
|
||||
<label>Location</label>
|
||||
<select class="selectMeasurementLocation">
|
||||
<option value="-1"></option>
|
||||
{{ #each measurementLocations}}
|
||||
<option value='{{_id}}' selected={{selected}}>{{location}}</option>
|
||||
{{ /each}}
|
||||
</select>
|
||||
</div>
|
||||
<button id="removeLesion" class="btn btn-link">Remove</button>
|
||||
<button id="convertToNonTarget" class="btn btn-link">Convert to Non-Target</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
-91
@@ -1,91 +0,0 @@
|
||||
// Note: This component is not in use, but the functions below are still being used. This
|
||||
// is in the process of being moved into another location
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
Template.measurementLocationDialog.onCreated(() => {
|
||||
const instance = Template.instance();
|
||||
const measurementApi = instance.data.measurementApi;
|
||||
|
||||
const toggleLabel = (measurementData, eventData, doneCallback) => {
|
||||
delete measurementData.isCreating;
|
||||
|
||||
if (OHIF.lesiontracker.removeMeasurementIfInvalid(measurementData, eventData)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const getHandlePosition = key => _.pick(measurementData.handles[key], ['x', 'y']);
|
||||
const start = getHandlePosition('start');
|
||||
const end = getHandlePosition('end');
|
||||
const getDirection = axis => start[axis] < end[axis] ? 1 : -1;
|
||||
const position = OHIF.cornerstone.pixelToPage(eventData.element, end);
|
||||
|
||||
OHIF.measurements.toggleLabelButton({
|
||||
instance,
|
||||
measurement: measurementData,
|
||||
element: eventData.element,
|
||||
measurementApi,
|
||||
position: position,
|
||||
direction: {
|
||||
x: getDirection('x'),
|
||||
y: getDirection('y')
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const callbackConfig = {
|
||||
// TODO: Check the position for these, the Add Label button position seems very awkward
|
||||
getMeasurementLocationCallback: toggleLabel,
|
||||
changeMeasurementLocationCallback: toggleLabel,
|
||||
};
|
||||
|
||||
// TODO: Reconcile this with the configuration in toolManager
|
||||
// it would be better to have this all in one place.
|
||||
const bidirectionalConfig = cornerstoneTools.bidirectional.getConfiguration();
|
||||
const config = {
|
||||
...bidirectionalConfig,
|
||||
...callbackConfig
|
||||
};
|
||||
|
||||
cornerstoneTools.bidirectional.setConfiguration(config);
|
||||
|
||||
// Set CR-Tool, UN-Tool, EX-Tool configurations
|
||||
cornerstoneTools.targetCR.setConfiguration(config);
|
||||
cornerstoneTools.targetUN.setConfiguration(config);
|
||||
cornerstoneTools.targetEX.setConfiguration(config);
|
||||
|
||||
});
|
||||
|
||||
// Note: None of these events work anymore
|
||||
Template.measurementLocationDialog.events({
|
||||
'click #removeMeasurement'() {
|
||||
const measurementData = Template.measurementLocationDialog.measurementData;
|
||||
const doneCallback = Template.measurementLocationDialog.doneCallback;
|
||||
const dialog = Template.measurementLocationDialog.dialog;
|
||||
|
||||
const options = {
|
||||
keyPressAllowed: false,
|
||||
title: 'Remove measurement?',
|
||||
text: 'Are you sure you would like to remove the entire measurement?'
|
||||
};
|
||||
|
||||
showConfirmDialog(function() {
|
||||
if (doneCallback && typeof doneCallback === 'function') {
|
||||
const deleteTool = true;
|
||||
doneCallback(measurementData, deleteTool);
|
||||
}
|
||||
}, options);
|
||||
|
||||
closeHandler(dialog);
|
||||
},
|
||||
|
||||
'click #convertToNonTarget'() {
|
||||
const measurementData = Template.measurementLocationDialog.measurementData;
|
||||
const dialog = Template.measurementLocationDialog.dialog;
|
||||
|
||||
const instance = Template.instance();
|
||||
const measurementApi = instance.data.measurementApi;
|
||||
OHIF.measurementTracker.convertToNonTarget(measurementApi, measurementData);
|
||||
|
||||
closeHandler(dialog);
|
||||
}
|
||||
});
|
||||
-35
@@ -1,35 +0,0 @@
|
||||
#measurementLocationDialog, #measurementLocationRelabelDialog
|
||||
display: none
|
||||
position: absolute
|
||||
top: 0
|
||||
bottom: 0
|
||||
left: 0
|
||||
right: 0
|
||||
z-index: 100
|
||||
width: 300px
|
||||
height: 130px
|
||||
border-radius: 5px
|
||||
padding: 10px 20px 10px 20px
|
||||
background-color: rgba(255,255,255,1)
|
||||
outline: none
|
||||
|
||||
#closeLesionPopup
|
||||
outline: none
|
||||
border: none
|
||||
background-color: transparent
|
||||
|
||||
#selectMeasurementLocation
|
||||
margin-top: 5px
|
||||
|
||||
.dialogContent
|
||||
margin-bottom: 10px
|
||||
|
||||
#removeLesion
|
||||
outline: none
|
||||
text-decoration: none
|
||||
|
||||
#measurementLocationDialog
|
||||
height: 110px
|
||||
|
||||
#measurementLocationRelabelDialog
|
||||
height: 125px
|
||||
Reference in new issue
Block a user