@cornerstonejs/adapters 0.4.1 → 0.4.2

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.
@@ -4120,14 +4120,25 @@ var EllipticalROI = /** @class */ (function () {
4120
4120
  EllipticalROI.getTID300RepresentationArguments = function (tool, worldToImageCoords) {
4121
4121
  var data = tool.data, finding = tool.finding, findingSites = tool.findingSites, metadata = tool.metadata;
4122
4122
  var _a = data.cachedStats, cachedStats = _a === void 0 ? {} : _a, handles = data.handles;
4123
+ var rotation = data.initialRotation || 0;
4123
4124
  var referencedImageId = metadata.referencedImageId;
4124
4125
  if (!referencedImageId) {
4125
4126
  throw new Error("EllipticalROI.getTID300RepresentationArguments: referencedImageId is not defined");
4126
4127
  }
4127
- var top = worldToImageCoords(referencedImageId, handles.points[0]);
4128
- var bottom = worldToImageCoords(referencedImageId, handles.points[1]);
4129
- var left = worldToImageCoords(referencedImageId, handles.points[2]);
4130
- var right = worldToImageCoords(referencedImageId, handles.points[3]);
4128
+ var top, bottom, left, right;
4129
+ // this way when it's restored we can assume the initial rotation is 0.
4130
+ if (rotation == 90 || rotation == 270) {
4131
+ bottom = worldToImageCoords(referencedImageId, handles.points[2]);
4132
+ top = worldToImageCoords(referencedImageId, handles.points[3]);
4133
+ left = worldToImageCoords(referencedImageId, handles.points[0]);
4134
+ right = worldToImageCoords(referencedImageId, handles.points[1]);
4135
+ }
4136
+ else {
4137
+ top = worldToImageCoords(referencedImageId, handles.points[0]);
4138
+ bottom = worldToImageCoords(referencedImageId, handles.points[1]);
4139
+ left = worldToImageCoords(referencedImageId, handles.points[2]);
4140
+ right = worldToImageCoords(referencedImageId, handles.points[3]);
4141
+ }
4131
4142
  // find the major axis and minor axis
4132
4143
  var topBottomLength = Math.abs(top[1] - bottom[1]);
4133
4144
  var leftRightLength = Math.abs(left[0] - right[0]);