fix(SR): fix Length and Bidirectional tools (#3143)

This commit is contained in:
Leonardo Campos 2023-02-05 23:03:19 -03:00 committed by GitHub
parent 980b44f18c
commit 8edd4ec054
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 27 deletions

View File

@ -2,7 +2,7 @@ version: '3.5'
services: services:
orthanc: orthanc:
image: jodogne/orthanc-plugins:1.5.6 image: jodogne/orthanc-plugins:1.5.7
hostname: orthanc hostname: orthanc
volumes: volumes:
# Config # Config
@ -13,3 +13,11 @@ services:
- '4242:4242' # DICOM - '4242:4242' # DICOM
- '8042:8042' # Web - '8042:8042' # Web
restart: unless-stopped restart: unless-stopped
nginx:
image: nginx:latest
volumes:
- ./config/nginx.conf:/etc/nginx/nginx.conf
ports:
- '80:80' #ngnix proxy
depends_on:
- orthanc

View File

@ -597,7 +597,7 @@ function _getLabelFromMeasuredValueSequence(
const { CodeValue } = MeasurementUnitsCodeSequence; const { CodeValue } = MeasurementUnitsCodeSequence;
const formatedNumericValue = NumericValue const formatedNumericValue = NumericValue
? Number(NumericValue).toFixed(1) ? Number(NumericValue).toFixed(2)
: ''; : '';
return { return {

View File

@ -121,28 +121,23 @@ export default class DICOMSRDisplayTool extends AnnotationTool {
const renderableDataForGraphicType = renderableData[GraphicType]; const renderableDataForGraphicType = renderableData[GraphicType];
let renderMethod; let renderMethod;
let renderTextBox;
let canvasCoordinatesAdapter; let canvasCoordinatesAdapter;
switch (GraphicType) { switch (GraphicType) {
case SCOORD_TYPES.POINT: case SCOORD_TYPES.POINT:
renderMethod = this.renderPoint; renderMethod = this.renderPoint;
renderTextBox = this.renderTextBox;
break; break;
case SCOORD_TYPES.MULTIPOINT: case SCOORD_TYPES.MULTIPOINT:
renderMethod = this.renderMultipoint; renderMethod = this.renderMultipoint;
renderTextBox = this.renderTextBox;
break; break;
case SCOORD_TYPES.POLYLINE: case SCOORD_TYPES.POLYLINE:
renderMethod = this.renderPolyLine; renderMethod = this.renderPolyLine;
break; break;
case SCOORD_TYPES.CIRCLE: case SCOORD_TYPES.CIRCLE:
renderMethod = this.renderEllipse; renderMethod = this.renderEllipse;
renderTextBox = this.renderTextBox;
break; break;
case SCOORD_TYPES.ELLIPSE: case SCOORD_TYPES.ELLIPSE:
renderMethod = this.renderEllipse; renderMethod = this.renderEllipse;
renderTextBox = this.renderTextBox;
canvasCoordinatesAdapter = canvasCoordinatesAdapter =
utilities.math.ellipse.getCanvasEllipseCorners; utilities.math.ellipse.getCanvasEllipseCorners;
break; break;
@ -159,9 +154,7 @@ export default class DICOMSRDisplayTool extends AnnotationTool {
options options
); );
if (typeof renderTextBox === 'function') { this.renderTextBox(
renderTextBox.call(
this,
svgDrawingHelper, svgDrawingHelper,
viewport, viewport,
canvasCoordinates, canvasCoordinates,
@ -170,7 +163,6 @@ export default class DICOMSRDisplayTool extends AnnotationTool {
styleSpecifier, styleSpecifier,
options options
); );
}
}); });
} }
}; };
@ -187,11 +179,11 @@ export default class DICOMSRDisplayTool extends AnnotationTool {
color: options.color, color: options.color,
width: options.lineWidth, width: options.lineWidth,
}; };
let canvasCoordinates; let allCanvasCoordinates = [];
renderableData.map((data, index) => { renderableData.map((data, index) => {
canvasCoordinates = data.map(p => viewport.worldToCanvas(p)); const canvasCoordinates = data.map(p => viewport.worldToCanvas(p));
const lineUID = `${index}`; const lineUID = `${index}`;
if (canvasCoordinates.length === 2) { if (canvasCoordinates.length === 2) {
drawing.drawLine( drawing.drawLine(
svgDrawingHelper, svgDrawingHelper,
@ -210,9 +202,11 @@ export default class DICOMSRDisplayTool extends AnnotationTool {
drawingOptions drawingOptions
); );
} }
allCanvasCoordinates = allCanvasCoordinates.concat(canvasCoordinates);
}); });
return canvasCoordinates; // used for drawing textBox return allCanvasCoordinates; // used for drawing textBox
} }
renderMultipoint( renderMultipoint(
@ -405,9 +399,9 @@ export default class DICOMSRDisplayTool extends AnnotationTool {
} }
const SHORT_HAND_MAP = { const SHORT_HAND_MAP = {
'Short Axis': 'W ', 'Short Axis': 'W: ',
'Long Axis': 'L ', 'Long Axis': 'L: ',
AREA: 'Area ', AREA: 'Area: ',
Length: '', Length: '',
CORNERSTONEFREETEXT: '', CORNERSTONEFREETEXT: '',
}; };

View File

@ -1,4 +1,4 @@
import hydrateStructuredReport from '@ohif/extension-cornerstone-dicom-sr'; import { hydrateStructuredReport } from '@ohif/extension-cornerstone-dicom-sr';
const RESPONSE = { const RESPONSE = {
NO_NEVER: -1, NO_NEVER: -1,