feat(measurement-table) Display support for measurements from DICOM Structured Reports (#225)
This commit is contained in:
1 parent
e9832f62f7
commit
d94f0eec16
64 files changed
+1797
-78
No files matched your search
+1
-1
@@ -12,7 +12,7 @@ export default function({ instance, eventData, tool, toolGroupId, toolGroup }) {
|
||||
// Stop here if the tool data shall not be persisted (e.g. temp tools)
|
||||
if (!Collection) return;
|
||||
|
||||
const measurementTypeId = measurementApi.toolsGroupsMap[measurementData.toolType];
|
||||
const measurementTypeId = measurementApi.toolsGroupsMap[eventData.toolType];
|
||||
const measurement = Collection.findOne(measurementData._id);
|
||||
|
||||
// Stop here if the measurement is already gone or never existed
|
||||
|
||||
@@ -0,0 +1,154 @@
|
||||
const segmentedTerminologyList = [{
|
||||
label:'Abdomen/Chest Wall',
|
||||
value:'Abdomen/Chest Wall',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Adrenal',
|
||||
value:'Adrenal',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Bladder',
|
||||
value:'Bladder',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Bone',
|
||||
value:'Bone',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Brain',
|
||||
value:'Brain',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Breast',
|
||||
value:'Breast',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Colon',
|
||||
value:'Colon',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Esophagus',
|
||||
value:'Esophagus',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Extremities',
|
||||
value:'Extremities',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Gallbladder',
|
||||
value:'Gallbladder',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Kidney',
|
||||
value:'Kidney',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Liver',
|
||||
value:'Liver',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Lung',
|
||||
value:'Lung',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Lymph Node',
|
||||
value:'Lymph Node',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Mediastinum/Hilum',
|
||||
value:'Mediastinum/Hilum',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Muscle',
|
||||
value:'Muscle',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Neck',
|
||||
value:'Neck',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Other Soft Tissue',
|
||||
value:'Other Soft Tissue',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Ovary',
|
||||
value:'Ovary',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Pancreas',
|
||||
value:'Pancreas',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Pelvis',
|
||||
value:'Pelvis',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Peritoneum/Omentum',
|
||||
value:'Peritoneum/Omentum',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Prostate',
|
||||
value:'Prostate',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Retroperitoneum',
|
||||
value:'Retroperitoneum',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Small Bowel',
|
||||
value:'Small Bowel',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Spleen',
|
||||
value:'Spleen',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Stomach',
|
||||
value:'Stomach',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Subcutaneous',
|
||||
value:'Subcutaneous',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
}
|
||||
];
|
||||
|
||||
const segmentedTerminologyCommonList = [{
|
||||
label:'Abdomen/Chest Wall',
|
||||
value:'Abdomen/Chest Wall',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Liver',
|
||||
value:'Liver',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Lung',
|
||||
value:'Lung',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Lymph Node',
|
||||
value:'Lymph Node',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Mediastinum/Hilum',
|
||||
value:'Mediastinum/Hilum',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Pelvis',
|
||||
value:'Pelvis',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Peritoneum/Omentum',
|
||||
value:'Peritoneum/Omentum',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
},{
|
||||
label:'Retroperitoneum',
|
||||
value:'Retroperitoneum',
|
||||
segmentedPropCategory: 'T-D0080'
|
||||
}
|
||||
];
|
||||
|
||||
export {
|
||||
segmentedTerminologyList,
|
||||
segmentedTerminologyCommonList
|
||||
}
|
||||
@@ -10,6 +10,15 @@ OHIF.measurements.getLocation = collection => {
|
||||
}
|
||||
};
|
||||
|
||||
// TODO: change this to a const after refactoring newMeasurements code on measurementTableView.js
|
||||
OHIF.measurements.getDescription = collection => {
|
||||
for (let i = 0; i < collection.length; i++) {
|
||||
if (collection[i].description) {
|
||||
return collection[i].description;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Group all measurements by its tool group and measurement number.
|
||||
*
|
||||
@@ -76,6 +85,7 @@ OHIF.measurements.getMeasurementsGroupedByNumber = (measurementApi, timepointApi
|
||||
measurementTypeId: toolGroup.id,
|
||||
measurementNumber: key,
|
||||
location: OHIF.measurements.getLocation(groupObject[key]),
|
||||
description: OHIF.measurements.getDescription(groupObject[key]),
|
||||
responseStatus: false, // TODO: Get the latest timepoint and determine the response status
|
||||
entries: groupObject[key]
|
||||
}));
|
||||
|
||||
@@ -19,5 +19,6 @@ import './navigateOverLesions';
|
||||
import './saveMeasurements';
|
||||
import './syncMeasurementAndToolData';
|
||||
import './toggleLabelButton';
|
||||
import './openLocationModal';
|
||||
import './triggerTimepointUnsavedChanges';
|
||||
import './updateMeasurementsDescription';
|
||||
@@ -55,6 +55,9 @@ function renderIntoViewport(measurementData, enabledElement, viewportIndex) {
|
||||
|
||||
function syncViewports(viewportsIndexes) {
|
||||
const synchronizer = OHIF.viewer.stackImagePositionOffsetSynchronizer;
|
||||
|
||||
if(!synchronizer) { return; }
|
||||
|
||||
const linkableViewports = synchronizer.getLinkableViewports();
|
||||
if (linkableViewports.length) {
|
||||
const linkableViewportsIndexes = _.pluck(linkableViewports, 'index');
|
||||
@@ -141,7 +144,10 @@ OHIF.measurements.jumpToRowItem = (rowItem, timepoints, childToolKey) => {
|
||||
const activatedViewportIndexes = [];
|
||||
|
||||
// Deactivate stack synchronizer because it will be re-activated later
|
||||
OHIF.viewer.stackImagePositionOffsetSynchronizer.deactivate();
|
||||
const synchronizer = OHIF.viewer.stackImagePositionOffsetSynchronizer;
|
||||
if(synchronizer) {
|
||||
synchronizer.deactivate();
|
||||
}
|
||||
|
||||
const renderPromises = [];
|
||||
for (let viewportIndex = 0; viewportIndex < numViewportsToUpdate; viewportIndex++) {
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
import { Template } from 'meteor/templating';
|
||||
import { Blaze } from 'meteor/blaze';
|
||||
import { _ } from 'meteor/underscore';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
OHIF.measurements.openLocationModal = options => {
|
||||
let { toolType } = options.measurement;
|
||||
const { tool } = OHIF.measurements.getToolConfiguration(toolType);
|
||||
|
||||
if (!tool) return;
|
||||
|
||||
toolType = (tool && tool.parentTool) || toolType;
|
||||
|
||||
const measurementId = options.measurement._id;
|
||||
let buttonView = null;
|
||||
|
||||
const removeButtonView = () => {
|
||||
Blaze.remove(buttonView);
|
||||
buttonView = null;
|
||||
};
|
||||
|
||||
if (buttonView) {
|
||||
removeButtonView();
|
||||
}
|
||||
|
||||
const measurementApi = options.measurementApi;
|
||||
const toolCollection = measurementApi.tools[toolType];
|
||||
const measurement = toolCollection.findOne(measurementId);
|
||||
|
||||
const data = {
|
||||
measurement,
|
||||
position: options.position,
|
||||
direction: options.direction,
|
||||
threeColumns: true,
|
||||
hideCommon: true,
|
||||
autoClick: options.autoClick,
|
||||
doneCallback: removeButtonView,
|
||||
updateCallback(location) {
|
||||
const groupId = measurementApi.toolsGroupsMap[toolType];
|
||||
const config = OHIF.measurements.MeasurementApi.getConfiguration();
|
||||
const group = _.findWhere(config.measurementTools, { id: groupId });
|
||||
group.childTools.forEach(tool => {
|
||||
measurementApi.tools[tool.id].update({
|
||||
measurementNumber: measurement.measurementNumber,
|
||||
patientId: measurement.patientId
|
||||
}, {
|
||||
$set: {
|
||||
location
|
||||
}
|
||||
}, {
|
||||
multi: true
|
||||
});
|
||||
});
|
||||
options.measurement.location = location;
|
||||
|
||||
// Notify that viewer suffered changes
|
||||
OHIF.measurements.triggerTimepointUnsavedChanges('relabel');
|
||||
}
|
||||
};
|
||||
buttonView = Blaze.renderWithData(Template.measurementRelabel, data, document.body);
|
||||
};
|
||||
Reference in new issue
Block a user