@cornerstonejs/core 3.10.24 → 3.10.26

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.
@@ -533,6 +533,7 @@ class BaseVolumeViewport extends Viewport {
533
533
  const isNegativeNormal = isEqualNegative(viewPlaneNormal, refViewPlaneNormal);
534
534
  const isSameNormal = isEqual(viewPlaneNormal, refViewPlaneNormal);
535
535
  if (typeof sliceIndex === 'number' &&
536
+ volumeId !== undefined &&
536
537
  viewRef.volumeId === volumeId &&
537
538
  (isNegativeNormal || isSameNormal)) {
538
539
  const { currentStepIndex, sliceRangeInfo, numScrollSteps } = getVolumeViewportScrollInfo(this, volumeId, true);
@@ -550,17 +551,6 @@ class BaseVolumeViewport extends Viewport {
550
551
  this.setViewReference(viewRef);
551
552
  return;
552
553
  }
553
- if (cameraFocalPoint) {
554
- const focalDelta = vec3.subtract([0, 0, 0], cameraFocalPoint, focalPoint);
555
- const useNormal = refViewPlaneNormal ?? viewPlaneNormal;
556
- const normalDot = vec3.dot(focalDelta, useNormal);
557
- if (!isEqual(normalDot, 0)) {
558
- vec3.scale(focalDelta, useNormal, normalDot);
559
- }
560
- const newFocal = vec3.add([0, 0, 0], focalPoint, focalDelta);
561
- const newPosition = vec3.add([0, 0, 0], position, focalDelta);
562
- this.setCamera({ focalPoint: newFocal, position: newPosition });
563
- }
564
554
  if (referencedImageId && this.isInAcquisitionPlane()) {
565
555
  const imagePlaneModule = metaData.get(MetadataModules.IMAGE_PLANE, referencedImageId);
566
556
  const { imagePositionPatient } = imagePlaneModule;
@@ -572,6 +562,18 @@ class BaseVolumeViewport extends Viewport {
572
562
  focalPoint: newImagePositionPatient,
573
563
  });
574
564
  this.render();
565
+ return;
566
+ }
567
+ if (cameraFocalPoint) {
568
+ const focalDelta = vec3.subtract([0, 0, 0], cameraFocalPoint, focalPoint);
569
+ const useNormal = refViewPlaneNormal ?? viewPlaneNormal;
570
+ const normalDot = vec3.dot(focalDelta, useNormal);
571
+ if (!isEqual(normalDot, 0)) {
572
+ vec3.scale(focalDelta, useNormal, normalDot);
573
+ }
574
+ const newFocal = vec3.add([0, 0, 0], focalPoint, focalDelta);
575
+ const newPosition = vec3.add([0, 0, 0], position, focalDelta);
576
+ this.setCamera({ focalPoint: newFocal, position: newPosition });
575
577
  }
576
578
  }
577
579
  else {
@@ -428,7 +428,15 @@ class Viewport {
428
428
  flipVertical: false,
429
429
  });
430
430
  const previousCamera = this.getCamera();
431
- const bounds = renderer.computeVisiblePropBounds();
431
+ let bounds;
432
+ const defaultActor = this.getDefaultActor();
433
+ if (defaultActor && isImageActor(defaultActor)) {
434
+ const imageData = defaultActor.actor.getMapper().getInputData();
435
+ bounds = imageData.getBounds();
436
+ }
437
+ else {
438
+ bounds = renderer.computeVisiblePropBounds();
439
+ }
432
440
  const focalPoint = [0, 0, 0];
433
441
  const imageData = this.getDefaultImageData();
434
442
  if (imageData) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/core",
3
- "version": "3.10.24",
3
+ "version": "3.10.26",
4
4
  "description": "Cornerstone3D Core",
5
5
  "module": "./dist/esm/index.js",
6
6
  "types": "./dist/esm/index.d.ts",
@@ -91,5 +91,5 @@
91
91
  "type": "individual",
92
92
  "url": "https://ohif.org/donate"
93
93
  },
94
- "gitHead": "575d330a29589bf66834f171dbda5235c36b27da"
94
+ "gitHead": "3f4042618699dada94d8be390527b2eec5d82dba"
95
95
  }