- Rename lesion tool as bidirectional tool
- Remove measurementType property and use toolType property in the parts that uses measurementType - Add toolType in syncMeasurementAndToolData method - Hide Convert to Non-Target option in lesionLocationDialog for CRUNEX tools
This commit is contained in:
1 parent
0b6776f777
commit
b51628cc9f
16 files changed
+60
-45
No files matched your search
@@ -4,12 +4,16 @@ measurementValuesByType = {
|
||||
'longestDiameter'
|
||||
],
|
||||
nonTarget: ['response'],
|
||||
crTool: ['response'],
|
||||
exTool: ['response'],
|
||||
unTool: ['response'],
|
||||
length: ['length'],
|
||||
ellipticalRoi: [
|
||||
'area',
|
||||
'mean',
|
||||
'stdev'
|
||||
]
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -60,14 +64,14 @@ function updateLesionData(lesionData) {
|
||||
imageId: lesionData.imageId
|
||||
};
|
||||
|
||||
if (!lesionData.measurementType) {
|
||||
if (!lesionData.toolType) {
|
||||
// For debugging, might want to switch to measurement types later
|
||||
lesionData.measurementType = lesionData.isTarget ? 'bidirectional' : 'nonTarget';
|
||||
lesionData.toolType = lesionData.isTarget ? 'bidirectional' : 'nonTarget';
|
||||
}
|
||||
|
||||
// Populate this timepoint's data with whichever values
|
||||
// are stored for this Measurement type
|
||||
var values = measurementValuesByType[lesionData.measurementType];
|
||||
var values = measurementValuesByType[lesionData.toolType];
|
||||
values.forEach(function(valueName) {
|
||||
timepointData[valueName] = lesionData[valueName];
|
||||
});
|
||||
@@ -81,7 +85,7 @@ function updateLesionData(lesionData) {
|
||||
isTarget: lesionData.isTarget,
|
||||
patientId: lesionData.patientId,
|
||||
id: lesionData.id,
|
||||
measurementType: lesionData.measurementType
|
||||
toolType: lesionData.toolType
|
||||
};
|
||||
if (lesionData.toolType) {
|
||||
measurement.toolType = lesionData.toolType;
|
||||
|
||||
@@ -21,7 +21,7 @@ convertToNonTarget = function(measurementData) {
|
||||
studyInstanceUid: measurementData.studyInstanceUid,
|
||||
patientId: measurementData.patientId,
|
||||
isTarget: false,
|
||||
measurementType: toolType
|
||||
toolType: toolType
|
||||
};
|
||||
|
||||
if (timepoint && timepoint.timepointType === 'baseline') {
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
handleMeasurementAdded = function(e, eventData) {
|
||||
var measurementData = eventData.measurementData;
|
||||
|
||||
switch (measurementData.measurementType) {
|
||||
switch (measurementData.toolType) {
|
||||
case 'nonTarget':
|
||||
case 'bidirectional':
|
||||
case 'lesion':
|
||||
case 'crTool':
|
||||
case 'unTool':
|
||||
case 'exTool':
|
||||
log.info('CornerstoneToolsMeasurementAdded');
|
||||
LesionManager.updateLesionData(measurementData);
|
||||
TrialResponseCriteria.validateDelayed(measurementData);
|
||||
@@ -21,7 +23,7 @@ handleMeasurementAdded = function(e, eventData) {
|
||||
// Add the relevant metaData to this ImageMeasurement's toolData
|
||||
measurementData.clientId = ClientId;
|
||||
measurementData.imageId = imageId;
|
||||
measurementData.measurementType = eventData.toolType;
|
||||
measurementData.toolType = eventData.toolType;
|
||||
measurementData.patientId = study.patientId;
|
||||
measurementData.studyInstanceUid = study.studyInstanceUid;
|
||||
measurementData.seriesInstanceUid = series.seriesInstanceUid;
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
handleMeasurementModified = function(e, eventData) {
|
||||
var measurementData = eventData.measurementData;
|
||||
switch (measurementData.measurementType) {
|
||||
switch (measurementData.toolType) {
|
||||
case 'nonTarget':
|
||||
case 'lesion':
|
||||
case 'bidirectional':
|
||||
case 'crTool':
|
||||
case 'unTool':
|
||||
case 'exTool':
|
||||
log.info('CornerstoneToolsMeasurementModified');
|
||||
LesionManager.updateLesionData(measurementData);
|
||||
TrialResponseCriteria.validateDelayed(measurementData);
|
||||
@@ -20,7 +22,7 @@ handleMeasurementModified = function(e, eventData) {
|
||||
// Add the relevant metaData to this ImageMeasurement's toolData
|
||||
measurementData.clientId = ClientId;
|
||||
measurementData.imageId = imageId;
|
||||
measurementData.measurementType = eventData.toolType;
|
||||
measurementData.toolType = eventData.toolType;
|
||||
measurementData.patientId = study.patientId;
|
||||
measurementData.studyInstanceUid = study.studyInstanceUid;
|
||||
measurementData.seriesInstanceUid = series.seriesInstanceUid;
|
||||
|
||||
@@ -5,7 +5,7 @@ syncImageMeasurementAndToolData = function(measurement) {
|
||||
var toolState = cornerstoneTools.globalImageIdSpecificToolStateManager.toolState;
|
||||
|
||||
var imageId = measurement.imageId;
|
||||
var toolType = measurement.measurementType;
|
||||
var toolType = measurement.toolType;
|
||||
|
||||
// If no tool state exists for this imageId, create an empty object to store it
|
||||
if (!toolState[imageId]) {
|
||||
|
||||
@@ -56,6 +56,7 @@ function syncTimepointDataWithToolData(measurement, timepointData, imageId, tool
|
||||
tool.visible = timepointData.visible;
|
||||
tool.isDeleted = timepointData.isDeleted;
|
||||
tool.handles = timepointData.handles;
|
||||
tool.toolType = measurement.toolType;
|
||||
return false;
|
||||
});
|
||||
|
||||
@@ -82,6 +83,7 @@ function syncTimepointDataWithToolData(measurement, timepointData, imageId, tool
|
||||
tool.locationUID = measurement.locationUID;
|
||||
tool.patientId = measurement.patientId;
|
||||
tool.id = measurement._id;
|
||||
tool.toolType = measurement.toolType;
|
||||
|
||||
// Add the measurementData into the toolData for this imageId
|
||||
toolState[imageId][toolType].data.push(tool);
|
||||
|
||||
@@ -5,7 +5,7 @@ setTimepointTools = function(timepoint) {
|
||||
var fuTools = ["button#crunexTools"];
|
||||
if ((timepoint.timepointType).toLowerCase() === "baseline") {
|
||||
// Set active tool as lesion tool
|
||||
toolManager.setActiveTool('lesion');
|
||||
toolManager.setActiveTool('bidirectional');
|
||||
toolManager.addDisabledTool({tools: fuTools, status: true});
|
||||
} else {
|
||||
toolManager.setActiveTool(toolManager.getDefaultTool());
|
||||
|
||||
Reference in new issue
Block a user