@cornerstonejs/core 2.17.4 → 2.17.6

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.
@@ -864,9 +864,11 @@ class Viewport {
864
864
  displayArea: true,
865
865
  zoom: true,
866
866
  pan: true,
867
+ flipHorizontal: true,
868
+ flipVertical: true,
867
869
  }) {
868
870
  const target = {};
869
- const { rotation, displayArea, zoom, pan } = viewPresSel;
871
+ const { rotation, displayArea, zoom, pan, flipHorizontal, flipVertical } = viewPresSel;
870
872
  if (rotation) {
871
873
  target.rotation = this.getRotation();
872
874
  }
@@ -881,6 +883,12 @@ class Viewport {
881
883
  target.pan = this.getPan();
882
884
  vec2.scale(target.pan, target.pan, 1 / initZoom);
883
885
  }
886
+ if (flipHorizontal) {
887
+ target.flipHorizontal = this.flipHorizontal;
888
+ }
889
+ if (flipVertical) {
890
+ target.flipVertical = this.flipVertical;
891
+ }
884
892
  return target;
885
893
  }
886
894
  setViewReference(viewRef) {
@@ -889,7 +897,7 @@ class Viewport {
889
897
  if (!viewPres) {
890
898
  return;
891
899
  }
892
- const { displayArea, zoom = this.getZoom(), pan, rotation } = viewPres;
900
+ const { displayArea, zoom = this.getZoom(), pan, rotation, flipHorizontal = this.flipHorizontal, flipVertical = this.flipVertical, } = viewPres;
893
901
  if (displayArea !== this.getDisplayArea()) {
894
902
  this.setDisplayArea(displayArea);
895
903
  }
@@ -900,6 +908,7 @@ class Viewport {
900
908
  if (rotation >= 0) {
901
909
  this.setRotation(rotation);
902
910
  }
911
+ this.flip({ flipHorizontal, flipVertical });
903
912
  }
904
913
  _getCorners(bounds) {
905
914
  return [
@@ -318,6 +318,9 @@ export function cancelLoadAll() {
318
318
  const requests = requestPool[type];
319
319
  Object.keys(requests).forEach((priority) => {
320
320
  const requestDetails = requests[priority].pop();
321
+ if (!requestDetails) {
322
+ return;
323
+ }
321
324
  const additionalDetails = requestDetails.additionalDetails;
322
325
  const { imageId, volumeId } = additionalDetails;
323
326
  let loadObject;
@@ -42,6 +42,8 @@ export interface ViewPresentation {
42
42
  displayArea?: DisplayArea;
43
43
  zoom?: number;
44
44
  pan?: Point2;
45
+ flipHorizontal?: boolean;
46
+ flipVertical?: boolean;
45
47
  }
46
48
  export interface ViewPresentationSelector {
47
49
  slabThickness?: number;
@@ -49,6 +51,8 @@ export interface ViewPresentationSelector {
49
51
  displayArea?: boolean;
50
52
  zoom?: boolean;
51
53
  pan?: boolean;
54
+ flipHorizontal?: boolean;
55
+ flipVertical?: boolean;
52
56
  windowLevel?: boolean;
53
57
  paletteLut?: boolean;
54
58
  }
@@ -3,5 +3,8 @@ export function isImageActor(actorEntry) {
3
3
  }
4
4
  export function actorIsA(actorEntry, actorType) {
5
5
  const actorToCheck = 'isA' in actorEntry ? actorEntry : actorEntry.actor;
6
+ if (!actorToCheck) {
7
+ return false;
8
+ }
6
9
  return !!actorToCheck.isA(actorType);
7
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/core",
3
- "version": "2.17.4",
3
+ "version": "2.17.6",
4
4
  "description": "Cornerstone3D Core",
5
5
  "module": "./dist/esm/index.js",
6
6
  "types": "./dist/esm/index.d.ts",
@@ -82,5 +82,5 @@
82
82
  "type": "individual",
83
83
  "url": "https://ohif.org/donate"
84
84
  },
85
- "gitHead": "21dd9816a1aa88809e3f912281adaf21aa47e68f"
85
+ "gitHead": "ed6fea9289da25d37aefe5a551e6aada36101d2f"
86
86
  }