@cornerstonejs/adapters 2.0.0-beta.25 → 2.0.0-beta.27

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.
Files changed (50) hide show
  1. package/dist/esm/adapters/Cornerstone/Angle.d.ts +0 -3
  2. package/dist/esm/adapters/Cornerstone/CircleRoi.d.ts +0 -7
  3. package/dist/esm/adapters/Cornerstone/MeasurementReport.d.ts +0 -7
  4. package/dist/esm/adapters/Cornerstone/ParametricMap.js +2 -8
  5. package/dist/esm/adapters/Cornerstone/Segmentation.d.ts +0 -31
  6. package/dist/esm/adapters/Cornerstone/Segmentation_3X.d.ts +0 -32
  7. package/dist/esm/adapters/Cornerstone/Segmentation_4X.d.ts +0 -41
  8. package/dist/esm/adapters/Cornerstone/Segmentation_4X.js +0 -1
  9. package/dist/esm/adapters/Cornerstone3D/Angle.js +9 -10
  10. package/dist/esm/adapters/Cornerstone3D/Bidirectional.js +8 -7
  11. package/dist/esm/adapters/Cornerstone3D/CircleROI.d.ts +0 -7
  12. package/dist/esm/adapters/Cornerstone3D/CircleROI.js +9 -16
  13. package/dist/esm/adapters/Cornerstone3D/CobbAngle.js +9 -9
  14. package/dist/esm/adapters/Cornerstone3D/EllipticalROI.js +8 -18
  15. package/dist/esm/adapters/Cornerstone3D/MeasurementReport.d.ts +0 -7
  16. package/dist/esm/adapters/Cornerstone3D/MeasurementReport.js +7 -40
  17. package/dist/esm/adapters/Cornerstone3D/PlanarFreehandROI.d.ts +0 -2
  18. package/dist/esm/adapters/Cornerstone3D/PlanarFreehandROI.js +9 -12
  19. package/dist/esm/adapters/Cornerstone3D/RTStruct/RTSS.d.ts +0 -23
  20. package/dist/esm/adapters/Cornerstone3D/RTStruct/RTSS.js +1 -76
  21. package/dist/esm/adapters/Cornerstone3D/RectangleROI.js +8 -6
  22. package/dist/esm/adapters/Cornerstone3D/Segmentation/generateLabelMaps2DFrom3D.d.ts +0 -6
  23. package/dist/esm/adapters/Cornerstone3D/Segmentation/generateLabelMaps2DFrom3D.js +0 -11
  24. package/dist/esm/adapters/Cornerstone3D/Segmentation/generateSegmentation.d.ts +0 -6
  25. package/dist/esm/adapters/Cornerstone3D/Segmentation/generateSegmentation.js +0 -18
  26. package/dist/esm/adapters/Cornerstone3D/Segmentation/generateToolState.d.ts +0 -14
  27. package/dist/esm/adapters/Cornerstone3D/Segmentation/generateToolState.js +0 -14
  28. package/dist/esm/adapters/Cornerstone3D/UltrasoundDirectional.js +9 -9
  29. package/dist/esm/adapters/Cornerstone3D/isValidCornerstoneTrackingIdentifier.js +0 -2
  30. package/dist/esm/adapters/VTKjs/Segmentation.d.ts +0 -38
  31. package/dist/esm/adapters/enums/Events.d.ts +0 -6
  32. package/dist/esm/adapters/enums/Events.js +0 -6
  33. package/dist/esm/adapters/helpers/checkIfPerpendicular.d.ts +0 -8
  34. package/dist/esm/adapters/helpers/checkIfPerpendicular.js +0 -8
  35. package/dist/esm/adapters/helpers/checkOrientation.js +0 -2
  36. package/dist/esm/adapters/helpers/codeMeaningEquals.d.ts +0 -7
  37. package/dist/esm/adapters/helpers/codeMeaningEquals.js +0 -7
  38. package/dist/esm/adapters/helpers/compareArrays.d.ts +0 -8
  39. package/dist/esm/adapters/helpers/compareArrays.js +0 -8
  40. package/dist/esm/adapters/helpers/downloadDICOMData.d.ts +0 -5
  41. package/dist/esm/adapters/helpers/downloadDICOMData.js +0 -5
  42. package/dist/esm/adapters/helpers/getDatasetsFromImages.d.ts +0 -8
  43. package/dist/esm/adapters/helpers/getDatasetsFromImages.js +0 -8
  44. package/dist/esm/adapters/helpers/graphicTypeEquals.d.ts +0 -5
  45. package/dist/esm/adapters/helpers/graphicTypeEquals.js +0 -5
  46. package/dist/esm/adapters/index.js +0 -1
  47. package/dist/umd/adapters.umd.js +74 -301
  48. package/dist/umd/adapters.umd.js.map +1 -1
  49. package/package.json +41 -16
  50. package/dist/esm/node_modules/lodash.clonedeep/index.js +0 -1692
@@ -1,8 +1,5 @@
1
1
  export default Angle;
2
2
  declare class Angle {
3
- /**
4
- * Generate TID300 measurement data for a plane angle measurement - use a Angle, but label it as Angle
5
- */
6
3
  static getMeasurementData(MeasurementGroup: any): {
7
4
  rAngle: any;
8
5
  toolType: string;
@@ -1,6 +1,5 @@
1
1
  export default CircleRoi;
2
2
  declare class CircleRoi {
3
- /** Gets the measurement data for cornerstone, given DICOM SR measurement data. */
4
3
  static getMeasurementData(MeasurementGroup: any): {
5
4
  toolType: string;
6
5
  active: boolean;
@@ -39,12 +38,6 @@ declare class CircleRoi {
39
38
  finding: any;
40
39
  findingSites: any[];
41
40
  };
42
- /**
43
- * Gets the TID 300 representation of a circle, given the cornerstone representation.
44
- *
45
- * @param {Object} tool
46
- * @returns
47
- */
48
41
  static getTID300RepresentationArguments(tool: any): {
49
42
  area: any;
50
43
  perimeter: number;
@@ -16,13 +16,6 @@ declare class MeasurementReport {
16
16
  ReferencedFrameNumber: any;
17
17
  };
18
18
  static generateReport(toolState: any, metadataProvider: any, options: any): any;
19
- /**
20
- * Generate Cornerstone tool state from dataset
21
- * @param {object} dataset dataset
22
- * @param {object} hooks
23
- * @param {function} hooks.getToolClass Function to map dataset to a tool class
24
- * @returns
25
- */
26
19
  static generateToolState(dataset: object, hooks?: {
27
20
  getToolClass: Function;
28
21
  }): {};
@@ -36,12 +36,10 @@ function _generateToolState() {
36
36
  if (!imagePlaneModule) {
37
37
  console.warn("Insufficient metadata, imagePlaneModule missing.");
38
38
  }
39
- ImageOrientationPatient = Array.isArray(imagePlaneModule.rowCosines) ? [].concat(_toConsumableArray(imagePlaneModule.rowCosines), _toConsumableArray(imagePlaneModule.columnCosines)) : [imagePlaneModule.rowCosines.x, imagePlaneModule.rowCosines.y, imagePlaneModule.rowCosines.z, imagePlaneModule.columnCosines.x, imagePlaneModule.columnCosines.y, imagePlaneModule.columnCosines.z]; // It currently supports parametric maps with same orientation
39
+ ImageOrientationPatient = Array.isArray(imagePlaneModule.rowCosines) ? [].concat(_toConsumableArray(imagePlaneModule.rowCosines), _toConsumableArray(imagePlaneModule.columnCosines)) : [imagePlaneModule.rowCosines.x, imagePlaneModule.rowCosines.y, imagePlaneModule.rowCosines.z, imagePlaneModule.columnCosines.x, imagePlaneModule.columnCosines.y, imagePlaneModule.columnCosines.z];
40
40
  validOrientations = [ImageOrientationPatient];
41
41
  pixelData = getPixelData(multiframe);
42
- orientation = checkOrientation(multiframe, validOrientations, [imagePlaneModule.rows, imagePlaneModule.columns, imageIds.length], tolerance); // Pre-compute the sop UID to imageId index map so that in the for loop
43
- // we don't have to call metadataProvider.get() for each imageId over
44
- // and over again.
42
+ orientation = checkOrientation(multiframe, validOrientations, [imagePlaneModule.rows, imagePlaneModule.columns, imageIds.length], tolerance);
45
43
  sopUIDImageIdIndexMap = imageIds.reduce(function (acc, imageId) {
46
44
  var _metadataProvider$get = metadataProvider.get("generalImageModule", imageId),
47
45
  sopInstanceUID = _metadataProvider$get.sopInstanceUID;
@@ -58,8 +56,6 @@ function _generateToolState() {
58
56
  };
59
57
  throw new Error("Parametric maps ".concat(orientationText[orientation], " to the acquisition plane of the source data are not yet supported."));
60
58
  case 15:
61
- // Pre-compute the indices and metadata so that we don't have to call
62
- // a function for each imageId in the for loop.
63
59
  imageIdMaps = imageIds.reduce(function (acc, curr, index) {
64
60
  acc.indices[curr] = index;
65
61
  acc.metadata[curr] = metadataProvider.get("instance", curr);
@@ -103,8 +99,6 @@ function insertPixelDataPlanar(sourcePixelData, multiframe, imageIds, metadataPr
103
99
  var imageIdIndex = imageIdMaps.indices[imageId];
104
100
  var byteOffset = sliceLength * imageIdIndex * targetPixelData.BYTES_PER_ELEMENT;
105
101
  var targetSliceDataView = new targetPixelData.constructor(targetPixelData.buffer, byteOffset, sliceLength);
106
- // Copy from source to target which works for parametric maps with same orientation.
107
- // TODO: Find a dataset with parametric map in a different orientation and add finish this implementation
108
102
  targetSliceDataView.set(sourceSliceDataView);
109
103
  }
110
104
  return targetPixelData;
@@ -4,41 +4,10 @@ declare namespace Segmentation {
4
4
  export { generateToolState };
5
5
  export { fillSegmentation };
6
6
  }
7
- /**
8
- * generateSegmentation - Generates a DICOM Segmentation object given cornerstoneTools data.
9
- *
10
- * @param {object[]} images An array of the cornerstone image objects.
11
- * @param {Object|Object[]} labelmaps3DorBrushData For 4.X: The cornerstone `Labelmap3D` object, or an array of objects.
12
- * For 3.X: the BrushData.
13
- * @param {number} cornerstoneToolsVersion The cornerstoneTools major version to map against.
14
- * @returns {Object}
15
- */
16
7
  declare function generateSegmentation(images: object[], labelmaps3DorBrushData: any | any[], options?: {
17
8
  includeSliceSpacing: boolean;
18
9
  }, cornerstoneToolsVersion?: number): any;
19
- /**
20
- * generateToolState - Given a set of cornrstoneTools imageIds and a Segmentation buffer,
21
- * derive cornerstoneTools toolState and brush metadata.
22
- *
23
- * @param {string[]} imageIds An array of the imageIds.
24
- * @param {ArrayBuffer} arrayBuffer The SEG arrayBuffer.
25
- * @param {*} metadataProvider
26
- * @param {bool} skipOverlapping - skip checks for overlapping segs, default value false.
27
- * @param {number} tolerance - default value 1.e-3.
28
- * @param {number} cornerstoneToolsVersion - default value 4.
29
- *
30
- * @returns {Object} The toolState and an object from which the
31
- * segment metadata can be derived.
32
- */
33
10
  declare function generateToolState(imageIds: string[], arrayBuffer: ArrayBuffer, metadataProvider: any, skipOverlapping?: bool, tolerance?: number, cornerstoneToolsVersion?: number): any;
34
- /**
35
- * fillSegmentation - Fills a derived segmentation dataset with cornerstoneTools `LabelMap3D` data.
36
- *
37
- * @param {object[]} segmentation An empty segmentation derived dataset.
38
- * @param {Object|Object[]} inputLabelmaps3D The cornerstone `Labelmap3D` object, or an array of objects.
39
- * @param {Object} userOptions Options object to override default options.
40
- * @returns {Blob} description
41
- */
42
11
  declare function fillSegmentation(segmentation: object[], inputLabelmaps3D: any | any[], options?: {
43
12
  includeSliceSpacing: boolean;
44
13
  }, cornerstoneToolsVersion?: number): Blob;
@@ -1,45 +1,13 @@
1
1
  export default Segmentation;
2
2
  export type BrushData = {
3
- /**
4
- * - The cornerstoneTools global toolState.
5
- */
6
3
  toolState: any;
7
- /**
8
- * - The cornerstoneTools segment metadata that corresponds to the
9
- * seriesInstanceUid.
10
- */
11
4
  segments: any[];
12
5
  };
13
6
  declare namespace Segmentation {
14
7
  export { generateSegmentation };
15
8
  export { generateToolState };
16
9
  }
17
- /**
18
- *
19
- * @typedef {Object} BrushData
20
- * @property {Object} toolState - The cornerstoneTools global toolState.
21
- * @property {Object[]} segments - The cornerstoneTools segment metadata that corresponds to the
22
- * seriesInstanceUid.
23
- */
24
- /**
25
- * generateSegmentation - Generates cornerstoneTools brush data, given a stack of
26
- * imageIds, images and the cornerstoneTools brushData.
27
- *
28
- * @param {object[]} images An array of the cornerstone image objects.
29
- * @param {BrushData} brushData and object containing the brushData.
30
- * @returns {type} description
31
- */
32
10
  declare function generateSegmentation(images: object[], brushData: BrushData, options?: {
33
11
  includeSliceSpacing: boolean;
34
12
  }): type;
35
- /**
36
- * generateToolState - Given a set of cornrstoneTools imageIds and a Segmentation buffer,
37
- * derive cornerstoneTools toolState and brush metadata.
38
- *
39
- * @param {string[]} imageIds An array of the imageIds.
40
- * @param {ArrayBuffer} arrayBuffer The SEG arrayBuffer.
41
- * @param {*} metadataProvider
42
- * @returns {Object} The toolState and an object from which the
43
- * segment metadata can be derived.
44
- */
45
13
  declare function generateToolState(imageIds: string[], arrayBuffer: ArrayBuffer, metadataProvider: any): any;
@@ -1,13 +1,6 @@
1
1
  export default Segmentation;
2
2
  export type BrushData = {
3
- /**
4
- * - The cornerstoneTools global toolState.
5
- */
6
3
  toolState: any;
7
- /**
8
- * - The cornerstoneTools segment metadata that corresponds to the
9
- * seriesInstanceUid.
10
- */
11
4
  segments: any[];
12
5
  };
13
6
  declare namespace Segmentation {
@@ -15,40 +8,6 @@ declare namespace Segmentation {
15
8
  export { generateToolState };
16
9
  export { fillSegmentation };
17
10
  }
18
- /**
19
- * Fills a given segmentation object with data from the input labelmaps3D
20
- *
21
- * @param segmentation - The segmentation object to be filled.
22
- * @param inputLabelmaps3D - An array of 3D labelmaps, or a single 3D labelmap.
23
- * @param userOptions - Optional configuration settings. Will override the default options.
24
- *
25
- * @returns {object} The filled segmentation object.
26
- */
27
11
  export function fillSegmentation(segmentation: any, inputLabelmaps3D: any, userOptions?: {}): object;
28
- /**
29
- * generateSegmentation - Generates cornerstoneTools brush data, given a stack of
30
- * imageIds, images and the cornerstoneTools brushData.
31
- *
32
- * @param {object[]} images An array of cornerstone images that contain the source
33
- * data under `image.data.byteArray.buffer`.
34
- * @param {Object|Object[]} inputLabelmaps3D The cornerstone `Labelmap3D` object, or an array of objects.
35
- * @param {Object} userOptions Options to pass to the segmentation derivation and `fillSegmentation`.
36
- * @returns {Blob}
37
- */
38
12
  export function generateSegmentation(images: object[], inputLabelmaps3D: any | any[], userOptions?: any): Blob;
39
- /**
40
- * generateToolState - Given a set of cornrstoneTools imageIds and a Segmentation buffer,
41
- * derive cornerstoneTools toolState and brush metadata.
42
- *
43
- * @param {string[]} imageIds - An array of the imageIds.
44
- * @param {ArrayBuffer} arrayBuffer - The SEG arrayBuffer.
45
- * @param {*} metadataProvider.
46
- * @param {obj} options - Options object.
47
- *
48
- * @return {[]ArrayBuffer}a list of array buffer for each labelMap
49
- * @return {Object} an object from which the segment metadata can be derived
50
- * @return {[][][]} 2D list containing the track of segments per frame
51
- * @return {[][][]} 3D list containing the track of segments per frame for each labelMap
52
- * (available only for the overlapping case).
53
- */
54
13
  export function generateToolState(imageIds: string[], arrayBuffer: ArrayBuffer, metadataProvider: any, options: obj): [];
@@ -1,7 +1,6 @@
1
1
  import { asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime, toConsumableArray as _toConsumableArray, createForOfIteratorHelper as _createForOfIteratorHelper, slicedToArray as _slicedToArray } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
2
  import { utilities, data, normalizers, derivations, log } from 'dcmjs';
3
3
  import ndarray from 'ndarray';
4
- import '../../node_modules/lodash.clonedeep/index.js';
5
4
  import getDatasetsFromImages from '../helpers/getDatasetsFromImages.js';
6
5
  import checkOrientation from '../helpers/checkOrientation.js';
7
6
  import compareArrays from '../helpers/compareArrays.js';
@@ -1,8 +1,9 @@
1
- import { defineProperty as _defineProperty, createClass as _createClass, slicedToArray as _slicedToArray, classCallCheck as _classCallCheck } from '../../_virtual/_rollupPluginBabelHelpers.js';
1
+ import { slicedToArray as _slicedToArray, createClass as _createClass, defineProperty as _defineProperty, classCallCheck as _classCallCheck } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
2
  import { utilities } from 'dcmjs';
3
3
  import CORNERSTONE_3D_TAG from './cornerstone3DTag.js';
4
4
  import MeasurementReport from './MeasurementReport.js';
5
5
 
6
+ var _Angle;
6
7
  var TID300CobbAngle = utilities.TID300.CobbAngle;
7
8
  var MEASUREMENT_TYPE = "Angle";
8
9
  var trackingIdentifierTextValue = "".concat(CORNERSTONE_3D_TAG, ":").concat(MEASUREMENT_TYPE);
@@ -12,9 +13,7 @@ var Angle = /*#__PURE__*/function () {
12
13
  }
13
14
  return _createClass(Angle, null, [{
14
15
  key: "getMeasurementData",
15
- value:
16
- // TODO: this function is required for all Cornerstone Tool Adapters, since it is called by MeasurementReport.
17
- function getMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, imageToWorldCoords, metadata) {
16
+ value: function getMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, imageToWorldCoords, metadata) {
18
17
  var _MeasurementReport$ge = MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, Angle.toolType),
19
18
  defaultState = _MeasurementReport$ge.defaultState,
20
19
  NUMGroup = _MeasurementReport$ge.NUMGroup,
@@ -75,7 +74,6 @@ var Angle = /*#__PURE__*/function () {
75
74
  };
76
75
  var _ref = cachedStats["imageId:".concat(referencedImageId)] || {},
77
76
  angle = _ref.angle;
78
- // Represented as a cobb angle
79
77
  return {
80
78
  point1: point1,
81
79
  point2: point2,
@@ -89,10 +87,11 @@ var Angle = /*#__PURE__*/function () {
89
87
  }
90
88
  }]);
91
89
  }();
92
- _defineProperty(Angle, "toolType", MEASUREMENT_TYPE);
93
- _defineProperty(Angle, "utilityToolType", MEASUREMENT_TYPE);
94
- _defineProperty(Angle, "TID300Representation", TID300CobbAngle);
95
- _defineProperty(Angle, "isValidCornerstoneTrackingIdentifier", function (TrackingIdentifier) {
90
+ _Angle = Angle;
91
+ _Angle.toolType = MEASUREMENT_TYPE;
92
+ _Angle.utilityToolType = MEASUREMENT_TYPE;
93
+ _Angle.TID300Representation = TID300CobbAngle;
94
+ _Angle.isValidCornerstoneTrackingIdentifier = function (TrackingIdentifier) {
96
95
  if (!TrackingIdentifier.includes(":")) {
97
96
  return false;
98
97
  }
@@ -104,7 +103,7 @@ _defineProperty(Angle, "isValidCornerstoneTrackingIdentifier", function (Trackin
104
103
  return false;
105
104
  }
106
105
  return toolType === MEASUREMENT_TYPE;
107
- });
106
+ };
108
107
  MeasurementReport.registerTool(Angle);
109
108
 
110
109
  export { Angle as default };
@@ -1,10 +1,11 @@
1
- import { defineProperty as _defineProperty, createClass as _createClass, slicedToArray as _slicedToArray, classCallCheck as _classCallCheck } from '../../_virtual/_rollupPluginBabelHelpers.js';
1
+ import { slicedToArray as _slicedToArray, createClass as _createClass, defineProperty as _defineProperty, classCallCheck as _classCallCheck } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
2
  import { utilities } from 'dcmjs';
3
3
  import CORNERSTONE_3D_TAG from './cornerstone3DTag.js';
4
4
  import MeasurementReport from './MeasurementReport.js';
5
5
  import { toArray } from '../helpers/toArray.js';
6
6
  import '../helpers/downloadDICOMData.js';
7
7
 
8
+ var _Bidirectional;
8
9
  var TID300Bidirectional = utilities.TID300.Bidirectional;
9
10
  var BIDIRECTIONAL = "Bidirectional";
10
11
  var LONG_AXIS = "Long Axis";
@@ -77,7 +78,6 @@ var Bidirectional = /*#__PURE__*/function () {
77
78
  length = _ref.length,
78
79
  width = _ref.width;
79
80
  var points = handles.points;
80
- // Find the length and width point pairs by comparing the distances of the points at 0,1 to points at 2,3
81
81
  var firstPointPairs = [points[0], points[1]];
82
82
  var secondPointPairs = [points[2], points[3]];
83
83
  var 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));
@@ -125,10 +125,11 @@ var Bidirectional = /*#__PURE__*/function () {
125
125
  }
126
126
  }]);
127
127
  }();
128
- _defineProperty(Bidirectional, "toolType", BIDIRECTIONAL);
129
- _defineProperty(Bidirectional, "utilityToolType", BIDIRECTIONAL);
130
- _defineProperty(Bidirectional, "TID300Representation", TID300Bidirectional);
131
- _defineProperty(Bidirectional, "isValidCornerstoneTrackingIdentifier", function (TrackingIdentifier) {
128
+ _Bidirectional = Bidirectional;
129
+ _Bidirectional.toolType = BIDIRECTIONAL;
130
+ _Bidirectional.utilityToolType = BIDIRECTIONAL;
131
+ _Bidirectional.TID300Representation = TID300Bidirectional;
132
+ _Bidirectional.isValidCornerstoneTrackingIdentifier = function (TrackingIdentifier) {
132
133
  if (!TrackingIdentifier.includes(":")) {
133
134
  return false;
134
135
  }
@@ -140,7 +141,7 @@ _defineProperty(Bidirectional, "isValidCornerstoneTrackingIdentifier", function
140
141
  return false;
141
142
  }
142
143
  return toolType === BIDIRECTIONAL;
143
- });
144
+ };
144
145
  MeasurementReport.registerTool(Bidirectional);
145
146
 
146
147
  export { Bidirectional as default };
@@ -5,7 +5,6 @@ declare class CircleROI {
5
5
  static utilityToolType: string;
6
6
  static TID300Representation: any;
7
7
  static isValidCornerstoneTrackingIdentifier: typeof isValidCornerstoneTrackingIdentifier;
8
- /** Gets the measurement data for cornerstone, given DICOM SR measurement data. */
9
8
  static getMeasurementData(MeasurementGroup: any, sopInstanceUIDToImageIdMap: any, imageToWorldCoords: any, metadata: any): {
10
9
  description: any;
11
10
  sopInstanceUid: any;
@@ -22,12 +21,6 @@ declare class CircleROI {
22
21
  finding: any;
23
22
  findingSites: any[];
24
23
  };
25
- /**
26
- * Gets the TID 300 representation of a circle, given the cornerstone representation.
27
- *
28
- * @param {Object} tool
29
- * @returns
30
- */
31
24
  static getTID300RepresentationArguments(tool: any, worldToImageCoords: any): {
32
25
  area: any;
33
26
  perimeter: number;
@@ -1,9 +1,10 @@
1
- import { defineProperty as _defineProperty, createClass as _createClass, classCallCheck as _classCallCheck } from '../../_virtual/_rollupPluginBabelHelpers.js';
1
+ import { createClass as _createClass, defineProperty as _defineProperty, classCallCheck as _classCallCheck } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
2
  import { utilities } from 'dcmjs';
3
3
  import MeasurementReport from './MeasurementReport.js';
4
4
  import CORNERSTONE_3D_TAG from './cornerstone3DTag.js';
5
5
  import isValidCornerstoneTrackingIdentifier from './isValidCornerstoneTrackingIdentifier.js';
6
6
 
7
+ var _CircleROI;
7
8
  var TID300Circle = utilities.TID300.Circle;
8
9
  var CIRCLEROI = "CircleROI";
9
10
  var CircleROI = /*#__PURE__*/function () {
@@ -12,8 +13,7 @@ var CircleROI = /*#__PURE__*/function () {
12
13
  }
13
14
  return _createClass(CircleROI, null, [{
14
15
  key: "getMeasurementData",
15
- value: /** Gets the measurement data for cornerstone, given DICOM SR measurement data. */
16
- function getMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, imageToWorldCoords, metadata) {
16
+ value: function getMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, imageToWorldCoords, metadata) {
17
17
  var _MeasurementReport$ge = MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, CircleROI.toolType),
18
18
  defaultState = _MeasurementReport$ge.defaultState,
19
19
  NUMGroup = _MeasurementReport$ge.NUMGroup,
@@ -21,7 +21,6 @@ var CircleROI = /*#__PURE__*/function () {
21
21
  ReferencedFrameNumber = _MeasurementReport$ge.ReferencedFrameNumber;
22
22
  var referencedImageId = defaultState.annotation.metadata.referencedImageId;
23
23
  var GraphicData = SCOORDGroup.GraphicData;
24
- // GraphicData is ordered as [centerX, centerY, endX, endY]
25
24
  var pointsWorld = [];
26
25
  for (var i = 0; i < GraphicData.length; i += 2) {
27
26
  var worldPos = imageToWorldCoords(referencedImageId, [GraphicData[i], GraphicData[i + 1]]);
@@ -38,7 +37,6 @@ var CircleROI = /*#__PURE__*/function () {
38
37
  },
39
38
  cachedStats: _defineProperty({}, "imageId:".concat(referencedImageId), {
40
39
  area: NUMGroup ? NUMGroup.MeasuredValueSequence.NumericValue : 0,
41
- // Dummy values to be updated by cornerstone
42
40
  radius: 0,
43
41
  perimeter: 0
44
42
  }),
@@ -46,12 +44,6 @@ var CircleROI = /*#__PURE__*/function () {
46
44
  };
47
45
  return state;
48
46
  }
49
- /**
50
- * Gets the TID 300 representation of a circle, given the cornerstone representation.
51
- *
52
- * @param {Object} tool
53
- * @returns
54
- */
55
47
  }, {
56
48
  key: "getTID300RepresentationArguments",
57
49
  value: function getTID300RepresentationArguments(tool, worldToImageCoords) {
@@ -93,11 +85,12 @@ var CircleROI = /*#__PURE__*/function () {
93
85
  }
94
86
  }]);
95
87
  }();
96
- _defineProperty(CircleROI, "trackingIdentifierTextValue", "".concat(CORNERSTONE_3D_TAG, ":").concat(CIRCLEROI));
97
- _defineProperty(CircleROI, "toolType", CIRCLEROI);
98
- _defineProperty(CircleROI, "utilityToolType", CIRCLEROI);
99
- _defineProperty(CircleROI, "TID300Representation", TID300Circle);
100
- _defineProperty(CircleROI, "isValidCornerstoneTrackingIdentifier", isValidCornerstoneTrackingIdentifier);
88
+ _CircleROI = CircleROI;
89
+ _CircleROI.trackingIdentifierTextValue = "".concat(CORNERSTONE_3D_TAG, ":").concat(CIRCLEROI);
90
+ _CircleROI.toolType = CIRCLEROI;
91
+ _CircleROI.utilityToolType = CIRCLEROI;
92
+ _CircleROI.TID300Representation = TID300Circle;
93
+ _CircleROI.isValidCornerstoneTrackingIdentifier = isValidCornerstoneTrackingIdentifier;
101
94
  MeasurementReport.registerTool(CircleROI);
102
95
 
103
96
  export { CircleROI as default };
@@ -1,8 +1,9 @@
1
- import { defineProperty as _defineProperty, createClass as _createClass, slicedToArray as _slicedToArray, classCallCheck as _classCallCheck } from '../../_virtual/_rollupPluginBabelHelpers.js';
1
+ import { slicedToArray as _slicedToArray, createClass as _createClass, defineProperty as _defineProperty, classCallCheck as _classCallCheck } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
2
  import { utilities } from 'dcmjs';
3
3
  import CORNERSTONE_3D_TAG from './cornerstone3DTag.js';
4
4
  import MeasurementReport from './MeasurementReport.js';
5
5
 
6
+ var _CobbAngle;
6
7
  var TID300CobbAngle = utilities.TID300.CobbAngle;
7
8
  var MEASUREMENT_TYPE = "CobbAngle";
8
9
  var trackingIdentifierTextValue = "".concat(CORNERSTONE_3D_TAG, ":").concat(MEASUREMENT_TYPE);
@@ -12,9 +13,7 @@ var CobbAngle = /*#__PURE__*/function () {
12
13
  }
13
14
  return _createClass(CobbAngle, null, [{
14
15
  key: "getMeasurementData",
15
- value:
16
- // TODO: this function is required for all Cornerstone Tool Adapters, since it is called by MeasurementReport.
17
- function getMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, imageToWorldCoords, metadata) {
16
+ value: function getMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, imageToWorldCoords, metadata) {
18
17
  var _MeasurementReport$ge = MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, CobbAngle.toolType),
19
18
  defaultState = _MeasurementReport$ge.defaultState,
20
19
  NUMGroup = _MeasurementReport$ge.NUMGroup,
@@ -92,10 +91,11 @@ var CobbAngle = /*#__PURE__*/function () {
92
91
  }
93
92
  }]);
94
93
  }();
95
- _defineProperty(CobbAngle, "toolType", MEASUREMENT_TYPE);
96
- _defineProperty(CobbAngle, "utilityToolType", MEASUREMENT_TYPE);
97
- _defineProperty(CobbAngle, "TID300Representation", TID300CobbAngle);
98
- _defineProperty(CobbAngle, "isValidCornerstoneTrackingIdentifier", function (TrackingIdentifier) {
94
+ _CobbAngle = CobbAngle;
95
+ _CobbAngle.toolType = MEASUREMENT_TYPE;
96
+ _CobbAngle.utilityToolType = MEASUREMENT_TYPE;
97
+ _CobbAngle.TID300Representation = TID300CobbAngle;
98
+ _CobbAngle.isValidCornerstoneTrackingIdentifier = function (TrackingIdentifier) {
99
99
  if (!TrackingIdentifier.includes(":")) {
100
100
  return false;
101
101
  }
@@ -107,7 +107,7 @@ _defineProperty(CobbAngle, "isValidCornerstoneTrackingIdentifier", function (Tra
107
107
  return false;
108
108
  }
109
109
  return toolType === MEASUREMENT_TYPE;
110
- });
110
+ };
111
111
  MeasurementReport.registerTool(CobbAngle);
112
112
 
113
113
  export { CobbAngle as default };
@@ -1,10 +1,11 @@
1
- import { defineProperty as _defineProperty, createClass as _createClass, toConsumableArray as _toConsumableArray, classCallCheck as _classCallCheck } from '../../_virtual/_rollupPluginBabelHelpers.js';
1
+ import { createClass as _createClass, toConsumableArray as _toConsumableArray, defineProperty as _defineProperty, classCallCheck as _classCallCheck } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
2
  import { vec3 } from 'gl-matrix';
3
3
  import { utilities } from 'dcmjs';
4
4
  import CORNERSTONE_3D_TAG from './cornerstone3DTag.js';
5
5
  import MeasurementReport from './MeasurementReport.js';
6
6
  import isValidCornerstoneTrackingIdentifier from './isValidCornerstoneTrackingIdentifier.js';
7
7
 
8
+ var _EllipticalROI;
8
9
  var TID300Ellipse = utilities.TID300.Ellipse;
9
10
  var ELLIPTICALROI = "EllipticalROI";
10
11
  var EPSILON = 1e-4;
@@ -22,10 +23,6 @@ var EllipticalROI = /*#__PURE__*/function () {
22
23
  ReferencedFrameNumber = _MeasurementReport$ge.ReferencedFrameNumber;
23
24
  var referencedImageId = defaultState.annotation.metadata.referencedImageId;
24
25
  var GraphicData = SCOORDGroup.GraphicData;
25
- // GraphicData is ordered as [majorAxisStartX, majorAxisStartY, majorAxisEndX, majorAxisEndY, minorAxisStartX, minorAxisStartY, minorAxisEndX, minorAxisEndY]
26
- // But Cornerstone3D points are ordered as top, bottom, left, right for the
27
- // ellipse so we need to identify if the majorAxis is horizontal or vertical
28
- // in the image plane and then choose the correct points to use for the ellipse.
29
26
  var pointsWorld = [];
30
27
  for (var i = 0; i < GraphicData.length; i += 2) {
31
28
  var worldPos = imageToWorldCoords(referencedImageId, [GraphicData[i], GraphicData[i + 1]]);
@@ -37,7 +34,6 @@ var EllipticalROI = /*#__PURE__*/function () {
37
34
  var minorAxisEnd = vec3.fromValues.apply(vec3, _toConsumableArray(pointsWorld[3]));
38
35
  var majorAxisVec = vec3.create();
39
36
  vec3.sub(majorAxisVec, majorAxisEnd, majorAxisStart);
40
- // normalize majorAxisVec to avoid scaling issues
41
37
  vec3.normalize(majorAxisVec, majorAxisVec);
42
38
  var minorAxisVec = vec3.create();
43
39
  vec3.sub(minorAxisVec, minorAxisEnd, minorAxisStart);
@@ -47,7 +43,6 @@ var EllipticalROI = /*#__PURE__*/function () {
47
43
  throw new Error("imageId does not have imagePlaneModule metadata");
48
44
  }
49
45
  var columnCosines = imagePlaneModule.columnCosines;
50
- // find which axis is parallel to the columnCosines
51
46
  var columnCosinesVec = vec3.fromValues(columnCosines[0], columnCosines[1], columnCosines[2]);
52
47
  var projectedMajorAxisOnColVec = vec3.dot(columnCosinesVec, majorAxisVec);
53
48
  var projectedMinorAxisOnColVec = vec3.dot(columnCosinesVec, minorAxisVec);
@@ -93,7 +88,6 @@ var EllipticalROI = /*#__PURE__*/function () {
93
88
  throw new Error("EllipticalROI.getTID300RepresentationArguments: referencedImageId is not defined");
94
89
  }
95
90
  var top, bottom, left, right;
96
- // this way when it's restored we can assume the initial rotation is 0.
97
91
  if (rotation == 90 || rotation == 270) {
98
92
  bottom = worldToImageCoords(referencedImageId, handles.points[2]);
99
93
  top = worldToImageCoords(referencedImageId, handles.points[3]);
@@ -105,12 +99,10 @@ var EllipticalROI = /*#__PURE__*/function () {
105
99
  left = worldToImageCoords(referencedImageId, handles.points[2]);
106
100
  right = worldToImageCoords(referencedImageId, handles.points[3]);
107
101
  }
108
- // find the major axis and minor axis
109
102
  var topBottomLength = Math.abs(top[1] - bottom[1]);
110
103
  var leftRightLength = Math.abs(left[0] - right[0]);
111
104
  var points = [];
112
105
  if (topBottomLength > leftRightLength) {
113
- // major axis is bottom to top
114
106
  points.push({
115
107
  x: top[0],
116
108
  y: top[1]
@@ -119,7 +111,6 @@ var EllipticalROI = /*#__PURE__*/function () {
119
111
  x: bottom[0],
120
112
  y: bottom[1]
121
113
  });
122
- // minor axis is left to right
123
114
  points.push({
124
115
  x: left[0],
125
116
  y: left[1]
@@ -129,7 +120,6 @@ var EllipticalROI = /*#__PURE__*/function () {
129
120
  y: right[1]
130
121
  });
131
122
  } else {
132
- // major axis is left to right
133
123
  points.push({
134
124
  x: left[0],
135
125
  y: left[1]
@@ -138,7 +128,6 @@ var EllipticalROI = /*#__PURE__*/function () {
138
128
  x: right[0],
139
129
  y: right[1]
140
130
  });
141
- // minor axis is bottom to top
142
131
  points.push({
143
132
  x: top[0],
144
133
  y: top[1]
@@ -160,11 +149,12 @@ var EllipticalROI = /*#__PURE__*/function () {
160
149
  }
161
150
  }]);
162
151
  }();
163
- _defineProperty(EllipticalROI, "trackingIdentifierTextValue", "".concat(CORNERSTONE_3D_TAG, ":").concat(ELLIPTICALROI));
164
- _defineProperty(EllipticalROI, "toolType", ELLIPTICALROI);
165
- _defineProperty(EllipticalROI, "utilityToolType", ELLIPTICALROI);
166
- _defineProperty(EllipticalROI, "TID300Representation", TID300Ellipse);
167
- _defineProperty(EllipticalROI, "isValidCornerstoneTrackingIdentifier", isValidCornerstoneTrackingIdentifier);
152
+ _EllipticalROI = EllipticalROI;
153
+ _EllipticalROI.trackingIdentifierTextValue = "".concat(CORNERSTONE_3D_TAG, ":").concat(ELLIPTICALROI);
154
+ _EllipticalROI.toolType = ELLIPTICALROI;
155
+ _EllipticalROI.utilityToolType = ELLIPTICALROI;
156
+ _EllipticalROI.TID300Representation = TID300Ellipse;
157
+ _EllipticalROI.isValidCornerstoneTrackingIdentifier = isValidCornerstoneTrackingIdentifier;
168
158
  MeasurementReport.registerTool(EllipticalROI);
169
159
 
170
160
  export { EllipticalROI as default };
@@ -47,13 +47,6 @@ export default class MeasurementReport {
47
47
  ReferencedFrameNumber: any;
48
48
  };
49
49
  static generateReport(toolState: any, metadataProvider: any, worldToImageCoords: any, options: any): any;
50
- /**
51
- * Generate Cornerstone tool state from dataset
52
- */
53
50
  static generateToolState(dataset: any, sopInstanceUIDToImageIdMap: any, imageToWorldCoords: any, metadata: any, hooks: any): {};
54
- /**
55
- * Register a new tool type.
56
- * @param toolClass to perform I/O to DICOM for this tool
57
- */
58
51
  static registerTool(toolClass: any): void;
59
52
  }