@cornerstonejs/core 1.54.0 → 1.54.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/core",
3
- "version": "1.54.0",
3
+ "version": "1.54.2",
4
4
  "description": "",
5
5
  "main": "src/index.ts",
6
6
  "types": "dist/types/index.d.ts",
@@ -47,5 +47,5 @@
47
47
  "type": "individual",
48
48
  "url": "https://ohif.org/donate"
49
49
  },
50
- "gitHead": "71b0b6f0035decbe7101f09fb45f6b1ff9bd6eac"
50
+ "gitHead": "6e3d8ea3d2aa05751ca8dcba38716d65324cc5f4"
51
51
  }
@@ -2823,6 +2823,10 @@ class StackViewport extends Viewport implements IStackViewport, IImagesLoader {
2823
2823
  return this.currentImageIdIndex;
2824
2824
  };
2825
2825
 
2826
+ public getSliceIndex = (): number => {
2827
+ return this.currentImageIdIndex;
2828
+ };
2829
+
2826
2830
  public getTargetId(specifier: TargetSpecifier = {}): string {
2827
2831
  const { sliceIndex: imageIdIndex = this.currentImageIdIndex } = specifier;
2828
2832
  return `imageId:${this.imageIds[imageIdIndex]}`;
@@ -506,6 +506,10 @@ class Viewport implements IViewport {
506
506
  const renderer = this.getRenderer();
507
507
  renderer.addActor(actor);
508
508
  this._actors.set(actorUID, Object.assign({}, actorEntry));
509
+
510
+ // when we add an actor we should update the camera clipping range and
511
+ // clipping planes as well
512
+ this.updateCameraClippingPlanesAndRange();
509
513
  }
510
514
 
511
515
  /**
@@ -1207,6 +1211,15 @@ class Viewport implements IViewport {
1207
1211
  }
1208
1212
  }
1209
1213
 
1214
+ /**
1215
+ * Updates the camera's clipping planes and range.
1216
+ */
1217
+ public updateCameraClippingPlanesAndRange(): void {
1218
+ const currentCamera = this.getCamera();
1219
+ this.updateClippingPlanesForActors(currentCamera);
1220
+ this.getRenderer().resetCameraClippingRange();
1221
+ }
1222
+
1210
1223
  /**
1211
1224
  * Updates the actors clipping planes orientation from the camera properties
1212
1225
  * @param updatedCamera - ICamera