@cornerstonejs/core 2.7.3 → 2.8.0

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.
@@ -68,6 +68,9 @@ import type ICachedGeometry from './ICachedGeometry';
68
68
  import type { IContourSet } from './IContourSet';
69
69
  import type { IContour } from './IContour';
70
70
  import type RGB from './RGB';
71
+ import type { Memo, HistoryMemo } from '../utilities/historyMemo';
72
+ import type { VoxelManager } from '../utilities/VoxelManager';
73
+ import type RLEVoxelMap from '../utilities/RLEVoxelMap';
71
74
  import type { ColormapPublic, ColormapRegistration } from './Colormap';
72
75
  import type { ViewportProperties } from './ViewportProperties';
73
76
  import type { PixelDataTypedArray, PixelDataTypedArrayString } from './PixelDataTypedArray';
@@ -96,4 +99,4 @@ import type { IBaseVolumeViewport } from './IBaseVolumeViewport';
96
99
  import type ScrollOptions from './ScrollOptions';
97
100
  import type JumpToSliceOptions from './JumpToSliceOptions';
98
101
  import type GeometryLoaderFn from './GeometryLoaderFn';
99
- export type { Cornerstone3DConfig, ICamera, IStackViewport, IVideoViewport, IWSIViewport, IVolumeViewport, IEnabledElement, ICache, IVolume, IViewportId, IImageVolume, ImageVolumeProps, IDynamicImageVolume, IRenderingEngine, ScalingParameters, PTScaling, IPointsManager, PolyDataPointConfiguration, Scaling, IStreamingImageVolume, IImage, IImageData, IImageCalibration, CPUIImageData, CPUImageData, EventTypes, ImageLoaderFn, VolumeLoaderFn, IRegisterImageLoader, IStreamingVolumeProperties, IViewport, ViewReference, DataSetOptions as ImageSetOptions, ViewPresentation, ViewPresentationSelector, ReferenceCompatibleOptions, ViewReferenceSpecifier, StackViewportProperties, VolumeViewportProperties, ViewportProperties, PublicViewportInput, VolumeActor, Actor, ActorEntry, ImageActor, ICanvasActor, IImageLoadObject, IVolumeLoadObject, IVolumeInput, VolumeInputCallback, IStackInput, StackInputCallback, ViewportPreset, Metadata, OrientationVectors, AABB2, AABB3, Point2, Point3, PointsXYZ, Point4, Mat3, Plane, ViewportInputOptions, VideoViewportProperties, WSIViewportProperties, VOIRange, VOI, DisplayArea, FlipDirection, ICachedImage, ICachedVolume, CPUFallbackEnabledElement, CPUFallbackViewport, CPUFallbackTransform, CPUFallbackColormapData, CPUFallbackViewportDisplayedArea, CPUFallbackColormapsData, CPUFallbackColormap, TransformMatrix2D, CPUFallbackLookupTable, CPUFallbackLUT, CPUFallbackRenderingTools, CustomEventType, ActorSliceRange, ImageSliceData, IGeometry, IGeometryLoadObject, ICachedGeometry, PublicContourSetData, ContourSetData, ContourData, IContourSet, IContour, PublicSurfaceData, SurfaceData, ISurface, RGB, ColormapPublic, ColormapRegistration, PixelDataTypedArray, PixelDataTypedArrayString, ImagePixelModule, ImagePlaneModule, AffineMatrix, ImageLoadListener, InternalVideoCamera, VideoViewportInput, BoundsIJK, BoundsLPS, Color, ColorLUT, VolumeProps, IImageFrame, DicomDateObject, DicomTimeObject, GeneralSeriesModuleMetadata, ImagePlaneModuleMetadata, SopCommonModuleMetadata, ImagePixelModuleMetadata, PatientStudyModuleMetadata, TransferSyntaxMetadata, LocalVolumeOptions, IVoxelManager, IRLEVoxelMap, RLERun, ViewportInput, ImageLoadRequests, IBaseVolumeViewport, GeometryLoaderFn, ScrollOptions, JumpToSliceOptions, };
102
+ export type { Cornerstone3DConfig, ICamera, IStackViewport, IVideoViewport, IWSIViewport, IVolumeViewport, IEnabledElement, ICache, IVolume, IViewportId, IImageVolume, ImageVolumeProps, IDynamicImageVolume, IRenderingEngine, ScalingParameters, PTScaling, IPointsManager, PolyDataPointConfiguration, Scaling, IStreamingImageVolume, IImage, IImageData, IImageCalibration, CPUIImageData, CPUImageData, EventTypes, ImageLoaderFn, VolumeLoaderFn, IRegisterImageLoader, IStreamingVolumeProperties, IViewport, ViewReference, DataSetOptions as ImageSetOptions, ViewPresentation, ViewPresentationSelector, ReferenceCompatibleOptions, ViewReferenceSpecifier, StackViewportProperties, VolumeViewportProperties, ViewportProperties, PublicViewportInput, VolumeActor, Actor, ActorEntry, ImageActor, ICanvasActor, IImageLoadObject, IVolumeLoadObject, IVolumeInput, VolumeInputCallback, IStackInput, StackInputCallback, ViewportPreset, Metadata, OrientationVectors, AABB2, AABB3, Point2, Point3, PointsXYZ, Point4, Mat3, Plane, ViewportInputOptions, VideoViewportProperties, WSIViewportProperties, VOIRange, VOI, DisplayArea, FlipDirection, ICachedImage, ICachedVolume, CPUFallbackEnabledElement, CPUFallbackViewport, CPUFallbackTransform, CPUFallbackColormapData, CPUFallbackViewportDisplayedArea, CPUFallbackColormapsData, CPUFallbackColormap, TransformMatrix2D, CPUFallbackLookupTable, CPUFallbackLUT, CPUFallbackRenderingTools, CustomEventType, ActorSliceRange, ImageSliceData, IGeometry, IGeometryLoadObject, ICachedGeometry, PublicContourSetData, ContourSetData, ContourData, IContourSet, IContour, PublicSurfaceData, SurfaceData, ISurface, RGB, ColormapPublic, ColormapRegistration, PixelDataTypedArray, PixelDataTypedArrayString, ImagePixelModule, ImagePlaneModule, AffineMatrix, ImageLoadListener, InternalVideoCamera, VideoViewportInput, BoundsIJK, BoundsLPS, Color, ColorLUT, VolumeProps, IImageFrame, DicomDateObject, DicomTimeObject, GeneralSeriesModuleMetadata, ImagePlaneModuleMetadata, SopCommonModuleMetadata, ImagePixelModuleMetadata, PatientStudyModuleMetadata, TransferSyntaxMetadata, LocalVolumeOptions, IVoxelManager, IRLEVoxelMap, RLERun, ViewportInput, ImageLoadRequests, IBaseVolumeViewport, GeometryLoaderFn, ScrollOptions, JumpToSliceOptions, Memo, HistoryMemo, VoxelManager, RLEVoxelMap, };
@@ -27,6 +27,6 @@ export default class PointsManager<T> {
27
27
  toXYZ(): PointsXYZ;
28
28
  static fromXYZ({ x, y, z }: PointsXYZ): IPointsManager<Point3>;
29
29
  subselect(count?: number, offset?: number): IPointsManager<T>;
30
- static create3(initialSize?: number): PointsManager<Point3>;
30
+ static create3(initialSize?: number, points?: Point3[]): PointsManager<Point3>;
31
31
  static create2(initialSize?: number): PointsManager<Point2>;
32
32
  }
@@ -131,8 +131,13 @@ export default class PointsManager {
131
131
  }
132
132
  return selected;
133
133
  }
134
- static create3(initialSize = 128) {
135
- return new PointsManager({ initialSize, dimensions: 3 });
134
+ static create3(initialSize = 128, points) {
135
+ initialSize = Math.max(initialSize, points?.length || 0);
136
+ const newPoints = new PointsManager({ initialSize, dimensions: 3 });
137
+ if (points) {
138
+ points.forEach((point) => newPoints.push(point));
139
+ }
140
+ return newPoints;
136
141
  }
137
142
  static create2(initialSize = 128) {
138
143
  return new PointsManager({ initialSize, dimensions: 2 });
@@ -287,9 +287,7 @@ export default class VoxelManager {
287
287
  return value.BYTES_PER_ELEMENT;
288
288
  }
289
289
  clear() {
290
- if (this.map) {
291
- this.map.clear();
292
- }
290
+ this.map?.clear();
293
291
  this.boundsIJK.map((bound) => {
294
292
  bound[0] = Infinity;
295
293
  bound[1] = -Infinity;
@@ -1,5 +1,6 @@
1
1
  export type Memo = {
2
2
  restoreMemo: (undo?: boolean) => void;
3
+ commitMemo?: () => boolean;
3
4
  };
4
5
  export type Memoable = {
5
6
  createMemo: () => Memo;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/core",
3
- "version": "2.7.3",
3
+ "version": "2.8.0",
4
4
  "description": "",
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": "b93d749cd3d670af26430c9ef00413dcb1103559"
85
+ "gitHead": "64b1f664e114d73546cf88099bf427a4f563aabd"
86
86
  }