Reverting wrong logic for baseline time points

This commit is contained in:
Bruno Alves de Faria committed 2017-09-18 15:45:55 -03:00
1 parent 45d660636b
commit 29a8a3db8f
9 files changed
+35 -39

No files matched your search

@@ -139,8 +139,8 @@ class MeasurementHandlers {
});
// Sync the new measurement data with cornerstone tools
const previous = timepointApi.priorOrBaseline();
measurementApi.sortMeasurements(previous.timepointId);
const baseline = timepointApi.baseline();
measurementApi.sortMeasurements(baseline.timepointId);
// Repaint the images on all viewports without the removed measurements
_.each($('.imageViewerViewport'), element => cornerstone.updateImage(element));
@@ -40,22 +40,22 @@ OHIF.measurements.getMeasurementsGroupedByNumber = (measurementApi, timepointApi
// Create the result object
const groupedMeasurements = [];
const previous = timepointApi.priorOrBaseline();
if (!previous) return;
const baseline = timepointApi.baseline();
if (!baseline) return;
configuration.measurementTools.forEach(toolGroup => {
// Skip this tool group if it should not be displayed
if (!displayToolGroupMap[toolGroup.id]) return;
// Retrieve all the data for this Measurement type (e.g. 'targets')
// which was recorded at previous timepoint.
const atPrevious = measurementApi.fetch(toolGroup.id, {
timepointId: previous.timepointId
// which was recorded at baseline.
const atBaseline = measurementApi.fetch(toolGroup.id, {
timepointId: baseline.timepointId
});
// Obtain a list of the Measurement Numbers from the
// measurements which have previous timepoint's data
const numbers = atPrevious.map(m => m.measurementNumber);
// measurements which have baseline data
const numbers = atBaseline.map(m => m.measurementNumber);
// Retrieve all the data for this Measurement type which
// match the Measurement Numbers obtained above