@cornerstonejs/adapters 1.45.1 → 1.47.0

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.
@@ -847,7 +847,7 @@ MeasurementReport$1.CORNERSTONE_TOOL_CLASSES_BY_TOOL_TYPE = {};
847
847
 
848
848
  var CORNERSTONE_4_TAG = "cornerstoneTools@^4.0.0";
849
849
 
850
- var TID300Length$1 = utilities.TID300.Length;
850
+ var TID300Length$2 = utilities.TID300.Length;
851
851
  var LENGTH$1 = "Length";
852
852
  var Length$1 = /*#__PURE__*/function () {
853
853
  function Length() {
@@ -908,7 +908,7 @@ var Length$1 = /*#__PURE__*/function () {
908
908
  }();
909
909
  Length$1.toolType = LENGTH$1;
910
910
  Length$1.utilityToolType = LENGTH$1;
911
- Length$1.TID300Representation = TID300Length$1;
911
+ Length$1.TID300Representation = TID300Length$2;
912
912
  Length$1.isValidCornerstoneTrackingIdentifier = function (TrackingIdentifier) {
913
913
  if (!TrackingIdentifier.includes(":")) {
914
914
  return false;
@@ -3876,7 +3876,7 @@ var MeasurementReport = /** @class */ (function () {
3876
3876
 
3877
3877
  var TID300Point$1 = utilities.TID300.Point;
3878
3878
  var ARROW_ANNOTATE = "ArrowAnnotate";
3879
- var trackingIdentifierTextValue$7 = "".concat(CORNERSTONE_3D_TAG, ":").concat(ARROW_ANNOTATE);
3879
+ var trackingIdentifierTextValue$8 = "".concat(CORNERSTONE_3D_TAG, ":").concat(ARROW_ANNOTATE);
3880
3880
  var codeValues = CodingScheme.codeValues,
3881
3881
  CodingSchemeDesignator = CodingScheme.CodingSchemeDesignator;
3882
3882
  var ArrowAnnotate = /*#__PURE__*/function () {
@@ -3955,7 +3955,7 @@ var ArrowAnnotate = /*#__PURE__*/function () {
3955
3955
  x: pointImage[0],
3956
3956
  y: pointImage[1]
3957
3957
  }],
3958
- trackingIdentifierTextValue: trackingIdentifierTextValue$7,
3958
+ trackingIdentifierTextValue: trackingIdentifierTextValue$8,
3959
3959
  findingSites: findingSites || []
3960
3960
  };
3961
3961
 
@@ -3995,7 +3995,7 @@ var TID300Bidirectional = utilities.TID300.Bidirectional;
3995
3995
  var BIDIRECTIONAL = "Bidirectional";
3996
3996
  var LONG_AXIS = "Long Axis";
3997
3997
  var SHORT_AXIS = "Short Axis";
3998
- var trackingIdentifierTextValue$6 = "".concat(CORNERSTONE_3D_TAG, ":").concat(BIDIRECTIONAL);
3998
+ var trackingIdentifierTextValue$7 = "".concat(CORNERSTONE_3D_TAG, ":").concat(BIDIRECTIONAL);
3999
3999
  var Bidirectional = /** @class */ (function () {
4000
4000
  function Bidirectional() {
4001
4001
  }
@@ -4098,7 +4098,7 @@ var Bidirectional = /** @class */ (function () {
4098
4098
  },
4099
4099
  longAxisLength: length,
4100
4100
  shortAxisLength: width,
4101
- trackingIdentifierTextValue: trackingIdentifierTextValue$6,
4101
+ trackingIdentifierTextValue: trackingIdentifierTextValue$7,
4102
4102
  finding: finding,
4103
4103
  findingSites: findingSites || []
4104
4104
  };
@@ -4122,7 +4122,7 @@ MeasurementReport.registerTool(Bidirectional);
4122
4122
 
4123
4123
  var TID300CobbAngle$1 = utilities.TID300.CobbAngle;
4124
4124
  var MEASUREMENT_TYPE$1 = "Angle";
4125
- var trackingIdentifierTextValue$5 = "".concat(CORNERSTONE_3D_TAG, ":").concat(MEASUREMENT_TYPE$1);
4125
+ var trackingIdentifierTextValue$6 = "".concat(CORNERSTONE_3D_TAG, ":").concat(MEASUREMENT_TYPE$1);
4126
4126
  var Angle = /** @class */ (function () {
4127
4127
  function Angle() {
4128
4128
  }
@@ -4182,7 +4182,7 @@ var Angle = /** @class */ (function () {
4182
4182
  point3: point3,
4183
4183
  point4: point4,
4184
4184
  rAngle: angle,
4185
- trackingIdentifierTextValue: trackingIdentifierTextValue$5,
4185
+ trackingIdentifierTextValue: trackingIdentifierTextValue$6,
4186
4186
  finding: finding,
4187
4187
  findingSites: findingSites || []
4188
4188
  };
@@ -4206,7 +4206,7 @@ MeasurementReport.registerTool(Angle);
4206
4206
 
4207
4207
  var TID300CobbAngle = utilities.TID300.CobbAngle;
4208
4208
  var MEASUREMENT_TYPE = "CobbAngle";
4209
- var trackingIdentifierTextValue$4 = "".concat(CORNERSTONE_3D_TAG, ":").concat(MEASUREMENT_TYPE);
4209
+ var trackingIdentifierTextValue$5 = "".concat(CORNERSTONE_3D_TAG, ":").concat(MEASUREMENT_TYPE);
4210
4210
  var CobbAngle = /** @class */ (function () {
4211
4211
  function CobbAngle() {
4212
4212
  }
@@ -4271,7 +4271,7 @@ var CobbAngle = /** @class */ (function () {
4271
4271
  point3: point3,
4272
4272
  point4: point4,
4273
4273
  rAngle: angle,
4274
- trackingIdentifierTextValue: trackingIdentifierTextValue$4,
4274
+ trackingIdentifierTextValue: trackingIdentifierTextValue$5,
4275
4275
  finding: finding,
4276
4276
  findingSites: findingSites || []
4277
4277
  };
@@ -4535,7 +4535,7 @@ MeasurementReport.registerTool(EllipticalROI);
4535
4535
 
4536
4536
  var TID300Polyline$1 = utilities.TID300.Polyline;
4537
4537
  var TOOLTYPE = "RectangleROI";
4538
- var trackingIdentifierTextValue$3 = "".concat(CORNERSTONE_3D_TAG, ":").concat(TOOLTYPE);
4538
+ var trackingIdentifierTextValue$4 = "".concat(CORNERSTONE_3D_TAG, ":").concat(TOOLTYPE);
4539
4539
  var RectangleROI = /** @class */ (function () {
4540
4540
  function RectangleROI() {
4541
4541
  }
@@ -4598,7 +4598,7 @@ var RectangleROI = /** @class */ (function () {
4598
4598
  ],
4599
4599
  area: area,
4600
4600
  perimeter: perimeter,
4601
- trackingIdentifierTextValue: trackingIdentifierTextValue$3,
4601
+ trackingIdentifierTextValue: trackingIdentifierTextValue$4,
4602
4602
  finding: finding,
4603
4603
  findingSites: findingSites || []
4604
4604
  };
@@ -4620,9 +4620,9 @@ var RectangleROI = /** @class */ (function () {
4620
4620
  }());
4621
4621
  MeasurementReport.registerTool(RectangleROI);
4622
4622
 
4623
- var TID300Length = utilities.TID300.Length;
4623
+ var TID300Length$1 = utilities.TID300.Length;
4624
4624
  var LENGTH = "Length";
4625
- var trackingIdentifierTextValue$2 = "".concat(CORNERSTONE_3D_TAG, ":").concat(LENGTH);
4625
+ var trackingIdentifierTextValue$3 = "".concat(CORNERSTONE_3D_TAG, ":").concat(LENGTH);
4626
4626
  var Length = /*#__PURE__*/function () {
4627
4627
  function Length() {
4628
4628
  _classCallCheck(this, Length);
@@ -4690,7 +4690,7 @@ var Length = /*#__PURE__*/function () {
4690
4690
  point1: point1,
4691
4691
  point2: point2,
4692
4692
  distance: distance,
4693
- trackingIdentifierTextValue: trackingIdentifierTextValue$2,
4693
+ trackingIdentifierTextValue: trackingIdentifierTextValue$3,
4694
4694
  finding: finding,
4695
4695
  findingSites: findingSites || []
4696
4696
  };
@@ -4700,7 +4700,7 @@ var Length = /*#__PURE__*/function () {
4700
4700
  }();
4701
4701
  Length.toolType = LENGTH;
4702
4702
  Length.utilityToolType = LENGTH;
4703
- Length.TID300Representation = TID300Length;
4703
+ Length.TID300Representation = TID300Length$1;
4704
4704
  Length.isValidCornerstoneTrackingIdentifier = function (TrackingIdentifier) {
4705
4705
  if (!TrackingIdentifier.includes(":")) {
4706
4706
  return false;
@@ -4718,7 +4718,7 @@ MeasurementReport.registerTool(Length);
4718
4718
 
4719
4719
  var TID300Polyline = utilities.TID300.Polyline;
4720
4720
  var PLANARFREEHANDROI = "PlanarFreehandROI";
4721
- var trackingIdentifierTextValue$1 = "".concat(CORNERSTONE_3D_TAG, ":").concat(PLANARFREEHANDROI);
4721
+ var trackingIdentifierTextValue$2 = "".concat(CORNERSTONE_3D_TAG, ":").concat(PLANARFREEHANDROI);
4722
4722
  var closedContourThreshold = 1e-5;
4723
4723
  var PlanarFreehandROI = /** @class */ (function () {
4724
4724
  function PlanarFreehandROI() {
@@ -4783,7 +4783,7 @@ var PlanarFreehandROI = /** @class */ (function () {
4783
4783
  points: points,
4784
4784
  area: area,
4785
4785
  perimeter: perimeter,
4786
- trackingIdentifierTextValue: trackingIdentifierTextValue$1,
4786
+ trackingIdentifierTextValue: trackingIdentifierTextValue$2,
4787
4787
  finding: finding,
4788
4788
  findingSites: findingSites || []
4789
4789
  };
@@ -4807,7 +4807,7 @@ MeasurementReport.registerTool(PlanarFreehandROI);
4807
4807
 
4808
4808
  var TID300Point = utilities.TID300.Point;
4809
4809
  var PROBE = "Probe";
4810
- var trackingIdentifierTextValue = "".concat(CORNERSTONE_3D_TAG, ":").concat(PROBE);
4810
+ var trackingIdentifierTextValue$1 = "".concat(CORNERSTONE_3D_TAG, ":").concat(PROBE);
4811
4811
  var Probe = /*#__PURE__*/function () {
4812
4812
  function Probe() {
4813
4813
  _classCallCheck(this, Probe);
@@ -4860,7 +4860,7 @@ var Probe = /*#__PURE__*/function () {
4860
4860
  });
4861
4861
  var TID300RepresentationArguments = {
4862
4862
  points: pointsImage,
4863
- trackingIdentifierTextValue: trackingIdentifierTextValue,
4863
+ trackingIdentifierTextValue: trackingIdentifierTextValue$1,
4864
4864
  findingSites: findingSites || [],
4865
4865
  finding: finding
4866
4866
  };
@@ -4887,6 +4887,75 @@ Probe.isValidCornerstoneTrackingIdentifier = function (TrackingIdentifier) {
4887
4887
  };
4888
4888
  MeasurementReport.registerTool(Probe);
4889
4889
 
4890
+ var TID300Length = utilities.TID300.Length;
4891
+ var ULTRASOUND_DIRECTIONAL = "UltrasoundDirectionalTool";
4892
+ var trackingIdentifierTextValue = "".concat(CORNERSTONE_3D_TAG, ":").concat(ULTRASOUND_DIRECTIONAL);
4893
+ var UltrasoundDirectional = /** @class */ (function () {
4894
+ function UltrasoundDirectional() {
4895
+ }
4896
+ // TODO: this function is required for all Cornerstone Tool Adapters, since it is called by MeasurementReport.
4897
+ UltrasoundDirectional.getMeasurementData = function (MeasurementGroup, sopInstanceUIDToImageIdMap, imageToWorldCoords, metadata) {
4898
+ var _a = MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, UltrasoundDirectional.toolType), defaultState = _a.defaultState, SCOORDGroup = _a.SCOORDGroup, ReferencedFrameNumber = _a.ReferencedFrameNumber;
4899
+ var referencedImageId = defaultState.annotation.metadata.referencedImageId;
4900
+ var GraphicData = SCOORDGroup.GraphicData;
4901
+ var worldCoords = [];
4902
+ for (var i = 0; i < GraphicData.length; i += 2) {
4903
+ var point = imageToWorldCoords(referencedImageId, [
4904
+ GraphicData[i],
4905
+ GraphicData[i + 1]
4906
+ ]);
4907
+ worldCoords.push(point);
4908
+ }
4909
+ var state = defaultState;
4910
+ state.annotation.data = {
4911
+ handles: {
4912
+ points: [worldCoords[0], worldCoords[1]],
4913
+ activeHandleIndex: 0,
4914
+ textBox: {
4915
+ hasMoved: false
4916
+ }
4917
+ },
4918
+ cachedStats: {},
4919
+ frameNumber: ReferencedFrameNumber
4920
+ };
4921
+ return state;
4922
+ };
4923
+ UltrasoundDirectional.getTID300RepresentationArguments = function (tool, worldToImageCoords) {
4924
+ var data = tool.data, finding = tool.finding, findingSites = tool.findingSites, metadata = tool.metadata;
4925
+ var handles = data.handles;
4926
+ var referencedImageId = metadata.referencedImageId;
4927
+ if (!referencedImageId) {
4928
+ throw new Error("UltrasoundDirectionalTool.getTID300RepresentationArguments: referencedImageId is not defined");
4929
+ }
4930
+ var start = worldToImageCoords(referencedImageId, handles.points[0]);
4931
+ var end = worldToImageCoords(referencedImageId, handles.points[1]);
4932
+ var point1 = { x: start[0], y: start[1] };
4933
+ var point2 = { x: end[0], y: end[1] };
4934
+ return {
4935
+ point1: point1,
4936
+ point2: point2,
4937
+ trackingIdentifierTextValue: trackingIdentifierTextValue,
4938
+ finding: finding,
4939
+ findingSites: findingSites || []
4940
+ };
4941
+ };
4942
+ UltrasoundDirectional.toolType = ULTRASOUND_DIRECTIONAL;
4943
+ UltrasoundDirectional.utilityToolType = ULTRASOUND_DIRECTIONAL;
4944
+ UltrasoundDirectional.TID300Representation = TID300Length;
4945
+ UltrasoundDirectional.isValidCornerstoneTrackingIdentifier = function (TrackingIdentifier) {
4946
+ if (!TrackingIdentifier.includes(":")) {
4947
+ return false;
4948
+ }
4949
+ var _a = TrackingIdentifier.split(":"), cornerstone3DTag = _a[0], toolType = _a[1];
4950
+ if (cornerstone3DTag !== CORNERSTONE_3D_TAG) {
4951
+ return false;
4952
+ }
4953
+ return toolType === ULTRASOUND_DIRECTIONAL;
4954
+ };
4955
+ return UltrasoundDirectional;
4956
+ }());
4957
+ MeasurementReport.registerTool(UltrasoundDirectional);
4958
+
4890
4959
  var Normalizer = normalizers.Normalizer;
4891
4960
  var SegmentationDerivation = derivations.Segmentation;
4892
4961
  /**
@@ -17538,6 +17607,7 @@ var Cornerstone3DSR = {
17538
17607
  ArrowAnnotate: ArrowAnnotate,
17539
17608
  Probe: Probe,
17540
17609
  PlanarFreehandROI: PlanarFreehandROI,
17610
+ UltrasoundDirectional: UltrasoundDirectional,
17541
17611
  MeasurementReport: MeasurementReport,
17542
17612
  CodeScheme: CodingScheme,
17543
17613
  CORNERSTONE_3D_TAG: CORNERSTONE_3D_TAG