@cornerstonejs/core 2.0.0-beta.10 → 2.0.0-beta.12

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.
Files changed (83) hide show
  1. package/dist/esm/RenderingEngine/BaseVolumeViewport.js +5 -15
  2. package/dist/esm/RenderingEngine/BaseVolumeViewport.js.map +1 -1
  3. package/dist/esm/RenderingEngine/RenderingEngine.js +9 -3
  4. package/dist/esm/RenderingEngine/RenderingEngine.js.map +1 -1
  5. package/dist/esm/RenderingEngine/StackViewport.js +4 -27
  6. package/dist/esm/RenderingEngine/StackViewport.js.map +1 -1
  7. package/dist/esm/RenderingEngine/Viewport.js +14 -4
  8. package/dist/esm/RenderingEngine/Viewport.js.map +1 -1
  9. package/dist/esm/RenderingEngine/VolumeViewport.js +10 -4
  10. package/dist/esm/RenderingEngine/VolumeViewport.js.map +1 -1
  11. package/dist/esm/RenderingEngine/VolumeViewport3D.js +1 -1
  12. package/dist/esm/RenderingEngine/VolumeViewport3D.js.map +1 -1
  13. package/dist/esm/enums/Events.js +1 -1
  14. package/dist/esm/enums/Events.js.map +1 -1
  15. package/dist/esm/loaders/volumeLoader.js +2 -2
  16. package/dist/esm/loaders/volumeLoader.js.map +1 -1
  17. package/dist/esm/requestPool/imageLoadPoolManager.js.map +1 -1
  18. package/dist/esm/requestPool/requestPoolManager.js.map +1 -1
  19. package/dist/esm/utilities/convertStackToVolumeViewport.js +2 -2
  20. package/dist/esm/utilities/convertStackToVolumeViewport.js.map +1 -1
  21. package/dist/esm/utilities/getImageSliceDataForVolumeViewport.js +2 -1
  22. package/dist/esm/utilities/getImageSliceDataForVolumeViewport.js.map +1 -1
  23. package/dist/esm/utilities/getTargetVolumeAndSpacingInNormalDir.js +1 -1
  24. package/dist/esm/utilities/getTargetVolumeAndSpacingInNormalDir.js.map +1 -1
  25. package/dist/esm/utilities/loadImageToCanvas.js +0 -3
  26. package/dist/esm/utilities/loadImageToCanvas.js.map +1 -1
  27. package/dist/types/RenderingEngine/BaseVolumeViewport.d.ts +1 -1
  28. package/dist/types/RenderingEngine/BaseVolumeViewport.d.ts.map +1 -1
  29. package/dist/types/RenderingEngine/StackViewport.d.ts +2 -5
  30. package/dist/types/RenderingEngine/StackViewport.d.ts.map +1 -1
  31. package/dist/types/RenderingEngine/Viewport.d.ts +2 -1
  32. package/dist/types/RenderingEngine/Viewport.d.ts.map +1 -1
  33. package/dist/types/RenderingEngine/VolumeViewport.d.ts +1 -1
  34. package/dist/types/RenderingEngine/VolumeViewport.d.ts.map +1 -1
  35. package/dist/types/enums/Events.d.ts +1 -1
  36. package/dist/types/enums/Events.d.ts.map +1 -1
  37. package/dist/types/loaders/volumeLoader.d.ts +1 -1
  38. package/dist/types/loaders/volumeLoader.d.ts.map +1 -1
  39. package/dist/types/requestPool/imageLoadPoolManager.d.ts.map +1 -1
  40. package/dist/types/requestPool/requestPoolManager.d.ts.map +1 -1
  41. package/dist/types/types/EventTypes.d.ts +0 -1
  42. package/dist/types/types/EventTypes.d.ts.map +1 -1
  43. package/dist/types/types/IActor.d.ts +1 -1
  44. package/dist/types/types/IActor.d.ts.map +1 -1
  45. package/dist/types/types/ICamera.d.ts +1 -0
  46. package/dist/types/types/ICamera.d.ts.map +1 -1
  47. package/dist/types/types/IVideoViewport.d.ts +2 -19
  48. package/dist/types/types/IVideoViewport.d.ts.map +1 -1
  49. package/dist/types/types/IViewport.d.ts +6 -1
  50. package/dist/types/types/IViewport.d.ts.map +1 -1
  51. package/dist/types/types/IVolumeViewport.d.ts +7 -1
  52. package/dist/types/types/IVolumeViewport.d.ts.map +1 -1
  53. package/dist/types/types/StackViewportProperties.d.ts +0 -1
  54. package/dist/types/types/StackViewportProperties.d.ts.map +1 -1
  55. package/dist/types/types/ViewportProperties.d.ts +0 -1
  56. package/dist/types/types/ViewportProperties.d.ts.map +1 -1
  57. package/dist/types/utilities/getImageSliceDataForVolumeViewport.d.ts.map +1 -1
  58. package/dist/types/utilities/loadImageToCanvas.d.ts.map +1 -1
  59. package/dist/umd/index.js +1 -1
  60. package/dist/umd/index.js.map +1 -1
  61. package/package.json +2 -2
  62. package/src/RenderingEngine/BaseVolumeViewport.ts +6 -21
  63. package/src/RenderingEngine/RenderingEngine.ts +6 -6
  64. package/src/RenderingEngine/StackViewport.ts +6 -34
  65. package/src/RenderingEngine/Viewport.ts +31 -16
  66. package/src/RenderingEngine/VolumeViewport.ts +17 -11
  67. package/src/RenderingEngine/VolumeViewport3D.ts +1 -1
  68. package/src/enums/Events.ts +1 -1
  69. package/src/loaders/volumeLoader.ts +2 -3
  70. package/src/requestPool/imageLoadPoolManager.ts +0 -3
  71. package/src/requestPool/requestPoolManager.ts +0 -3
  72. package/src/types/EventTypes.ts +0 -2
  73. package/src/types/IActor.ts +2 -2
  74. package/src/types/ICamera.ts +2 -0
  75. package/src/types/IVideoViewport.ts +2 -86
  76. package/src/types/IViewport.ts +11 -6
  77. package/src/types/IVolumeViewport.ts +13 -7
  78. package/src/types/StackViewportProperties.ts +0 -2
  79. package/src/types/ViewportProperties.ts +0 -2
  80. package/src/utilities/convertStackToVolumeViewport.ts +2 -2
  81. package/src/utilities/getImageSliceDataForVolumeViewport.ts +2 -1
  82. package/src/utilities/getTargetVolumeAndSpacingInNormalDir.ts +1 -1
  83. package/src/utilities/loadImageToCanvas.ts +0 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/core",
3
- "version": "2.0.0-beta.10",
3
+ "version": "2.0.0-beta.12",
4
4
  "description": "",
5
5
  "main": "src/index.ts",
6
6
  "types": "dist/types/index.d.ts",
@@ -52,5 +52,5 @@
52
52
  "type": "individual",
53
53
  "url": "https://ohif.org/donate"
54
54
  },
55
- "gitHead": "134ced7eda99db84aaeb01fe15327b9607110b25"
55
+ "gitHead": "b93fb8a56218822f744f1f2b702c8c2fc3f19f75"
56
56
  }
@@ -37,7 +37,6 @@ import type {
37
37
  VolumeViewportProperties,
38
38
  ViewReferenceSpecifier,
39
39
  ReferenceCompatibleOptions,
40
- ViewPresentation,
41
40
  ViewReference,
42
41
  IVolumeViewport,
43
42
  } from '../types';
@@ -553,11 +552,9 @@ abstract class BaseVolumeViewport extends Viewport implements IVolumeViewport {
553
552
  element: this.element,
554
553
  viewportId: this.id,
555
554
  renderingEngineId: this.renderingEngineId,
556
- rotation,
557
555
  };
558
556
 
559
557
  triggerEvent(this.element, Events.CAMERA_MODIFIED, eventDetail);
560
- this.viewportProperties.rotation = rotation;
561
558
  };
562
559
 
563
560
  private rotateCamera(rotation: number): void {
@@ -801,7 +798,6 @@ abstract class BaseVolumeViewport extends Viewport implements IVolumeViewport {
801
798
  preset,
802
799
  interpolationType,
803
800
  slabThickness,
804
- rotation,
805
801
  }: VolumeViewportProperties = {},
806
802
  volumeId?: string,
807
803
  suppressEvents = false
@@ -815,7 +811,6 @@ abstract class BaseVolumeViewport extends Viewport implements IVolumeViewport {
815
811
  colormap,
816
812
  preset,
817
813
  slabThickness,
818
- rotation,
819
814
  });
820
815
  }
821
816
 
@@ -854,10 +849,6 @@ abstract class BaseVolumeViewport extends Viewport implements IVolumeViewport {
854
849
  //We need to set the current slab thickness here since setSlabThickness is define in VolumeViewport
855
850
  this.viewportProperties.slabThickness = slabThickness;
856
851
  }
857
-
858
- if (rotation !== undefined) {
859
- this.setRotation(rotation);
860
- }
861
852
  }
862
853
 
863
854
  /**
@@ -891,10 +882,6 @@ abstract class BaseVolumeViewport extends Viewport implements IVolumeViewport {
891
882
  this.viewportProperties.slabThickness = properties.slabThickness;
892
883
  }
893
884
 
894
- if (properties.rotation !== undefined) {
895
- this.setRotation(properties.rotation);
896
- }
897
-
898
885
  this.render();
899
886
  }
900
887
 
@@ -969,7 +956,7 @@ abstract class BaseVolumeViewport extends Viewport implements IVolumeViewport {
969
956
  /**
970
957
  * Retrieve the viewport properties
971
958
  * @param volumeId - The volume id to get the properties for (if undefined, the first volume)
972
- * @returns viewport properties including voi, interpolation type: TODO: slabThickness, invert, rotation, flip
959
+ * @returns viewport properties including voi, interpolation type: TODO: slabThickness, invert
973
960
  */
974
961
  public getProperties = (volumeId?: string): VolumeViewportProperties => {
975
962
  const applicableVolumeActorInfo = this._getApplicableVolumeActor(volumeId);
@@ -983,7 +970,6 @@ abstract class BaseVolumeViewport extends Viewport implements IVolumeViewport {
983
970
  interpolationType,
984
971
  invert,
985
972
  slabThickness,
986
- rotation,
987
973
  preset,
988
974
  } = this.viewportProperties;
989
975
 
@@ -1020,7 +1006,6 @@ abstract class BaseVolumeViewport extends Viewport implements IVolumeViewport {
1020
1006
  interpolationType: interpolationType,
1021
1007
  invert: invert,
1022
1008
  slabThickness: slabThickness,
1023
- rotation: rotation,
1024
1009
  preset,
1025
1010
  };
1026
1011
  };
@@ -1110,7 +1095,7 @@ abstract class BaseVolumeViewport extends Viewport implements IVolumeViewport {
1110
1095
  uid,
1111
1096
  actor,
1112
1097
  slabThickness,
1113
- referenceId: volumeId,
1098
+ referencedId: volumeId,
1114
1099
  });
1115
1100
  }
1116
1101
 
@@ -1183,11 +1168,11 @@ abstract class BaseVolumeViewport extends Viewport implements IVolumeViewport {
1183
1168
  actor,
1184
1169
  slabThickness,
1185
1170
  // although the actor UID is defined, we need to use the volumeId for the
1186
- // referenceId, since the actor UID is used to reference the actor in the
1171
+ // referencedId, since the actor UID is used to reference the actor in the
1187
1172
  // viewport, however, the actor is created from its volumeId
1188
1173
  // and if later we need to grab the referenced volume from cache,
1189
- // we can use the referenceId to get the volume from the cache
1190
- referenceId: volumeId,
1174
+ // we can use the referencedId to get the volume from the cache
1175
+ referencedId: volumeId,
1191
1176
  });
1192
1177
  }
1193
1178
 
@@ -1319,7 +1304,7 @@ abstract class BaseVolumeViewport extends Viewport implements IVolumeViewport {
1319
1304
  viewUp: currentViewUp,
1320
1305
  viewPlaneNormal,
1321
1306
  flipVertical,
1322
- } = this.getCamera();
1307
+ } = this.getCameraNoRotation();
1323
1308
 
1324
1309
  // The initial view up vector without any rotation, but incorporating vertical flip.
1325
1310
  const initialViewUp = flipVertical
@@ -630,14 +630,14 @@ class RenderingEngine implements IRenderingEngine {
630
630
  const resetZoom = true;
631
631
  const resetToCenter = true;
632
632
  const resetRotation = false;
633
- const supressEvents = true;
634
- vp.resetCamera(
633
+ const suppressEvents = true;
634
+ vp.resetCamera({
635
635
  resetPan,
636
636
  resetZoom,
637
637
  resetToCenter,
638
638
  resetRotation,
639
- supressEvents
640
- );
639
+ suppressEvents,
640
+ });
641
641
 
642
642
  const displayArea = vp.getDisplayArea();
643
643
 
@@ -649,7 +649,7 @@ class RenderingEngine implements IRenderingEngine {
649
649
  vp.setCamera({ flipHorizontal });
650
650
  }
651
651
  if (rotation) {
652
- vp.setProperties({ rotation });
652
+ vp.setViewPresentation({ rotation });
653
653
  }
654
654
  } else {
655
655
  vp.setCamera(prevCamera);
@@ -872,7 +872,7 @@ class RenderingEngine implements IRenderingEngine {
872
872
  const viewport = new ViewportType(viewportInput);
873
873
 
874
874
  // 5. Storing the viewports
875
- this._viewports.set(viewportId, viewport);
875
+ this._viewports.set(viewportId, viewport as IViewport);
876
876
 
877
877
  const eventDetail: EventTypes.ElementEnabledEventDetail = {
878
878
  element,
@@ -9,7 +9,6 @@ import vtkImageSlice from '@kitware/vtk.js/Rendering/Core/ImageSlice';
9
9
  import { mat4, vec2, vec3 } from 'gl-matrix';
10
10
  import eventTarget from '../eventTarget';
11
11
  import * as metaData from '../metaData';
12
- import cloneDeep from 'lodash.clonedeep';
13
12
  import type {
14
13
  ActorEntry,
15
14
  CPUFallbackColormapData,
@@ -313,7 +312,7 @@ class StackViewport extends Viewport implements IStackViewport, IImagesLoader {
313
312
  /**
314
313
  * Centers Pan and resets the zoom for stack viewport.
315
314
  */
316
- public resetCamera: (resetPan?: boolean, resetZoom?: boolean) => boolean;
315
+ public resetCamera: (options?) => boolean;
317
316
 
318
317
  /**
319
318
  * canvasToWorld Returns the world coordinates of the given `canvasPos`
@@ -703,7 +702,6 @@ class StackViewport extends Viewport implements IStackViewport, IImagesLoader {
703
702
  VOILUTFunction,
704
703
  invert,
705
704
  interpolationType,
706
- rotation,
707
705
  }: StackViewportProperties = {},
708
706
  suppressEvents = false
709
707
  ): void {
@@ -718,7 +716,6 @@ class StackViewport extends Viewport implements IStackViewport, IImagesLoader {
718
716
  VOILUTFunction,
719
717
  invert,
720
718
  interpolationType,
721
- rotation,
722
719
  });
723
720
  }
724
721
 
@@ -743,20 +740,13 @@ class StackViewport extends Viewport implements IStackViewport, IImagesLoader {
743
740
  if (typeof interpolationType !== 'undefined') {
744
741
  this.setInterpolationType(interpolationType);
745
742
  }
746
-
747
- if (typeof rotation !== 'undefined') {
748
- // TODO: check with VTK about rounding errors here.
749
- if (this.getRotation() !== rotation) {
750
- this.setRotation(rotation);
751
- }
752
- }
753
743
  }
754
744
 
755
745
  /**
756
746
  * Retrieve the viewport default properties
757
747
  * @param imageId If given, we retrieve the default properties of an image index if it exists
758
748
  * If not given,we return the global properties of the viewport
759
- * @returns viewport properties including voi, invert, interpolation type, rotation, flip
749
+ * @returns viewport properties including voi, invert, interpolation type,
760
750
  */
761
751
  public getDefaultProperties = (imageId?: string): StackViewportProperties => {
762
752
  let imageProperties;
@@ -770,13 +760,12 @@ class StackViewport extends Viewport implements IStackViewport, IImagesLoader {
770
760
 
771
761
  return {
772
762
  ...this.globalDefaultProperties,
773
- rotation: this.getRotation(),
774
763
  };
775
764
  };
776
765
 
777
766
  /**
778
767
  * Retrieve the viewport properties
779
- * @returns viewport properties including voi, invert, interpolation type, rotation, flip
768
+ * @returns viewport properties including voi, invert, interpolation type,
780
769
  */
781
770
  public getProperties = (): StackViewportProperties => {
782
771
  const {
@@ -787,7 +776,6 @@ class StackViewport extends Viewport implements IStackViewport, IImagesLoader {
787
776
  invert,
788
777
  voiUpdatedWithSetProperties,
789
778
  } = this;
790
- const rotation = this.getRotation();
791
779
 
792
780
  return {
793
781
  colormap,
@@ -795,7 +783,6 @@ class StackViewport extends Viewport implements IStackViewport, IImagesLoader {
795
783
  VOILUTFunction,
796
784
  interpolationType,
797
785
  invert,
798
- rotation,
799
786
  isComputedVOI: !voiUpdatedWithSetProperties,
800
787
  };
801
788
  };
@@ -838,10 +825,6 @@ class StackViewport extends Viewport implements IStackViewport, IImagesLoader {
838
825
 
839
826
  this.setInterpolationType(InterpolationType.LINEAR);
840
827
 
841
- if (this.getRotation() !== 0) {
842
- this.setRotation(0);
843
- }
844
-
845
828
  const transferFunction = this.getTransferFunction();
846
829
  setTransferFunctionNodes(
847
830
  transferFunction,
@@ -892,9 +875,6 @@ class StackViewport extends Viewport implements IStackViewport, IImagesLoader {
892
875
 
893
876
  this.setVOI(voiRange);
894
877
 
895
- if (this.getRotation() !== 0) {
896
- this.setRotation(0);
897
- }
898
878
  this.setInterpolationType(InterpolationType.LINEAR);
899
879
  this.setInvertColor(false);
900
880
 
@@ -1055,7 +1035,6 @@ class StackViewport extends Viewport implements IStackViewport, IImagesLoader {
1055
1035
  element: this.element,
1056
1036
  viewportId: this.id,
1057
1037
  renderingEngineId: this.renderingEngineId,
1058
- rotation: this.getRotation(),
1059
1038
  };
1060
1039
 
1061
1040
  triggerEvent(this.element, Events.CAMERA_MODIFIED, eventDetail);
@@ -1119,7 +1098,7 @@ class StackViewport extends Viewport implements IStackViewport, IImagesLoader {
1119
1098
  viewUp: currentViewUp,
1120
1099
  viewPlaneNormal,
1121
1100
  flipVertical,
1122
- } = this.getCamera();
1101
+ } = this.getCameraNoRotation();
1123
1102
 
1124
1103
  // The initial view up vector without any rotation, but incorporating vertical flip.
1125
1104
  const initialViewUp = flipVertical
@@ -1170,7 +1149,6 @@ class StackViewport extends Viewport implements IStackViewport, IImagesLoader {
1170
1149
  element: this.element,
1171
1150
  viewportId: this.id,
1172
1151
  renderingEngineId: this.renderingEngineId,
1173
- rotation,
1174
1152
  };
1175
1153
 
1176
1154
  triggerEvent(this.element, Events.CAMERA_MODIFIED, eventDetail);
@@ -1753,7 +1731,7 @@ class StackViewport extends Viewport implements IStackViewport, IImagesLoader {
1753
1731
  currentImageIdIndex: currentImageIdIndex,
1754
1732
  };
1755
1733
 
1756
- triggerEvent(eventTarget, Events.STACK_VIEWPORT_NEW_STACK, eventDetail);
1734
+ triggerEvent(this.element, Events.STACK_VIEWPORT_NEW_STACK, eventDetail);
1757
1735
 
1758
1736
  return imageId;
1759
1737
  }
@@ -1981,9 +1959,6 @@ class StackViewport extends Viewport implements IStackViewport, IImagesLoader {
1981
1959
  const requestType = RequestType.Interaction;
1982
1960
  const additionalDetails = { imageId, imageIdIndex };
1983
1961
  const options = {
1984
- preScale: {
1985
- enabled: true,
1986
- },
1987
1962
  useRGBA: true,
1988
1963
  requestType,
1989
1964
  };
@@ -2085,9 +2060,6 @@ class StackViewport extends Viewport implements IStackViewport, IImagesLoader {
2085
2060
  targetBuffer: {
2086
2061
  type: this.useNativeDataType ? undefined : 'Float32Array',
2087
2062
  },
2088
- preScale: {
2089
- enabled: true,
2090
- },
2091
2063
  useRGBA: false,
2092
2064
  transferSyntaxUID,
2093
2065
  useNativeDataType: this.useNativeDataType,
@@ -2553,7 +2525,7 @@ class StackViewport extends Viewport implements IStackViewport, IImagesLoader {
2553
2525
  // For stack Viewport we since we have only one slice
2554
2526
  // it should be enough to reset the camera to the center of the image
2555
2527
  const resetToCenter = true;
2556
- return super.resetCamera(resetPan, resetZoom, resetToCenter);
2528
+ return super.resetCamera({ resetPan, resetZoom, resetToCenter });
2557
2529
  }
2558
2530
 
2559
2531
  /**
@@ -535,7 +535,10 @@ class Viewport implements IViewport {
535
535
  actors.forEach((actor) => this.addActor(actor));
536
536
 
537
537
  // set the clipping planes for the actors
538
- this.resetCamera(resetCameraPanAndZoom, resetCameraPanAndZoom);
538
+ this.resetCamera({
539
+ resetPan: resetCameraPanAndZoom,
540
+ resetZoom: resetCameraPanAndZoom,
541
+ });
539
542
  }
540
543
 
541
544
  /**
@@ -876,18 +879,22 @@ class Viewport implements IViewport {
876
879
  * resetPan and resetZoom are true it places the focal point at the center of
877
880
  * the volume (or slice); otherwise, only the camera zoom and camera Pan or Zoom
878
881
  * is reset for the current view.
879
- * @param resetPan - If true, the camera focal point is reset to the center of the volume (slice)
880
- * @param resetZoom - If true, the camera zoom is reset to the default zoom
881
- * @param storeAsInitialCamera - If true, reset camera is stored as the initial camera (to allow differences to
882
+ * @param options - The reset options
883
+ * @param options.resetPan - If true, the camera focal point is reset to the center of the volume (slice)
884
+ * @param options.resetZoom - If true, the camera zoom is reset to the default zoom
885
+ * @param options.resetToCenter - If true, the camera is reset to the center of the volume (slice)
886
+ * @param options.storeAsInitialCamera - If true, reset camera is stored as the initial camera (to allow differences to
882
887
  * be detected for pan/zoom values)
883
888
  * @returns boolean
884
889
  */
885
- public resetCamera(
886
- resetPan = true,
887
- resetZoom = true,
888
- resetToCenter = true,
889
- storeAsInitialCamera = true
890
- ): boolean {
890
+ public resetCamera(options?): boolean {
891
+ const {
892
+ resetPan = true,
893
+ resetZoom = true,
894
+ resetToCenter = true,
895
+ storeAsInitialCamera = true,
896
+ } = options || {};
897
+
891
898
  const renderer = this.getRenderer();
892
899
 
893
900
  // fix the flip right away, since we rely on the viewPlaneNormal and
@@ -1237,11 +1244,7 @@ class Viewport implements IViewport {
1237
1244
  return renderer.getActiveCamera();
1238
1245
  }
1239
1246
 
1240
- /**
1241
- * Get the camera's current state
1242
- * @returns The camera object.
1243
- */
1244
- public getCamera(): ICamera {
1247
+ protected getCameraNoRotation(): ICamera {
1245
1248
  const vtkCamera = this.getVtkActiveCamera();
1246
1249
 
1247
1250
  return {
@@ -1257,6 +1260,19 @@ class Viewport implements IViewport {
1257
1260
  };
1258
1261
  }
1259
1262
 
1263
+ /**
1264
+ * Get the camera's current state
1265
+ * @returns The camera object.
1266
+ */
1267
+ public getCamera(): ICamera {
1268
+ const camera = this.getCameraNoRotation();
1269
+
1270
+ return {
1271
+ ...camera,
1272
+ rotation: this.getRotation(),
1273
+ };
1274
+ }
1275
+
1260
1276
  /**
1261
1277
  * Set the camera parameters
1262
1278
  * @param cameraInterface - ICamera
@@ -1415,7 +1431,6 @@ class Viewport implements IViewport {
1415
1431
  element: this.element,
1416
1432
  viewportId: this.id,
1417
1433
  renderingEngineId: this.renderingEngineId,
1418
- rotation: this.getRotation(),
1419
1434
  };
1420
1435
 
1421
1436
  triggerEvent(this.element, Events.CAMERA_MODIFIED, eventDetail);
@@ -242,18 +242,19 @@ class VolumeViewport extends BaseVolumeViewport {
242
242
  /**
243
243
  * Reset the camera for the volume viewport
244
244
  */
245
- public resetCamera(
246
- resetPan = true,
247
- resetZoom = true,
248
- resetToCenter = true,
249
- resetRotation = false,
250
- supressEvents = false
251
- ): boolean {
245
+ public resetCamera(options?): boolean {
246
+ const {
247
+ resetPan = true,
248
+ resetZoom = true,
249
+ resetRotation = true,
250
+ resetToCenter = true,
251
+ suppressEvents = false,
252
+ } = options || {};
252
253
  const { orientation } = this.viewportProperties;
253
254
  if (orientation) {
254
255
  this.applyViewOrientation(orientation, false);
255
256
  }
256
- super.resetCamera(resetPan, resetZoom, resetToCenter);
257
+ super.resetCamera({ resetPan, resetZoom, resetToCenter });
257
258
 
258
259
  this.resetVolumeViewportClippingRange();
259
260
 
@@ -294,7 +295,7 @@ class VolumeViewport extends BaseVolumeViewport {
294
295
  }
295
296
  });
296
297
 
297
- //Only reset the rotation of the camera if wanted (so we don't reset everytime resetCamera is called) and also verify that the viewport has an orientation that we know (sagittal, coronal, axial)
298
+ //Only reset the rotation of the camera if wanted (so we don't reset every time resetCamera is called) and also verify that the viewport has an orientation that we know (sagittal, coronal, axial)
298
299
  if (
299
300
  resetRotation &&
300
301
  MPR_CAMERA_VALUES[this.viewportProperties.orientation] !== undefined
@@ -307,7 +308,7 @@ class VolumeViewport extends BaseVolumeViewport {
307
308
  });
308
309
  }
309
310
 
310
- if (!supressEvents) {
311
+ if (!suppressEvents) {
311
312
  const eventDetail: EventTypes.CameraResetEventDetail = {
312
313
  viewportId: this.id,
313
314
  camera: this.getCamera(),
@@ -530,7 +531,12 @@ class VolumeViewport extends BaseVolumeViewport {
530
531
  const resetZoom = true;
531
532
  const resetToCenter = true;
532
533
  const resetCameraRotation = true;
533
- this.resetCamera(resetPan, resetZoom, resetToCenter, resetCameraRotation);
534
+ this.resetCamera({
535
+ resetPan,
536
+ resetZoom,
537
+ resetToCenter,
538
+ resetCameraRotation,
539
+ });
534
540
 
535
541
  triggerEvent(this.element, Events.VOI_MODIFIED, eventDetails);
536
542
  }
@@ -31,7 +31,7 @@ class VolumeViewport3D extends BaseVolumeViewport {
31
31
  resetZoom = true,
32
32
  resetToCenter = true
33
33
  ): boolean {
34
- super.resetCamera(resetPan, resetZoom, resetToCenter);
34
+ super.resetCamera({ resetPan, resetZoom, resetToCenter });
35
35
  this.resetVolumeViewportClippingRange();
36
36
  return;
37
37
  }
@@ -216,7 +216,7 @@ enum Events {
216
216
  * Triggers when the scroll function is called with a delta that is out of bounds.
217
217
  * This is usually for signaling that the user may want a different volume for partially loaded volumes which is meant to optimize memory.
218
218
  */
219
- VOLUME_SCROLL_OUT_OF_BOUNDS = 'VOLUME_SCROLL_OUT_OF_BOUNDS',
219
+ VOLUME_VIEWPORT_SCROLL_OUT_OF_BOUNDS = 'VOLUME_VIEWPORT_SCROLL_OUT_OF_BOUNDS',
220
220
 
221
221
  /**
222
222
  * Triggers when the scroll function is called on a volume.
@@ -9,7 +9,6 @@ import cache from '../cache/cache';
9
9
  import Events from '../enums/Events';
10
10
  import eventTarget from '../eventTarget';
11
11
  import triggerEvent from '../utilities/triggerEvent';
12
- import cloneDeep from 'lodash.clonedeep';
13
12
 
14
13
  import {
15
14
  createUint16SharedArray,
@@ -242,13 +241,13 @@ export function loadVolume(
242
241
  *
243
242
  * @returns Volume Loader Object
244
243
  */
245
- export async function createAndCacheVolume(
244
+ export async function createAndCacheEmptyVolume(
246
245
  volumeId: string,
247
246
  options?: VolumeLoaderOptions
248
247
  ): Promise<Record<string, any>> {
249
248
  if (volumeId === undefined) {
250
249
  throw new Error(
251
- 'createAndCacheVolume: parameter volumeId must not be undefined'
250
+ 'createAndCacheEmptyVolume: parameter volumeId must not be undefined'
252
251
  );
253
252
  }
254
253
 
@@ -19,9 +19,6 @@ import RequestType from '../enums/RequestType';
19
19
  * offset: null,
20
20
  * length: null,
21
21
  * },
22
- * preScale: {
23
- * enabled: true,
24
- * },
25
22
  * }
26
23
  *
27
24
  * imageLoadPoolManager.addRequest(
@@ -53,9 +53,6 @@ type RequestPool = {
53
53
  * offset: null,
54
54
  * length: null,
55
55
  * },
56
- * preScale: {
57
- * enabled: true,
58
- * },
59
56
  * }
60
57
  *
61
58
  * imageLoadPoolManager.addRequest(
@@ -27,8 +27,6 @@ type CameraModifiedEventDetail = {
27
27
  viewportId: string;
28
28
  /** Unique ID for the renderingEngine */
29
29
  renderingEngineId: string;
30
- /** Rotation Optional */
31
- rotation?: number;
32
30
  };
33
31
 
34
32
  /**
@@ -28,8 +28,8 @@ export type ActorEntry = {
28
28
  uid: string;
29
29
  /** actual actor object */
30
30
  actor: Actor | VolumeActor | ImageActor | ICanvasActor;
31
- /** the id of the reference volume from which this actor is derived or created*/
32
- referenceId?: string;
31
+ /** the id of the referenced object (e.g., volume) from which this actor is derived or created*/
32
+ referencedId?: string;
33
33
  /** slab thickness for the actor */
34
34
  slabThickness?: number;
35
35
  /** clipping filter applied to actor surfaces*/
@@ -25,6 +25,8 @@ interface ICamera {
25
25
  viewPlaneNormal?: Point3;
26
26
  /** Camera viewUp - the direction of viewUP in camera */
27
27
  viewUp?: Point3;
28
+ /** rotation */
29
+ rotation?: number;
28
30
  /** flip Horizontal */
29
31
  flipHorizontal?: boolean;
30
32
  /** flip Vertical */
@@ -1,87 +1,3 @@
1
- import { IViewport } from './IViewport';
2
- import VideoViewportProperties from './VideoViewportProperties';
1
+ import type IVideoViewport from '../RenderingEngine/VideoViewport';
3
2
 
4
- /**
5
- * Interface for Stack Viewport
6
- */
7
- export default interface IVideoViewport extends IViewport {
8
- /**
9
- * Resizes the viewport - only used in CPU fallback for StackViewport. The
10
- * GPU resizing happens inside the RenderingEngine.
11
- */
12
- resize: () => void;
13
- /**
14
- * Sets the properties for the viewport on the default actor.
15
- */
16
- setProperties(props: VideoViewportProperties, suppressEvents?: boolean): void;
17
- /**
18
- * Retrieve the viewport properties
19
- */
20
- getProperties: () => VideoViewportProperties;
21
-
22
- /**
23
- * Sets the video to play.
24
- * The video should have at least some metadata in the metadata provider,
25
- * including:
26
- * * study/series/sop common module for UIDs
27
- * * `cineModule` for information on number of frames and playback rate
28
- * * `imageUrlModule` - to get the URL for the image under the `rendered` attribute
29
- *
30
- * Without these, other tools requiring metadata wont work, although basic
31
- * playback does work if the setVideoURL is used instead.
32
- */
33
- setVideo: (imageIds: string, imageIdIndex?: number) => Promise<unknown>;
34
-
35
- /**
36
- * Displays a raw video, without any metadata associated with it. Plays back,
37
- * but does not permit tools to apply to the viewport, which requires providing
38
- * additional metadata for the study.
39
- *
40
- * @param url - to display
41
- */
42
- setVideoURL: (url: string) => void;
43
-
44
- play: () => void;
45
-
46
- pause: () => void;
47
-
48
- /**
49
- * Reset the viewport properties to the default values
50
- */
51
- resetProperties(): void;
52
-
53
- /**
54
- * Gets the current image id, including frame selction or frameless.
55
- */
56
- getCurrentImageId(): string;
57
-
58
- /**
59
- * Gets the current frame, 1 based
60
- */
61
- getFrameNumber(): number;
62
-
63
- /**
64
- * Sets the current frame
65
- */
66
- setFrameNumber(frameNo: number);
67
-
68
- /**
69
- * Sets the current video time, in seconds
70
- */
71
- setTime(time: number);
72
-
73
- /**
74
- * Sets the range of frames for displaying. This is the range of frames
75
- * that are shown/looped over when the video is playing.
76
- * Note that ability to playback a frame range depends on the server
77
- * implementing byte range requests, OR the video being easily cached in memory.
78
- */
79
- setFrameRange(range?: [number, number]);
80
-
81
- getFrameRange(): [number, number];
82
-
83
- /**
84
- * Centers Pan and resets the zoom for stack viewport.
85
- */
86
- resetCamera(resetPan?: boolean, resetZoom?: boolean): boolean;
87
- }
3
+ export default IVideoViewport;