Added persistent single-image measurments (length, ellipse) (LT-37, LT-156)
This commit is contained in:
1 parent
b624d12762
commit
36ff46be41
20 files changed
+227
-34
No files matched your search
@@ -1,3 +1,17 @@
|
||||
measurementValuesByType = {
|
||||
bidirectional: [
|
||||
'shortestDiameter',
|
||||
'longestDiameter'
|
||||
],
|
||||
nonTarget: ['response'],
|
||||
length: ['length'],
|
||||
ellipticalRoi: [
|
||||
'area',
|
||||
'mean',
|
||||
'stdev'
|
||||
]
|
||||
};
|
||||
|
||||
/**
|
||||
* Update the Timepoint object for a specific Measurement.
|
||||
* If no measurement exists yet, one will be created.
|
||||
@@ -46,13 +60,18 @@ function updateLesionData(lesionData) {
|
||||
imageId: lesionData.imageId
|
||||
};
|
||||
|
||||
if (lesionData.isTarget === true) {
|
||||
timepointData.shortestDiameter = lesionData.shortestDiameter;
|
||||
timepointData.longestDiameter = lesionData.longestDiameter;
|
||||
} else {
|
||||
timepointData.response = lesionData.response;
|
||||
if (!lesionData.measurementType) {
|
||||
// For debugging
|
||||
log.warn('No MeasurementType available?');
|
||||
}
|
||||
|
||||
// Populate this timepoint's data with whichever values
|
||||
// are stored for this Measurement type
|
||||
var values = measurementValuesByType[lesionData.measurementType];
|
||||
values.forEach(function(valueName) {
|
||||
timepointData[valueName] = lesionData[valueName];
|
||||
});
|
||||
|
||||
// If no such lesion exists, we need to add one
|
||||
if (!existingMeasurement) {
|
||||
// Create a data structure for the Measurement
|
||||
|
||||
Reference in new issue
Block a user