PWV-2: Exposing ohif:measurements package's lib functions on OHIF namespace
This commit is contained in:
1 parent
60aa1d0982
commit
5c5c2afb42
23 files changed
+254
-344
No files matched your search
+8
-10
@@ -1,4 +1,4 @@
|
||||
import { MeasurementManager } from 'meteor/ohif:measurements/client/lib/MeasurementManager';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
function closeHandler(dialog) {
|
||||
// Hide the lesion dialog
|
||||
@@ -12,7 +12,6 @@ function closeHandler(dialog) {
|
||||
}
|
||||
|
||||
// This event sets lesion number for new lesion
|
||||
|
||||
function getSetLesionNumberCallbackFunction(measurementTypeId, measurementApi, timepointApi) {
|
||||
return (measurementData, eventData, doneCallback) => {
|
||||
// Get the current element's timepointId from the study date metadata
|
||||
@@ -35,12 +34,12 @@ function getSetLesionNumberCallbackFunction(measurementTypeId, measurementApi, t
|
||||
// exists at a different timepoint
|
||||
const timepointId = timepoint.timepointId;
|
||||
const collection = measurementApi[measurementTypeId];
|
||||
const measurementNumber = MeasurementManager.getNewMeasurementNumber(timepointId, collection, timepointApi);
|
||||
const measurementNumber = OHIF.measurements.MeasurementManager.getNewMeasurementNumber(timepointId, collection, timepointApi);
|
||||
measurementData.measurementNumber = measurementNumber;
|
||||
|
||||
// Set lesion number
|
||||
doneCallback(measurementNumber);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// This event determines whether or not to show the lesion dialog
|
||||
@@ -71,7 +70,7 @@ function getLesionLocationCallback(measurementData, eventData) {
|
||||
|
||||
// Find out if this lesion number is already added in the lesion manager for another timepoint
|
||||
// If it is, stop here because we don't need the dialog.
|
||||
var locationUID = MeasurementManager.getLocationIdIfMeasurementExists(measurementData);
|
||||
var locationUID = OHIF.measurements.MeasurementManager.getLocationIdIfMeasurementExists(measurementData);
|
||||
if (locationUID) {
|
||||
// Add an ID value to the tool data to link it to the Measurements collection
|
||||
measurementData.id = 'notready';
|
||||
@@ -123,9 +122,9 @@ changeLesionLocationCallback = function(measurementData, eventData, doneCallback
|
||||
|
||||
// Show/Hide Convert To NonTarget option in measurementLocationRelabelDialog
|
||||
if (measurementData.toolType === 'bidirectional') {
|
||||
dialog.find("#convertToNonTarget").css("visibility", "visible");
|
||||
dialog.find('#convertToNonTarget').css('visibility', 'visible');
|
||||
} else {
|
||||
dialog.find("#convertToNonTarget").css("visibility", "hidden");
|
||||
dialog.find('#convertToNonTarget').css('visibility', 'hidden');
|
||||
}
|
||||
|
||||
Template.measurementLocationDialog.dialog = dialog;
|
||||
@@ -189,7 +188,6 @@ changeLesionLocationCallback = function(measurementData, eventData, doneCallback
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Template.measurementLocationDialog.onCreated(() => {
|
||||
const instance = Template.instance();
|
||||
const measurementTypeId = 'targets';
|
||||
@@ -268,7 +266,7 @@ Template.measurementLocationDialog.events({
|
||||
var measurementData = Template.measurementLocationDialog.measurementData;
|
||||
var dialog = Template.measurementLocationDialog.dialog;
|
||||
|
||||
const instance = Template.instance()
|
||||
const instance = Template.instance();
|
||||
const measurementApi = instance.data.measurementApi;
|
||||
convertToNonTarget(measurementApi, measurementData);
|
||||
|
||||
@@ -290,7 +288,7 @@ Template.measurementLocationDialog.events({
|
||||
});
|
||||
|
||||
Template.measurementLocationDialog.helpers({
|
||||
measurementLocations: function() {
|
||||
measurementLocations() {
|
||||
return LesionLocations.find();
|
||||
}
|
||||
});
|
||||
+9
-8
@@ -1,4 +1,4 @@
|
||||
import { MeasurementManager } from 'meteor/ohif:measurements/client/lib/MeasurementManager';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
function closeHandler(dialog) {
|
||||
// Hide the lesion dialog
|
||||
@@ -31,12 +31,12 @@ function getSetLesionNumberCallbackFunction(measurementTypeId, measurementApi, t
|
||||
// exists at a different timepoint
|
||||
const timepointId = timepoint.timepointId;
|
||||
const collection = measurementApi[measurementTypeId];
|
||||
const measurementNumber = MeasurementManager.getNewMeasurementNumber(timepointId, collection, timepointApi);
|
||||
const measurementNumber = OHIF.measurements.MeasurementManager.getNewMeasurementNumber(timepointId, collection, timepointApi);
|
||||
measurementData.measurementNumber = measurementNumber;
|
||||
|
||||
// Set lesion number
|
||||
doneCallback(measurementNumber);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function selectNonTargetResponse(responseCode) {
|
||||
@@ -104,7 +104,7 @@ function getLesionLocationCallback(measurementData, eventData) {
|
||||
|
||||
// Find out if this lesion number is already added in the lesion manager for another timepoint
|
||||
// If it is, disable selector location
|
||||
var locationId = MeasurementManager.getLocationIdIfMeasurementExists(measurementData);
|
||||
var locationId = OHIF.measurements.MeasurementManager.getLocationIdIfMeasurementExists(measurementData);
|
||||
if (locationId) {
|
||||
// Add an ID value to the tool data to link it to the Measurements collection
|
||||
measurementData.id = 'notready';
|
||||
@@ -120,11 +120,11 @@ function getLesionLocationCallback(measurementData, eventData) {
|
||||
var locationObject = LesionLocations.findOne({
|
||||
id: locationId
|
||||
});
|
||||
|
||||
|
||||
if (!locationObject) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
selectorLocation.find('option[value="' + locationObject._id + '"]').prop('selected', true);
|
||||
selectorLocation.prop('disabled', true);
|
||||
}
|
||||
@@ -238,7 +238,6 @@ changeNonTargetLocationCallback = function(measurementData, eventData, doneCallb
|
||||
selectNonTargetResponse(response);
|
||||
};
|
||||
|
||||
|
||||
Template.nonTargetLesionDialog.onCreated(() => {
|
||||
const instance = Template.instance();
|
||||
const measurementTypeId = 'nonTargets';
|
||||
@@ -297,7 +296,9 @@ Template.nonTargetLesionDialog.events({
|
||||
measurementData.isTarget = false;
|
||||
|
||||
// Response is set from location response list
|
||||
measurementData.response = LocationResponses.findOne({selected: true}).code;
|
||||
measurementData.response = LocationResponses.findOne({
|
||||
selected: true
|
||||
}).code;
|
||||
|
||||
// Adds lesion data to timepoints array
|
||||
LesionManager.updateLesionData(measurementData);
|
||||
|
||||
Reference in new issue
Block a user