@cornerstonejs/core 4.14.3 → 4.14.5

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.
@@ -27,7 +27,7 @@ declare abstract class BaseVolumeViewport extends Viewport {
27
27
  sliceToIndexMatrix: mat4;
28
28
  indexToSliceMatrix: mat4;
29
29
  };
30
- protected applyViewOrientation(orientation: OrientationAxis | OrientationVectors, resetCamera?: boolean): void;
30
+ protected applyViewOrientation(orientation: OrientationAxis | OrientationVectors, resetCamera?: boolean, suppressEvents?: boolean): void;
31
31
  private initializeVolumeNewImageEventDispatcher;
32
32
  private setVOILUTFunction;
33
33
  private setColormap;
@@ -63,7 +63,7 @@ declare abstract class BaseVolumeViewport extends Viewport {
63
63
  setVolumes(volumeInputArray: IVolumeInput[], immediate?: boolean, suppressEvents?: boolean): Promise<void>;
64
64
  addVolumes(volumeInputArray: IVolumeInput[], immediate?: boolean, suppressEvents?: boolean): Promise<void>;
65
65
  removeVolumeActors(actorUIDs: string[], immediate?: boolean): void;
66
- setOrientation(_orientation: OrientationAxis | OrientationVectors, _immediate?: boolean): void;
66
+ setOrientation(_orientation: OrientationAxis | OrientationVectors, _immediate?: boolean, _suppressEvents?: boolean): void;
67
67
  private initializeColorTransferFunction;
68
68
  private _getApplicableVolumeActor;
69
69
  private _isValidVolumeInputArray;
@@ -370,7 +370,7 @@ class BaseVolumeViewport extends Viewport {
370
370
  getSliceViewInfo() {
371
371
  throw new Error('Method not implemented.');
372
372
  }
373
- applyViewOrientation(orientation, resetCamera = true) {
373
+ applyViewOrientation(orientation, resetCamera = true, suppressEvents = false) {
374
374
  const { viewPlaneNormal, viewUp } = this._getOrientationVectors(orientation) || {};
375
375
  if (!viewPlaneNormal || !viewUp) {
376
376
  return;
@@ -381,7 +381,11 @@ class BaseVolumeViewport extends Viewport {
381
381
  this.initialViewUp = viewUp;
382
382
  if (resetCamera) {
383
383
  const t = this;
384
- t.resetCamera({ resetOrientation: false, resetRotation: false });
384
+ t.resetCamera({
385
+ resetOrientation: false,
386
+ resetRotation: false,
387
+ suppressEvents,
388
+ });
385
389
  }
386
390
  }
387
391
  initializeVolumeNewImageEventDispatcher() {
@@ -719,7 +723,7 @@ class BaseVolumeViewport extends Viewport {
719
723
  }
720
724
  else if (refFrameOfReference === this.getFrameOfReferenceUID()) {
721
725
  if (refViewPlaneNormal && !isNegativeNormal && !isSameNormal) {
722
- this.setOrientation({ viewPlaneNormal: refViewPlaneNormal, viewUp });
726
+ this.setOrientation({ viewPlaneNormal: refViewPlaneNormal, viewUp }, true, true);
723
727
  this.setViewReference(viewRef);
724
728
  return;
725
729
  }
@@ -955,7 +959,7 @@ class BaseVolumeViewport extends Viewport {
955
959
  this.render();
956
960
  }
957
961
  }
958
- setOrientation(_orientation, _immediate = true) {
962
+ setOrientation(_orientation, _immediate = true, _suppressEvents = false) {
959
963
  console.warn('Method "setOrientation" needs implementation');
960
964
  }
961
965
  initializeColorTransferFunction(volumeInputArray) {
@@ -11,7 +11,7 @@ declare class VolumeViewport extends BaseVolumeViewport {
11
11
  getNumberOfSlices: () => number;
12
12
  addVolumes(volumeInputArray: IVolumeInput[], immediate?: boolean, suppressEvents?: boolean): Promise<void>;
13
13
  jumpToWorld(worldPos: Point3): boolean;
14
- setOrientation(orientation: OrientationAxis | OrientationVectors, immediate?: boolean): void;
14
+ setOrientation(orientation: OrientationAxis | OrientationVectors, immediate?: boolean, suppressEvents?: boolean): void;
15
15
  protected setCameraClippingRange(): void;
16
16
  private _setViewPlaneToReformatOrientation;
17
17
  private _setViewPlaneToAcquisitionPlane;
@@ -142,7 +142,7 @@ class VolumeViewport extends BaseVolumeViewport {
142
142
  }
143
143
  return true;
144
144
  }
145
- setOrientation(orientation, immediate = true) {
145
+ setOrientation(orientation, immediate = true, suppressEvents = false) {
146
146
  let viewPlaneNormal, viewUp;
147
147
  if (typeof orientation === 'string') {
148
148
  if (orientation === OrientationAxis.ACQUISITION) {
@@ -169,7 +169,7 @@ class VolumeViewport extends BaseVolumeViewport {
169
169
  }
170
170
  else {
171
171
  ({ viewPlaneNormal, viewUp } = orientation);
172
- this.applyViewOrientation(orientation);
172
+ this.applyViewOrientation(orientation, true, suppressEvents);
173
173
  }
174
174
  if (immediate) {
175
175
  this.render();
@@ -7,7 +7,7 @@ const log = coreLog.getLogger('utilities', 'getClosestImageId');
7
7
  export default function getClosestImageId(imageVolume, worldPos, viewPlaneNormal, options) {
8
8
  const { direction, spacing, imageIds } = imageVolume;
9
9
  const { ignoreSpacing = false } = options || {};
10
- if (imageIds?.length) {
10
+ if (!imageIds?.length) {
11
11
  return;
12
12
  }
13
13
  const kVector = direction.slice(6, 9);
@@ -1 +1 @@
1
- export declare const version = "4.14.3";
1
+ export declare const version = "4.14.5";
@@ -1 +1 @@
1
- export const version = '4.14.3';
1
+ export const version = '4.14.5';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/core",
3
- "version": "4.14.3",
3
+ "version": "4.14.5",
4
4
  "description": "Cornerstone3D Core",
5
5
  "module": "./dist/esm/index.js",
6
6
  "types": "./dist/esm/index.d.ts",
@@ -97,5 +97,5 @@
97
97
  "type": "individual",
98
98
  "url": "https://ohif.org/donate"
99
99
  },
100
- "gitHead": "4cd186ae79287b2bd72364157039e8ed91cf250d"
100
+ "gitHead": "5f9792ef2b1cf46733ad8cbaa39ac9d5f2f4be6d"
101
101
  }