@cornerstonejs/adapters 4.22.6 → 4.22.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/adapters/Cornerstone/Angle.js +22 -15
- package/dist/esm/adapters/Cornerstone/ArrowAnnotate.js +13 -18
- package/dist/esm/adapters/Cornerstone/Bidirectional.js +22 -27
- package/dist/esm/adapters/Cornerstone/CircleRoi.js +20 -26
- package/dist/esm/adapters/Cornerstone/CobbAngle.js +22 -15
- package/dist/esm/adapters/Cornerstone/EllipticalRoi.js +19 -25
- package/dist/esm/adapters/Cornerstone/FreehandRoi.js +21 -25
- package/dist/esm/adapters/Cornerstone/Length.js +18 -15
- package/dist/esm/adapters/Cornerstone/MeasurementReport.js +20 -40
- package/dist/esm/adapters/Cornerstone/ParametricMap.js +15 -26
- package/dist/esm/adapters/Cornerstone/RectangleRoi.js +26 -25
- package/dist/esm/adapters/Cornerstone/Segmentation_3X.js +19 -31
- package/dist/esm/adapters/Cornerstone/Segmentation_4X.js +69 -90
- package/dist/esm/adapters/Cornerstone3D/Angle.js +17 -24
- package/dist/esm/adapters/Cornerstone3D/ArrowAnnotate.js +21 -35
- package/dist/esm/adapters/Cornerstone3D/BaseAdapter3D.js +12 -23
- package/dist/esm/adapters/Cornerstone3D/Bidirectional.js +21 -33
- package/dist/esm/adapters/Cornerstone3D/CircleROI.js +27 -35
- package/dist/esm/adapters/Cornerstone3D/CobbAngle.js +25 -28
- package/dist/esm/adapters/Cornerstone3D/ControlPointPolyline.js +10 -17
- package/dist/esm/adapters/Cornerstone3D/EllipticalROI.js +25 -33
- package/dist/esm/adapters/Cornerstone3D/KeyImage.js +3 -9
- package/dist/esm/adapters/Cornerstone3D/LabelData.js +22 -33
- package/dist/esm/adapters/Cornerstone3D/Length.js +19 -27
- package/dist/esm/adapters/Cornerstone3D/MeasurementReport.js +73 -116
- package/dist/esm/adapters/Cornerstone3D/ParametricMap/generateToolState.js +2 -6
- package/dist/esm/adapters/Cornerstone3D/PlanarFreehandROI.js +26 -35
- package/dist/esm/adapters/Cornerstone3D/Probe.js +16 -27
- package/dist/esm/adapters/Cornerstone3D/RTStruct/RTSS.js +13 -29
- package/dist/esm/adapters/Cornerstone3D/RTStruct/index.js +1 -3
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getReferencedFrameOfReferenceSequence.js +1 -3
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getReferencedSeriesSequence.js +7 -13
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getStructureSetModule.js +1 -3
- package/dist/esm/adapters/Cornerstone3D/RectangleROI.js +21 -28
- package/dist/esm/adapters/Cornerstone3D/Segmentation/compactMergeSegData.js +5 -9
- package/dist/esm/adapters/Cornerstone3D/Segmentation/generateLabelMaps2DFrom3D.js +2 -4
- package/dist/esm/adapters/Cornerstone3D/Segmentation/generateSegmentation.js +5 -15
- package/dist/esm/adapters/Cornerstone3D/Segmentation/generateToolState.js +3 -4
- package/dist/esm/adapters/Cornerstone3D/Segmentation/labelmapImagesFromBuffer.js +124 -156
- package/dist/esm/adapters/Cornerstone3D/UltrasoundDirectional.js +12 -23
- package/dist/esm/adapters/Cornerstone3D/metricHandler.js +8 -5
- package/dist/esm/adapters/VTKjs/Segmentation.js +2 -4
- package/dist/esm/adapters/helpers/checkOrientation.js +2 -4
- package/dist/esm/adapters/helpers/downloadDICOMData.js +1 -3
- package/dist/esm/adapters/helpers/getDatasetsFromImages.js +3 -7
- package/dist/esm/adapters/helpers/scoordToWorld.js +5 -13
- package/dist/esm/adapters/helpers/toPoint3.js +1 -3
- package/dist/esm/adapters/helpers/toScoordType.js +3 -7
- package/dist/esm/adapters/index.js +3 -2
- package/dist/esm/utilities/createInstance.js +9 -8
- package/dist/esm/utilities/referencedMetadataProvider.js +7 -13
- package/dist/esm/version.d.ts +1 -1
- package/package.json +6 -6
|
@@ -2,24 +2,22 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
2
2
|
import { utilities } from 'dcmjs';
|
|
3
3
|
import MeasurementReport from './MeasurementReport.js';
|
|
4
4
|
import BaseAdapter3D from './BaseAdapter3D.js';
|
|
5
|
+
import '../helpers/downloadDICOMData.js';
|
|
5
6
|
import { toScoord } from '../helpers/toScoordType.js';
|
|
6
|
-
import '
|
|
7
|
+
import '../helpers/scoordToWorld.js';
|
|
7
8
|
|
|
8
9
|
var _Angle;
|
|
9
10
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
11
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
|
-
const
|
|
12
|
-
CobbAngle: TID300CobbAngle
|
|
13
|
-
} = utilities.TID300;
|
|
12
|
+
const TID300CobbAngle = utilities.TID300.CobbAngle;
|
|
14
13
|
class Angle extends BaseAdapter3D {
|
|
15
14
|
static getMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata) {
|
|
16
|
-
const
|
|
17
|
-
state,
|
|
18
|
-
NUMGroup,
|
|
19
|
-
worldCoords,
|
|
20
|
-
referencedImageId,
|
|
21
|
-
ReferencedFrameNumber
|
|
22
|
-
} = MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, this.toolType);
|
|
15
|
+
const _MeasurementReport$ge = MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, this.toolType),
|
|
16
|
+
state = _MeasurementReport$ge.state,
|
|
17
|
+
NUMGroup = _MeasurementReport$ge.NUMGroup,
|
|
18
|
+
worldCoords = _MeasurementReport$ge.worldCoords,
|
|
19
|
+
referencedImageId = _MeasurementReport$ge.referencedImageId,
|
|
20
|
+
ReferencedFrameNumber = _MeasurementReport$ge.ReferencedFrameNumber;
|
|
23
21
|
const cachedStats = referencedImageId ? {
|
|
24
22
|
["imageId:".concat(referencedImageId)]: {
|
|
25
23
|
angle: NUMGroup ? NUMGroup.MeasuredValueSequence.NumericValue : null
|
|
@@ -37,19 +35,14 @@ class Angle extends BaseAdapter3D {
|
|
|
37
35
|
static getTID300RepresentationArguments(tool) {
|
|
38
36
|
var _cachedStats;
|
|
39
37
|
let is3DMeasurement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
handles
|
|
49
|
-
} = data;
|
|
50
|
-
const {
|
|
51
|
-
referencedImageId
|
|
52
|
-
} = metadata;
|
|
38
|
+
const data = tool.data,
|
|
39
|
+
finding = tool.finding,
|
|
40
|
+
findingSites = tool.findingSites,
|
|
41
|
+
metadata = tool.metadata;
|
|
42
|
+
const _data$cachedStats = data.cachedStats,
|
|
43
|
+
cachedStats = _data$cachedStats === void 0 ? {} : _data$cachedStats,
|
|
44
|
+
handles = data.handles;
|
|
45
|
+
const referencedImageId = metadata.referencedImageId;
|
|
53
46
|
const scoordProps = {
|
|
54
47
|
is3DMeasurement,
|
|
55
48
|
referencedImageId
|
|
@@ -3,42 +3,35 @@ import { utilities } from 'dcmjs';
|
|
|
3
3
|
import { utilities as utilities$1 } from '@cornerstonejs/core';
|
|
4
4
|
import MeasurementReport from './MeasurementReport.js';
|
|
5
5
|
import BaseAdapter3D from './BaseAdapter3D.js';
|
|
6
|
+
import '../helpers/downloadDICOMData.js';
|
|
6
7
|
import { toScoord } from '../helpers/toScoordType.js';
|
|
8
|
+
import '../helpers/scoordToWorld.js';
|
|
7
9
|
|
|
8
10
|
var _ArrowAnnotate;
|
|
9
11
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
12
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
} = utilities.TID300;
|
|
14
|
-
const {
|
|
15
|
-
imageToWorldCoords
|
|
16
|
-
} = utilities$1;
|
|
13
|
+
const TID300ArrowAnnotate = utilities.TID300.ArrowAnnotate;
|
|
14
|
+
const imageToWorldCoords = utilities$1.imageToWorldCoords;
|
|
17
15
|
class ArrowAnnotate extends BaseAdapter3D {
|
|
18
16
|
static getMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, _trackingIdentifier) {
|
|
19
|
-
const
|
|
20
|
-
state,
|
|
21
|
-
SCOORDGroup,
|
|
22
|
-
worldCoords,
|
|
23
|
-
referencedImageId,
|
|
24
|
-
ReferencedFrameNumber
|
|
25
|
-
} = MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, this.toolType);
|
|
17
|
+
const _MeasurementReport$ge = MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, this.toolType),
|
|
18
|
+
state = _MeasurementReport$ge.state,
|
|
19
|
+
SCOORDGroup = _MeasurementReport$ge.SCOORDGroup,
|
|
20
|
+
worldCoords = _MeasurementReport$ge.worldCoords,
|
|
21
|
+
referencedImageId = _MeasurementReport$ge.referencedImageId,
|
|
22
|
+
ReferencedFrameNumber = _MeasurementReport$ge.ReferencedFrameNumber;
|
|
26
23
|
const text = state.annotation.data.label;
|
|
27
24
|
if (worldCoords.length === 1 && SCOORDGroup) {
|
|
28
25
|
const imagePixelModule = metadata.get('imagePixelModule', referencedImageId);
|
|
29
26
|
let xOffset = 10;
|
|
30
27
|
let yOffset = 10;
|
|
31
28
|
if (imagePixelModule) {
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
rows
|
|
35
|
-
} = imagePixelModule;
|
|
29
|
+
const columns = imagePixelModule.columns,
|
|
30
|
+
rows = imagePixelModule.rows;
|
|
36
31
|
xOffset = columns / 10;
|
|
37
32
|
yOffset = rows / 10;
|
|
38
33
|
}
|
|
39
|
-
const
|
|
40
|
-
GraphicData
|
|
41
|
-
} = SCOORDGroup;
|
|
34
|
+
const GraphicData = SCOORDGroup.GraphicData;
|
|
42
35
|
const secondPoint = imageToWorldCoords(referencedImageId, [GraphicData[0] + xOffset, GraphicData[1] + yOffset]);
|
|
43
36
|
worldCoords.push(secondPoint);
|
|
44
37
|
}
|
|
@@ -54,25 +47,18 @@ class ArrowAnnotate extends BaseAdapter3D {
|
|
|
54
47
|
}
|
|
55
48
|
static getTID300RepresentationArguments(tool) {
|
|
56
49
|
let is3DMeasurement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const {
|
|
63
|
-
finding
|
|
64
|
-
} = tool;
|
|
65
|
-
const {
|
|
66
|
-
referencedImageId
|
|
67
|
-
} = metadata;
|
|
50
|
+
const data = tool.data,
|
|
51
|
+
metadata = tool.metadata,
|
|
52
|
+
findingSites = tool.findingSites;
|
|
53
|
+
const finding = tool.finding;
|
|
54
|
+
const referencedImageId = metadata.referencedImageId;
|
|
68
55
|
const scoordProps = {
|
|
69
56
|
is3DMeasurement,
|
|
70
57
|
referencedImageId
|
|
71
58
|
};
|
|
72
|
-
const
|
|
73
|
-
points,
|
|
74
|
-
arrowFirst
|
|
75
|
-
} = data.handles;
|
|
59
|
+
const _data$handles = data.handles,
|
|
60
|
+
points = _data$handles.points,
|
|
61
|
+
arrowFirst = _data$handles.arrowFirst;
|
|
76
62
|
const point = arrowFirst ? points[0] : points[1];
|
|
77
63
|
const point2 = arrowFirst ? points[1] : points[0];
|
|
78
64
|
const pointImage = toScoord(scoordProps, point);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import CORNERSTONE_3D_TAG from './cornerstone3DTag.js';
|
|
2
2
|
import MeasurementReport from './MeasurementReport.js';
|
|
3
|
-
import '
|
|
3
|
+
import '../helpers/downloadDICOMData.js';
|
|
4
4
|
import { toScoords } from '../helpers/toScoordType.js';
|
|
5
|
-
import '
|
|
5
|
+
import '../helpers/scoordToWorld.js';
|
|
6
6
|
|
|
7
7
|
class BaseAdapter3D {
|
|
8
8
|
static registerType() {
|
|
@@ -34,13 +34,9 @@ class BaseAdapter3D {
|
|
|
34
34
|
return items[offset];
|
|
35
35
|
}
|
|
36
36
|
static getGraphicCode(graphicItem) {
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const {
|
|
41
|
-
CodeValue: graphicValue,
|
|
42
|
-
CodingSchemeDesignator: graphicDesignator
|
|
43
|
-
} = conceptNameItem;
|
|
37
|
+
const conceptNameItem = graphicItem.ConceptNameCodeSequence;
|
|
38
|
+
const graphicValue = conceptNameItem.CodeValue,
|
|
39
|
+
graphicDesignator = conceptNameItem.CodingSchemeDesignator;
|
|
44
40
|
return "".concat(graphicDesignator, ":").concat(graphicValue);
|
|
45
41
|
}
|
|
46
42
|
static getGraphicType(graphicItem) {
|
|
@@ -88,10 +84,9 @@ class BaseAdapter3D {
|
|
|
88
84
|
return trackingIdentifier.startsWith(this.trackingIdentifierTextValue);
|
|
89
85
|
}
|
|
90
86
|
static getMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, trackingIdentifier) {
|
|
91
|
-
const
|
|
92
|
-
defaultState
|
|
93
|
-
ReferencedFrameNumber
|
|
94
|
-
} = MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, this.toolType);
|
|
87
|
+
const _MeasurementReport$ge = MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, this.toolType),
|
|
88
|
+
state = _MeasurementReport$ge.defaultState,
|
|
89
|
+
ReferencedFrameNumber = _MeasurementReport$ge.ReferencedFrameNumber;
|
|
95
90
|
state.annotation.data = {
|
|
96
91
|
cachedStats: {},
|
|
97
92
|
frameNumber: ReferencedFrameNumber,
|
|
@@ -101,16 +96,10 @@ class BaseAdapter3D {
|
|
|
101
96
|
}
|
|
102
97
|
static getTID300RepresentationArguments(tool) {
|
|
103
98
|
let is3DMeasurement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
const
|
|
108
|
-
finding,
|
|
109
|
-
findingSites
|
|
110
|
-
} = tool;
|
|
111
|
-
const {
|
|
112
|
-
referencedImageId
|
|
113
|
-
} = metadata;
|
|
99
|
+
const metadata = tool.metadata;
|
|
100
|
+
const finding = tool.finding,
|
|
101
|
+
findingSites = tool.findingSites;
|
|
102
|
+
const referencedImageId = metadata.referencedImageId;
|
|
114
103
|
const scoordProps = {
|
|
115
104
|
is3DMeasurement,
|
|
116
105
|
referencedImageId
|
|
@@ -2,6 +2,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
2
2
|
import { utilities } from 'dcmjs';
|
|
3
3
|
import MeasurementReport from './MeasurementReport.js';
|
|
4
4
|
import { toArray } from '../helpers/toArray.js';
|
|
5
|
+
import '../helpers/downloadDICOMData.js';
|
|
5
6
|
import { toScoord } from '../helpers/toScoordType.js';
|
|
6
7
|
import { scoordToWorld } from '../helpers/scoordToWorld.js';
|
|
7
8
|
import BaseAdapter3D from './BaseAdapter3D.js';
|
|
@@ -9,22 +10,17 @@ import BaseAdapter3D from './BaseAdapter3D.js';
|
|
|
9
10
|
var _Bidirectional;
|
|
10
11
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11
12
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
|
-
const
|
|
13
|
-
Bidirectional: TID300Bidirectional
|
|
14
|
-
} = utilities.TID300;
|
|
13
|
+
const TID300Bidirectional = utilities.TID300.Bidirectional;
|
|
15
14
|
const LONG_AXIS = 'Long Axis';
|
|
16
15
|
const SHORT_AXIS = 'Short Axis';
|
|
17
16
|
class Bidirectional extends BaseAdapter3D {
|
|
18
17
|
static getMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata) {
|
|
19
|
-
const
|
|
20
|
-
state,
|
|
21
|
-
scoordArgs,
|
|
22
|
-
referencedImageId,
|
|
23
|
-
ReferencedFrameNumber
|
|
24
|
-
|
|
25
|
-
const {
|
|
26
|
-
ContentSequence
|
|
27
|
-
} = MeasurementGroup;
|
|
18
|
+
const _MeasurementReport$ge = MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, this.toolType),
|
|
19
|
+
state = _MeasurementReport$ge.state,
|
|
20
|
+
scoordArgs = _MeasurementReport$ge.scoordArgs,
|
|
21
|
+
referencedImageId = _MeasurementReport$ge.referencedImageId,
|
|
22
|
+
ReferencedFrameNumber = _MeasurementReport$ge.ReferencedFrameNumber;
|
|
23
|
+
const ContentSequence = MeasurementGroup.ContentSequence;
|
|
28
24
|
const longAxisNUMGroup = toArray(ContentSequence).find(group => group.ConceptNameCodeSequence.CodeMeaning === LONG_AXIS);
|
|
29
25
|
const shortAxisNUMGroup = toArray(ContentSequence).find(group => group.ConceptNameCodeSequence.CodeMeaning === SHORT_AXIS);
|
|
30
26
|
const longAxisScoordGroup = toArray(longAxisNUMGroup.ContentSequence).find(group => group.ValueType === 'SCOORD3D' || group.ValueType === 'SCOORD');
|
|
@@ -52,26 +48,19 @@ class Bidirectional extends BaseAdapter3D {
|
|
|
52
48
|
}
|
|
53
49
|
static getTID300RepresentationArguments(tool) {
|
|
54
50
|
let is3DMeasurement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
handles
|
|
64
|
-
} = data;
|
|
65
|
-
const {
|
|
66
|
-
referencedImageId
|
|
67
|
-
} = metadata;
|
|
51
|
+
const data = tool.data,
|
|
52
|
+
finding = tool.finding,
|
|
53
|
+
findingSites = tool.findingSites,
|
|
54
|
+
metadata = tool.metadata;
|
|
55
|
+
const _data$cachedStats = data.cachedStats,
|
|
56
|
+
cachedStats = _data$cachedStats === void 0 ? {} : _data$cachedStats,
|
|
57
|
+
handles = data.handles;
|
|
58
|
+
const referencedImageId = metadata.referencedImageId;
|
|
68
59
|
const scoordProps = {
|
|
69
60
|
is3DMeasurement,
|
|
70
61
|
referencedImageId
|
|
71
62
|
};
|
|
72
|
-
const
|
|
73
|
-
points
|
|
74
|
-
} = handles;
|
|
63
|
+
const points = handles.points;
|
|
75
64
|
const firstPointPairs = [points[0], points[1]];
|
|
76
65
|
const secondPointPairs = [points[2], points[3]];
|
|
77
66
|
const firstPointPairsDistance = Math.sqrt(Math.pow(firstPointPairs[0][0] - firstPointPairs[1][0], 2) + Math.pow(firstPointPairs[0][1] - firstPointPairs[1][1], 2) + Math.pow(firstPointPairs[0][2] - firstPointPairs[1][2], 2));
|
|
@@ -89,11 +78,10 @@ class Bidirectional extends BaseAdapter3D {
|
|
|
89
78
|
const longAxisEndImage = toScoord(scoordProps, shortAxisPoints[1]);
|
|
90
79
|
const shortAxisStartImage = toScoord(scoordProps, longAxisPoints[0]);
|
|
91
80
|
const shortAxisEndImage = toScoord(scoordProps, longAxisPoints[1]);
|
|
92
|
-
const {
|
|
93
|
-
length,
|
|
94
|
-
width,
|
|
95
|
-
unit
|
|
96
|
-
} = cachedStats["imageId:".concat(referencedImageId)] || {};
|
|
81
|
+
const _ref = cachedStats["imageId:".concat(referencedImageId)] || {},
|
|
82
|
+
length = _ref.length,
|
|
83
|
+
width = _ref.width,
|
|
84
|
+
unit = _ref.unit;
|
|
97
85
|
return {
|
|
98
86
|
longAxis: {
|
|
99
87
|
point1: longAxisStartImage,
|
|
@@ -2,25 +2,23 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
2
2
|
import { utilities } from 'dcmjs';
|
|
3
3
|
import MeasurementReport from './MeasurementReport.js';
|
|
4
4
|
import BaseAdapter3D from './BaseAdapter3D.js';
|
|
5
|
+
import '../helpers/downloadDICOMData.js';
|
|
5
6
|
import { toScoord } from '../helpers/toScoordType.js';
|
|
6
|
-
import '
|
|
7
|
+
import '../helpers/scoordToWorld.js';
|
|
7
8
|
import { extractAllNUMGroups, restoreAdditionalMetrics } from './metricHandler.js';
|
|
8
9
|
|
|
9
10
|
var _CircleROI;
|
|
10
11
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11
12
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
|
-
const
|
|
13
|
-
Circle: TID300Circle
|
|
14
|
-
} = utilities.TID300;
|
|
13
|
+
const TID300Circle = utilities.TID300.Circle;
|
|
15
14
|
class CircleROI extends BaseAdapter3D {
|
|
16
15
|
static getMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata) {
|
|
17
|
-
const
|
|
18
|
-
state,
|
|
19
|
-
NUMGroup,
|
|
20
|
-
worldCoords,
|
|
21
|
-
referencedImageId,
|
|
22
|
-
ReferencedFrameNumber
|
|
23
|
-
} = MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, this.toolType);
|
|
16
|
+
const _MeasurementReport$ge = MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, this.toolType),
|
|
17
|
+
state = _MeasurementReport$ge.state,
|
|
18
|
+
NUMGroup = _MeasurementReport$ge.NUMGroup,
|
|
19
|
+
worldCoords = _MeasurementReport$ge.worldCoords,
|
|
20
|
+
referencedImageId = _MeasurementReport$ge.referencedImageId,
|
|
21
|
+
ReferencedFrameNumber = _MeasurementReport$ge.ReferencedFrameNumber;
|
|
24
22
|
const referencedSOPInstanceUID = state.sopInstanceUid;
|
|
25
23
|
const allNUMGroups = extractAllNUMGroups(MeasurementGroup, referencedSOPInstanceUID);
|
|
26
24
|
const measurementNUMGroups = allNUMGroups[referencedSOPInstanceUID] || {};
|
|
@@ -43,36 +41,30 @@ class CircleROI extends BaseAdapter3D {
|
|
|
43
41
|
}
|
|
44
42
|
static getTID300RepresentationArguments(tool) {
|
|
45
43
|
let is3DMeasurement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
handles
|
|
55
|
-
} = data;
|
|
56
|
-
const {
|
|
57
|
-
referencedImageId
|
|
58
|
-
} = metadata;
|
|
44
|
+
const data = tool.data,
|
|
45
|
+
finding = tool.finding,
|
|
46
|
+
findingSites = tool.findingSites,
|
|
47
|
+
metadata = tool.metadata;
|
|
48
|
+
const _data$cachedStats = data.cachedStats,
|
|
49
|
+
cachedStats = _data$cachedStats === void 0 ? {} : _data$cachedStats,
|
|
50
|
+
handles = data.handles;
|
|
51
|
+
const referencedImageId = metadata.referencedImageId;
|
|
59
52
|
const scoordProps = {
|
|
60
53
|
is3DMeasurement,
|
|
61
54
|
referencedImageId
|
|
62
55
|
};
|
|
63
56
|
const center = toScoord(scoordProps, handles.points[0]);
|
|
64
57
|
const end = toScoord(scoordProps, handles.points[1]);
|
|
65
|
-
const {
|
|
66
|
-
area,
|
|
67
|
-
radius,
|
|
68
|
-
max,
|
|
69
|
-
min,
|
|
70
|
-
stdDev,
|
|
71
|
-
mean,
|
|
72
|
-
modalityUnit,
|
|
73
|
-
radiusUnit,
|
|
74
|
-
areaUnit
|
|
75
|
-
} = cachedStats["imageId:".concat(referencedImageId)] || {};
|
|
58
|
+
const _ref = cachedStats["imageId:".concat(referencedImageId)] || {},
|
|
59
|
+
area = _ref.area,
|
|
60
|
+
radius = _ref.radius,
|
|
61
|
+
max = _ref.max,
|
|
62
|
+
min = _ref.min,
|
|
63
|
+
stdDev = _ref.stdDev,
|
|
64
|
+
mean = _ref.mean,
|
|
65
|
+
modalityUnit = _ref.modalityUnit,
|
|
66
|
+
radiusUnit = _ref.radiusUnit,
|
|
67
|
+
areaUnit = _ref.areaUnit;
|
|
76
68
|
const perimeter = 2 * Math.PI * radius;
|
|
77
69
|
return {
|
|
78
70
|
area,
|
|
@@ -1,25 +1,24 @@
|
|
|
1
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
1
2
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
3
|
import { utilities } from 'dcmjs';
|
|
3
4
|
import MeasurementReport from './MeasurementReport.js';
|
|
4
5
|
import BaseAdapter3D from './BaseAdapter3D.js';
|
|
6
|
+
import '../helpers/downloadDICOMData.js';
|
|
5
7
|
import { toScoords } from '../helpers/toScoordType.js';
|
|
6
|
-
import '
|
|
8
|
+
import '../helpers/scoordToWorld.js';
|
|
7
9
|
|
|
8
10
|
var _CobbAngle;
|
|
9
11
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
12
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
|
-
const
|
|
12
|
-
CobbAngle: TID300CobbAngle
|
|
13
|
-
} = utilities.TID300;
|
|
13
|
+
const TID300CobbAngle = utilities.TID300.CobbAngle;
|
|
14
14
|
class CobbAngle extends BaseAdapter3D {
|
|
15
15
|
static getMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata) {
|
|
16
|
-
const
|
|
17
|
-
state,
|
|
18
|
-
NUMGroup,
|
|
19
|
-
referencedImageId,
|
|
20
|
-
worldCoords,
|
|
21
|
-
ReferencedFrameNumber
|
|
22
|
-
} = MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, CobbAngle.toolType);
|
|
16
|
+
const _MeasurementReport$ge = MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, CobbAngle.toolType),
|
|
17
|
+
state = _MeasurementReport$ge.state,
|
|
18
|
+
NUMGroup = _MeasurementReport$ge.NUMGroup,
|
|
19
|
+
referencedImageId = _MeasurementReport$ge.referencedImageId,
|
|
20
|
+
worldCoords = _MeasurementReport$ge.worldCoords,
|
|
21
|
+
ReferencedFrameNumber = _MeasurementReport$ge.ReferencedFrameNumber;
|
|
23
22
|
state.annotation.data = _objectSpread(_objectSpread({}, state.annotation.data), {}, {
|
|
24
23
|
handles: _objectSpread(_objectSpread({}, state.annotation.data.handles), {}, {
|
|
25
24
|
points: [worldCoords[0], worldCoords[1], worldCoords[2], worldCoords[3]]
|
|
@@ -37,28 +36,26 @@ class CobbAngle extends BaseAdapter3D {
|
|
|
37
36
|
}
|
|
38
37
|
static getTID300RepresentationArguments(tool) {
|
|
39
38
|
let is3DMeasurement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
handles
|
|
49
|
-
} = data;
|
|
50
|
-
const {
|
|
51
|
-
referencedImageId
|
|
52
|
-
} = metadata;
|
|
39
|
+
const data = tool.data,
|
|
40
|
+
finding = tool.finding,
|
|
41
|
+
findingSites = tool.findingSites,
|
|
42
|
+
metadata = tool.metadata;
|
|
43
|
+
const _data$cachedStats = data.cachedStats,
|
|
44
|
+
cachedStats = _data$cachedStats === void 0 ? {} : _data$cachedStats,
|
|
45
|
+
handles = data.handles;
|
|
46
|
+
const referencedImageId = metadata.referencedImageId;
|
|
53
47
|
const scoordProps = {
|
|
54
48
|
is3DMeasurement,
|
|
55
49
|
referencedImageId
|
|
56
50
|
};
|
|
57
51
|
const points = toScoords(scoordProps, handles.points);
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
52
|
+
const _points = _slicedToArray(points, 4),
|
|
53
|
+
point1 = _points[0],
|
|
54
|
+
point2 = _points[1],
|
|
55
|
+
point3 = _points[2],
|
|
56
|
+
point4 = _points[3];
|
|
57
|
+
const _ref = cachedStats["imageId:".concat(referencedImageId)] || {},
|
|
58
|
+
angle = _ref.angle;
|
|
62
59
|
return {
|
|
63
60
|
point1,
|
|
64
61
|
point2,
|
|
@@ -1,23 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { sr, utilities } from 'dcmjs';
|
|
2
2
|
import { CONTROL_POINTS_CODE, SPLINE_TYPE_CODE } from './constants/index.js';
|
|
3
3
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
} = sr;
|
|
7
|
-
const {
|
|
8
|
-
Polyline: TID300Polyline
|
|
9
|
-
} = utilities.TID300;
|
|
4
|
+
const valueTypes = sr.valueTypes;
|
|
5
|
+
const TID300Polyline = utilities.TID300.Polyline;
|
|
10
6
|
class ControlPointPolyline extends TID300Polyline {
|
|
11
7
|
contentItem() {
|
|
12
8
|
const contentEntries = super.contentItem();
|
|
13
9
|
const self = this;
|
|
14
|
-
const
|
|
15
|
-
controlPoints,
|
|
16
|
-
use3DSpatialCoordinates,
|
|
17
|
-
ReferencedSOPSequence,
|
|
18
|
-
ReferencedFrameOfReferenceUID,
|
|
19
|
-
use3DSpatialCoordinates
|
|
20
|
-
} = self.props;
|
|
10
|
+
const _self$props = self.props,
|
|
11
|
+
controlPoints = _self$props.controlPoints,
|
|
12
|
+
use3DSpatialCoordinates = _self$props.use3DSpatialCoordinates,
|
|
13
|
+
ReferencedSOPSequence = _self$props.ReferencedSOPSequence,
|
|
14
|
+
ReferencedFrameOfReferenceUID = _self$props.ReferencedFrameOfReferenceUID,
|
|
15
|
+
is3DMeasurement = _self$props.use3DSpatialCoordinates;
|
|
21
16
|
if (!(controlPoints !== null && controlPoints !== void 0 && controlPoints.length)) {
|
|
22
17
|
return contentEntries;
|
|
23
18
|
}
|
|
@@ -58,9 +53,7 @@ class ControlPointPolyline extends TID300Polyline {
|
|
|
58
53
|
ReferencedSOPSequence
|
|
59
54
|
}]
|
|
60
55
|
};
|
|
61
|
-
const
|
|
62
|
-
splineType
|
|
63
|
-
} = self.props;
|
|
56
|
+
const splineType = self.props.splineType;
|
|
64
57
|
const entries = contentEntries;
|
|
65
58
|
const numEntry = entries.find(e => e.ValueType === 'NUM');
|
|
66
59
|
if (numEntry) {
|
|
@@ -2,25 +2,23 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
2
2
|
import { utilities } from 'dcmjs';
|
|
3
3
|
import MeasurementReport from './MeasurementReport.js';
|
|
4
4
|
import BaseAdapter3D from './BaseAdapter3D.js';
|
|
5
|
+
import '../helpers/downloadDICOMData.js';
|
|
5
6
|
import { toScoord } from '../helpers/toScoordType.js';
|
|
6
|
-
import '
|
|
7
|
+
import '../helpers/scoordToWorld.js';
|
|
7
8
|
import { extractAllNUMGroups, restoreAdditionalMetrics } from './metricHandler.js';
|
|
8
9
|
|
|
9
10
|
var _EllipticalROI;
|
|
10
11
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11
12
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
|
-
const
|
|
13
|
-
Ellipse: TID300Ellipse
|
|
14
|
-
} = utilities.TID300;
|
|
13
|
+
const TID300Ellipse = utilities.TID300.Ellipse;
|
|
15
14
|
class EllipticalROI extends BaseAdapter3D {
|
|
16
15
|
static getMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata) {
|
|
17
|
-
const
|
|
18
|
-
state,
|
|
19
|
-
NUMGroup,
|
|
20
|
-
worldCoords,
|
|
21
|
-
referencedImageId,
|
|
22
|
-
ReferencedFrameNumber
|
|
23
|
-
} = MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, EllipticalROI.toolType);
|
|
16
|
+
const _MeasurementReport$ge = MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, EllipticalROI.toolType),
|
|
17
|
+
state = _MeasurementReport$ge.state,
|
|
18
|
+
NUMGroup = _MeasurementReport$ge.NUMGroup,
|
|
19
|
+
worldCoords = _MeasurementReport$ge.worldCoords,
|
|
20
|
+
referencedImageId = _MeasurementReport$ge.referencedImageId,
|
|
21
|
+
ReferencedFrameNumber = _MeasurementReport$ge.ReferencedFrameNumber;
|
|
24
22
|
const referencedSOPInstanceUID = state.sopInstanceUid;
|
|
25
23
|
const allNUMGroups = extractAllNUMGroups(MeasurementGroup, referencedSOPInstanceUID);
|
|
26
24
|
const measurementNUMGroups = allNUMGroups[referencedSOPInstanceUID] || {};
|
|
@@ -39,20 +37,15 @@ class EllipticalROI extends BaseAdapter3D {
|
|
|
39
37
|
}
|
|
40
38
|
static getTID300RepresentationArguments(tool) {
|
|
41
39
|
let is3DMeasurement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
cachedStats = {},
|
|
50
|
-
handles
|
|
51
|
-
} = data;
|
|
40
|
+
const data = tool.data,
|
|
41
|
+
finding = tool.finding,
|
|
42
|
+
findingSites = tool.findingSites,
|
|
43
|
+
metadata = tool.metadata;
|
|
44
|
+
const _data$cachedStats = data.cachedStats,
|
|
45
|
+
cachedStats = _data$cachedStats === void 0 ? {} : _data$cachedStats,
|
|
46
|
+
handles = data.handles;
|
|
52
47
|
const rotation = data.initialRotation || 0;
|
|
53
|
-
const
|
|
54
|
-
referencedImageId
|
|
55
|
-
} = metadata;
|
|
48
|
+
const referencedImageId = metadata.referencedImageId;
|
|
56
49
|
const scoordProps = {
|
|
57
50
|
is3DMeasurement,
|
|
58
51
|
referencedImageId
|
|
@@ -77,15 +70,14 @@ class EllipticalROI extends BaseAdapter3D {
|
|
|
77
70
|
} else {
|
|
78
71
|
points.push(left, right, top, bottom);
|
|
79
72
|
}
|
|
80
|
-
const {
|
|
81
|
-
area,
|
|
82
|
-
max,
|
|
83
|
-
min,
|
|
84
|
-
mean,
|
|
85
|
-
stdDev,
|
|
86
|
-
modalityUnit,
|
|
87
|
-
areaUnit
|
|
88
|
-
} = cachedStats["imageId:".concat(referencedImageId)] || {};
|
|
73
|
+
const _ref = cachedStats["imageId:".concat(referencedImageId)] || {},
|
|
74
|
+
area = _ref.area,
|
|
75
|
+
max = _ref.max,
|
|
76
|
+
min = _ref.min,
|
|
77
|
+
mean = _ref.mean,
|
|
78
|
+
stdDev = _ref.stdDev,
|
|
79
|
+
modalityUnit = _ref.modalityUnit,
|
|
80
|
+
areaUnit = _ref.areaUnit;
|
|
89
81
|
const convertedPoints = points.map(point => toScoord(scoordProps, point));
|
|
90
82
|
return {
|
|
91
83
|
area,
|
|
@@ -2,23 +2,17 @@ import { utilities } from 'dcmjs';
|
|
|
2
2
|
import Probe from './Probe.js';
|
|
3
3
|
|
|
4
4
|
var _KeyImage;
|
|
5
|
-
const
|
|
6
|
-
Point: TID300Point
|
|
7
|
-
} = utilities.TID300;
|
|
5
|
+
const TID300Point = utilities.TID300.Point;
|
|
8
6
|
class KeyImage extends Probe {
|
|
9
7
|
static getMeasurementData(measurementGroup, sopInstanceUIDToImageIdMap, metadata, trackingIdentifier) {
|
|
10
8
|
const baseData = super.getMeasurementData(measurementGroup, sopInstanceUIDToImageIdMap, metadata, trackingIdentifier);
|
|
11
|
-
const
|
|
12
|
-
data
|
|
13
|
-
} = baseData.annotation;
|
|
9
|
+
const data = baseData.annotation.data;
|
|
14
10
|
data.isPoint = trackingIdentifier.indexOf('Point') !== -1;
|
|
15
11
|
return baseData;
|
|
16
12
|
}
|
|
17
13
|
static getTID300RepresentationArguments(tool) {
|
|
18
14
|
const tid300Arguments = super.getTID300RepresentationArguments(tool);
|
|
19
|
-
const
|
|
20
|
-
data
|
|
21
|
-
} = tool;
|
|
15
|
+
const data = tool.data;
|
|
22
16
|
if (data.isPoint) {
|
|
23
17
|
if (data.seriesLevel) {
|
|
24
18
|
tid300Arguments.trackingIdentifierTextValue = this.trackingSeriesPointIdentifier;
|