@cornerstonejs/core 2.0.0-beta.3 → 2.0.0-beta.4
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/dist/cjs/RenderingEngine/StackViewport.js +1 -2
- package/dist/cjs/RenderingEngine/StackViewport.js.map +1 -1
- package/dist/cjs/RenderingEngine/Viewport.js +8 -9
- package/dist/cjs/RenderingEngine/Viewport.js.map +1 -1
- package/dist/cjs/RenderingEngine/helpers/cpuFallback/rendering/correctShift.d.ts +1 -1
- package/dist/cjs/RenderingEngine/vtkClasses/vtkStreamingOpenGLVolumeMapper.js +1 -0
- package/dist/cjs/RenderingEngine/vtkClasses/vtkStreamingOpenGLVolumeMapper.js.map +1 -1
- package/dist/cjs/Settings.js +3 -1
- package/dist/cjs/Settings.js.map +1 -1
- package/dist/cjs/cache/classes/Contour.d.ts +1 -1
- package/dist/cjs/cache/classes/ContourSet.d.ts +1 -1
- package/dist/cjs/index.js +0 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/loaders/geometryLoader.d.ts +1 -1
- package/dist/cjs/loaders/volumeLoader.js +2 -3
- package/dist/cjs/loaders/volumeLoader.js.map +1 -1
- package/dist/cjs/requestPool/requestPoolManager.d.ts +3 -3
- package/dist/cjs/types/ActorSliceRange.d.ts +1 -1
- package/dist/cjs/types/AffineMatrix.d.ts +1 -1
- package/dist/cjs/types/CPUFallbackColormapData.d.ts +1 -1
- package/dist/cjs/types/CPUFallbackColormapsData.d.ts +1 -1
- package/dist/cjs/types/CPUFallbackLUT.d.ts +1 -1
- package/dist/cjs/types/CPUFallbackRenderingTools.d.ts +1 -1
- package/dist/cjs/types/CPUFallbackViewport.d.ts +1 -1
- package/dist/cjs/types/CPUFallbackViewportDisplayedArea.d.ts +1 -1
- package/dist/cjs/types/CPUIImageData.d.ts +2 -2
- package/dist/cjs/types/Colormap.d.ts +3 -3
- package/dist/cjs/types/ContourData.d.ts +3 -3
- package/dist/cjs/types/Cornerstone3DConfig.d.ts +1 -1
- package/dist/cjs/types/EventTypes.d.ts +46 -46
- package/dist/cjs/types/FlipDirection.d.ts +1 -1
- package/dist/cjs/types/IActor.d.ts +4 -4
- package/dist/cjs/types/IViewport.d.ts +4 -4
- package/dist/cjs/types/IVolume.d.ts +1 -1
- package/dist/cjs/types/IVolumeInput.d.ts +1 -1
- package/dist/cjs/types/ImageLoaderFn.d.ts +1 -1
- package/dist/cjs/types/ImageSliceData.d.ts +1 -1
- package/dist/cjs/types/Mat3.d.ts +1 -1
- package/dist/cjs/types/Metadata.d.ts +1 -1
- package/dist/cjs/types/OrientationVectors.d.ts +1 -1
- package/dist/cjs/types/PixelDataTypedArray.d.ts +1 -1
- package/dist/cjs/types/Plane.d.ts +1 -1
- package/dist/cjs/types/Point2.d.ts +1 -1
- package/dist/cjs/types/Point3.d.ts +1 -1
- package/dist/cjs/types/Point4.d.ts +1 -1
- package/dist/cjs/types/RGB.d.ts +1 -1
- package/dist/cjs/types/ScalingParameters.d.ts +3 -3
- package/dist/cjs/types/StackViewportProperties.d.ts +1 -1
- package/dist/cjs/types/TransformMatrix2D.d.ts +1 -1
- package/dist/cjs/types/ViewportInputOptions.d.ts +1 -1
- package/dist/cjs/types/ViewportProperties.d.ts +1 -1
- package/dist/cjs/types/VolumeLoaderFn.d.ts +1 -1
- package/dist/cjs/types/VolumeViewportProperties.d.ts +1 -1
- package/dist/cjs/types/displayArea.d.ts +1 -1
- package/dist/cjs/types/voi.d.ts +2 -2
- package/dist/cjs/utilities/actorCheck.d.ts +1 -1
- package/dist/cjs/utilities/getViewportsWithImageURI.d.ts +1 -1
- package/dist/esm/RenderingEngine/StackViewport.js +1 -2
- package/dist/esm/RenderingEngine/StackViewport.js.map +1 -1
- package/dist/esm/RenderingEngine/Viewport.js +8 -9
- package/dist/esm/RenderingEngine/Viewport.js.map +1 -1
- package/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/correctShift.d.ts +1 -1
- package/dist/esm/RenderingEngine/vtkClasses/vtkStreamingOpenGLVolumeMapper.js +1 -0
- package/dist/esm/RenderingEngine/vtkClasses/vtkStreamingOpenGLVolumeMapper.js.map +1 -1
- package/dist/esm/Settings.js +3 -1
- package/dist/esm/Settings.js.map +1 -1
- package/dist/esm/cache/classes/Contour.d.ts +1 -1
- package/dist/esm/cache/classes/ContourSet.d.ts +1 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loaders/geometryLoader.d.ts +1 -1
- package/dist/esm/loaders/volumeLoader.js +2 -3
- package/dist/esm/loaders/volumeLoader.js.map +1 -1
- package/dist/esm/requestPool/requestPoolManager.d.ts +3 -3
- package/dist/esm/types/ActorSliceRange.d.ts +1 -1
- package/dist/esm/types/AffineMatrix.d.ts +1 -1
- package/dist/esm/types/CPUFallbackColormapData.d.ts +1 -1
- package/dist/esm/types/CPUFallbackColormapsData.d.ts +1 -1
- package/dist/esm/types/CPUFallbackLUT.d.ts +1 -1
- package/dist/esm/types/CPUFallbackRenderingTools.d.ts +1 -1
- package/dist/esm/types/CPUFallbackViewport.d.ts +1 -1
- package/dist/esm/types/CPUFallbackViewportDisplayedArea.d.ts +1 -1
- package/dist/esm/types/CPUIImageData.d.ts +2 -2
- package/dist/esm/types/Colormap.d.ts +3 -3
- package/dist/esm/types/ContourData.d.ts +3 -3
- package/dist/esm/types/Cornerstone3DConfig.d.ts +1 -1
- package/dist/esm/types/EventTypes.d.ts +46 -46
- package/dist/esm/types/FlipDirection.d.ts +1 -1
- package/dist/esm/types/IActor.d.ts +4 -4
- package/dist/esm/types/IViewport.d.ts +4 -4
- package/dist/esm/types/IVolume.d.ts +1 -1
- package/dist/esm/types/IVolumeInput.d.ts +1 -1
- package/dist/esm/types/ImageLoaderFn.d.ts +1 -1
- package/dist/esm/types/ImageSliceData.d.ts +1 -1
- package/dist/esm/types/Mat3.d.ts +1 -1
- package/dist/esm/types/Metadata.d.ts +1 -1
- package/dist/esm/types/OrientationVectors.d.ts +1 -1
- package/dist/esm/types/PixelDataTypedArray.d.ts +1 -1
- package/dist/esm/types/Plane.d.ts +1 -1
- package/dist/esm/types/Point2.d.ts +1 -1
- package/dist/esm/types/Point3.d.ts +1 -1
- package/dist/esm/types/Point4.d.ts +1 -1
- package/dist/esm/types/RGB.d.ts +1 -1
- package/dist/esm/types/ScalingParameters.d.ts +3 -3
- package/dist/esm/types/StackViewportProperties.d.ts +1 -1
- package/dist/esm/types/TransformMatrix2D.d.ts +1 -1
- package/dist/esm/types/ViewportInputOptions.d.ts +1 -1
- package/dist/esm/types/ViewportProperties.d.ts +1 -1
- package/dist/esm/types/VolumeLoaderFn.d.ts +1 -1
- package/dist/esm/types/VolumeViewportProperties.d.ts +1 -1
- package/dist/esm/types/displayArea.d.ts +1 -1
- package/dist/esm/types/voi.d.ts +2 -2
- package/dist/esm/utilities/actorCheck.d.ts +1 -1
- package/dist/esm/utilities/getViewportsWithImageURI.d.ts +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/package.json +3 -4
- package/src/RenderingEngine/StackViewport.ts +1 -2
- package/src/RenderingEngine/Viewport.ts +8 -9
- package/src/Settings.ts +3 -1
- package/src/loaders/volumeLoader.ts +2 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/core",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/umd/index.js",
|
|
6
6
|
"types": "dist/esm/index.d.ts",
|
|
@@ -32,8 +32,7 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@kitware/vtk.js": "27.3.1",
|
|
34
34
|
"detect-gpu": "^5.0.22",
|
|
35
|
-
"gl-matrix": "^3.4.3"
|
|
36
|
-
"lodash.clonedeep": "4.5.0"
|
|
35
|
+
"gl-matrix": "^3.4.3"
|
|
37
36
|
},
|
|
38
37
|
"contributors": [
|
|
39
38
|
{
|
|
@@ -46,5 +45,5 @@
|
|
|
46
45
|
"type": "individual",
|
|
47
46
|
"url": "https://ohif.org/donate"
|
|
48
47
|
},
|
|
49
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "deefd5fb773ca3eb6fc4f2047c15a2b1a3ac82de"
|
|
50
49
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import vtkDataArray from '@kitware/vtk.js/Common/Core/DataArray';
|
|
2
2
|
import vtkImageData from '@kitware/vtk.js/Common/DataModel/ImageData';
|
|
3
3
|
import type { vtkImageData as vtkImageDataType } from '@kitware/vtk.js/Common/DataModel/ImageData';
|
|
4
|
-
import _cloneDeep from 'lodash.clonedeep';
|
|
5
4
|
import vtkCamera from '@kitware/vtk.js/Rendering/Core/Camera';
|
|
6
5
|
import { vec2, vec3, mat4 } from 'gl-matrix';
|
|
7
6
|
import vtkImageMapper from '@kitware/vtk.js/Rendering/Core/ImageMapper';
|
|
@@ -1957,7 +1956,7 @@ class StackViewport extends Viewport implements IStackViewport {
|
|
|
1957
1956
|
|
|
1958
1957
|
// Cache camera props so we can trigger one camera changed event after
|
|
1959
1958
|
// The full transition.
|
|
1960
|
-
const previousCameraProps =
|
|
1959
|
+
const previousCameraProps = structuredClone(this.getCamera());
|
|
1961
1960
|
if (sameImageData && !this.stackInvalidated) {
|
|
1962
1961
|
// 3a. If we can reuse it, replace the scalar data under the hood
|
|
1963
1962
|
this._updateVTKImageDataFromCornerstoneImage(image);
|
|
@@ -4,7 +4,6 @@ import vtkMath from '@kitware/vtk.js/Common/Core/Math';
|
|
|
4
4
|
import vtkPlane from '@kitware/vtk.js/Common/DataModel/Plane';
|
|
5
5
|
|
|
6
6
|
import { vec2, vec3 } from 'gl-matrix';
|
|
7
|
-
import _cloneDeep from 'lodash.clonedeep';
|
|
8
7
|
|
|
9
8
|
import Events from '../enums/Events';
|
|
10
9
|
import ViewportStatus from '../enums/ViewportStatus';
|
|
@@ -103,11 +102,11 @@ class Viewport implements IViewport {
|
|
|
103
102
|
this.renderingEngineId
|
|
104
103
|
);
|
|
105
104
|
|
|
106
|
-
this.defaultOptions =
|
|
105
|
+
this.defaultOptions = structuredClone(props.defaultOptions);
|
|
107
106
|
this.suppressEvents = props.defaultOptions.suppressEvents
|
|
108
107
|
? props.defaultOptions.suppressEvents
|
|
109
108
|
: false;
|
|
110
|
-
this.options =
|
|
109
|
+
this.options = structuredClone(props.defaultOptions);
|
|
111
110
|
this.isDisabled = false;
|
|
112
111
|
}
|
|
113
112
|
|
|
@@ -180,7 +179,7 @@ class Viewport implements IViewport {
|
|
|
180
179
|
* @param immediate - If `true`, renders the viewport after the options are set.
|
|
181
180
|
*/
|
|
182
181
|
public setOptions(options: ViewportInputOptions, immediate = false): void {
|
|
183
|
-
this.options = <ViewportInputOptions>
|
|
182
|
+
this.options = <ViewportInputOptions>structuredClone(options);
|
|
184
183
|
|
|
185
184
|
// TODO When this is needed we need to move the camera position.
|
|
186
185
|
// We can steal some logic from the tools we build to do this.
|
|
@@ -198,7 +197,7 @@ class Viewport implements IViewport {
|
|
|
198
197
|
* @param immediate - If `true`, renders the viewport after the options are reset.
|
|
199
198
|
*/
|
|
200
199
|
public reset(immediate = false) {
|
|
201
|
-
this.options =
|
|
200
|
+
this.options = structuredClone(this.defaultOptions);
|
|
202
201
|
|
|
203
202
|
// TODO When this is needed we need to move the camera position.
|
|
204
203
|
// We can steal some logic from the tools we build to do this.
|
|
@@ -660,7 +659,7 @@ class Viewport implements IViewport {
|
|
|
660
659
|
flipVertical: false,
|
|
661
660
|
});
|
|
662
661
|
|
|
663
|
-
const previousCamera =
|
|
662
|
+
const previousCamera = structuredClone(this.getCamera());
|
|
664
663
|
const bounds = renderer.computeVisiblePropBounds();
|
|
665
664
|
const focalPoint = <Point3>[0, 0, 0];
|
|
666
665
|
const imageData = this.getDefaultImageData();
|
|
@@ -775,9 +774,9 @@ class Viewport implements IViewport {
|
|
|
775
774
|
clippingRange: clippingRangeToUse,
|
|
776
775
|
});
|
|
777
776
|
|
|
778
|
-
const modifiedCamera =
|
|
777
|
+
const modifiedCamera = structuredClone(this.getCamera());
|
|
779
778
|
|
|
780
|
-
this.setFitToCanvasCamera(
|
|
779
|
+
this.setFitToCanvasCamera(structuredClone(this.getCamera()));
|
|
781
780
|
|
|
782
781
|
if (storeAsInitialCamera) {
|
|
783
782
|
this.setInitialCamera(modifiedCamera);
|
|
@@ -1007,7 +1006,7 @@ class Viewport implements IViewport {
|
|
|
1007
1006
|
storeAsInitialCamera = false
|
|
1008
1007
|
): void {
|
|
1009
1008
|
const vtkCamera = this.getVtkActiveCamera();
|
|
1010
|
-
const previousCamera =
|
|
1009
|
+
const previousCamera = structuredClone(this.getCamera());
|
|
1011
1010
|
const updatedCamera = Object.assign({}, previousCamera, cameraInterface);
|
|
1012
1011
|
const {
|
|
1013
1012
|
viewUp,
|
package/src/Settings.ts
CHANGED
|
@@ -13,7 +13,9 @@ const DICTIONARY = Symbol('Dictionary');
|
|
|
13
13
|
export default class Settings {
|
|
14
14
|
constructor(base?: Settings) {
|
|
15
15
|
const dictionary = Object.create(
|
|
16
|
-
base instanceof Settings && DICTIONARY in base
|
|
16
|
+
base instanceof Settings && DICTIONARY in base
|
|
17
|
+
? (base[DICTIONARY] as object)
|
|
18
|
+
: null
|
|
17
19
|
);
|
|
18
20
|
Object.seal(
|
|
19
21
|
Object.defineProperty(this, DICTIONARY, {
|
|
@@ -3,7 +3,6 @@ import '@kitware/vtk.js/Rendering/Profiles/Volume';
|
|
|
3
3
|
import vtkImageData from '@kitware/vtk.js/Common/DataModel/ImageData';
|
|
4
4
|
import type { vtkImageData as vtkImageDataType } from '@kitware/vtk.js/Common/DataModel/ImageData';
|
|
5
5
|
import vtkDataArray from '@kitware/vtk.js/Common/Core/DataArray';
|
|
6
|
-
import cloneDeep from 'lodash.clonedeep';
|
|
7
6
|
|
|
8
7
|
import { ImageVolume } from '../cache/classes/ImageVolume';
|
|
9
8
|
import type * as Types from '../types';
|
|
@@ -330,7 +329,7 @@ export async function createAndCacheDerivedVolume(
|
|
|
330
329
|
|
|
331
330
|
const derivedVolume = new ImageVolume({
|
|
332
331
|
volumeId,
|
|
333
|
-
metadata:
|
|
332
|
+
metadata: structuredClone(metadata),
|
|
334
333
|
dimensions: [dimensions[0], dimensions[1], dimensions[2]],
|
|
335
334
|
spacing,
|
|
336
335
|
origin,
|
|
@@ -419,7 +418,7 @@ export function createLocalVolume(
|
|
|
419
418
|
|
|
420
419
|
const derivedVolume = new ImageVolume({
|
|
421
420
|
volumeId,
|
|
422
|
-
metadata:
|
|
421
|
+
metadata: structuredClone(metadata),
|
|
423
422
|
dimensions: [dimensions[0], dimensions[1], dimensions[2]],
|
|
424
423
|
spacing,
|
|
425
424
|
origin,
|