@cornerstonejs/core 2.1.8 → 2.1.9
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.
|
@@ -633,7 +633,7 @@ class Viewport {
|
|
|
633
633
|
const vtkCamera = this.getVtkActiveCamera();
|
|
634
634
|
const previousCamera = this.getCamera();
|
|
635
635
|
const updatedCamera = Object.assign({}, previousCamera, cameraInterface);
|
|
636
|
-
const { viewUp, viewPlaneNormal, position, focalPoint, parallelScale, viewAngle, flipHorizontal, flipVertical, clippingRange, } = cameraInterface;
|
|
636
|
+
const { viewUp, viewPlaneNormal, position, focalPoint, parallelScale, viewAngle, flipHorizontal, flipVertical, clippingRange, rotation, } = cameraInterface;
|
|
637
637
|
if (flipHorizontal !== undefined) {
|
|
638
638
|
const flipH = (flipHorizontal && !this.flipHorizontal) ||
|
|
639
639
|
(!flipHorizontal && this.flipHorizontal);
|
|
@@ -669,6 +669,9 @@ class Viewport {
|
|
|
669
669
|
if (clippingRange !== undefined) {
|
|
670
670
|
vtkCamera.setClippingRange(clippingRange);
|
|
671
671
|
}
|
|
672
|
+
if (rotation !== undefined) {
|
|
673
|
+
this.setViewPresentation({ rotation });
|
|
674
|
+
}
|
|
672
675
|
const prevFocalPoint = previousCamera.focalPoint;
|
|
673
676
|
const prevViewUp = previousCamera.viewUp;
|
|
674
677
|
if ((prevFocalPoint && focalPoint) || (prevViewUp && viewUp)) {
|
|
@@ -45,7 +45,9 @@ declare class Cache {
|
|
|
45
45
|
getVolume: (volumeId: string, allowPartialMatch?: boolean) => IImageVolume | undefined;
|
|
46
46
|
getVolumes: () => IImageVolume[];
|
|
47
47
|
filterVolumesByReferenceId: (volumeId: string) => IImageVolume[];
|
|
48
|
-
removeImageLoadObject: (imageId: string
|
|
48
|
+
removeImageLoadObject: (imageId: string, { force }?: {
|
|
49
|
+
force?: boolean;
|
|
50
|
+
}) => void;
|
|
49
51
|
removeVolumeLoadObject: (volumeId: string) => void;
|
|
50
52
|
incrementImageCacheSize: (increment: number) => void;
|
|
51
53
|
decrementImageCacheSize: (decrement: number) => void;
|
package/dist/esm/cache/cache.js
CHANGED
|
@@ -32,12 +32,12 @@ class Cache {
|
|
|
32
32
|
};
|
|
33
33
|
this.getMaxCacheSize = () => this._maxCacheSize;
|
|
34
34
|
this.getCacheSize = () => this._imageCacheSize;
|
|
35
|
-
this._decacheImage = (imageId) => {
|
|
35
|
+
this._decacheImage = (imageId, force = false) => {
|
|
36
36
|
const cachedImage = this._imageCache.get(imageId);
|
|
37
37
|
if (!cachedImage) {
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
|
-
if (cachedImage.sharedCacheKey) {
|
|
40
|
+
if (cachedImage.sharedCacheKey && !force) {
|
|
41
41
|
throw new Error('Cannot decache an image with a shared cache key. You need to manually decache the volume first.');
|
|
42
42
|
}
|
|
43
43
|
const { imageLoadObject } = cachedImage;
|
|
@@ -85,7 +85,7 @@ class Cache {
|
|
|
85
85
|
if (done) {
|
|
86
86
|
break;
|
|
87
87
|
}
|
|
88
|
-
this.removeImageLoadObject(imageId);
|
|
88
|
+
this.removeImageLoadObject(imageId, { force: true });
|
|
89
89
|
triggerEvent(eventTarget, Events.IMAGE_CACHE_IMAGE_REMOVED, { imageId });
|
|
90
90
|
}
|
|
91
91
|
};
|
|
@@ -235,7 +235,7 @@ class Cache {
|
|
|
235
235
|
return volume.referencedVolumeId === volumeId;
|
|
236
236
|
});
|
|
237
237
|
};
|
|
238
|
-
this.removeImageLoadObject = (imageId) => {
|
|
238
|
+
this.removeImageLoadObject = (imageId, { force = false } = {}) => {
|
|
239
239
|
if (imageId === undefined) {
|
|
240
240
|
throw new Error('removeImageLoadObject: imageId must not be undefined');
|
|
241
241
|
}
|
|
@@ -243,13 +243,13 @@ class Cache {
|
|
|
243
243
|
if (!cachedImage) {
|
|
244
244
|
throw new Error('removeImageLoadObject: imageId was not present in imageCache');
|
|
245
245
|
}
|
|
246
|
+
this._decacheImage(imageId, force);
|
|
246
247
|
this.incrementImageCacheSize(-cachedImage.sizeInBytes);
|
|
247
248
|
const eventDetails = {
|
|
248
249
|
image: cachedImage,
|
|
249
250
|
imageId,
|
|
250
251
|
};
|
|
251
252
|
triggerEvent(eventTarget, Events.IMAGE_CACHE_IMAGE_REMOVED, eventDetails);
|
|
252
|
-
this._decacheImage(imageId);
|
|
253
253
|
};
|
|
254
254
|
this.removeVolumeLoadObject = (volumeId) => {
|
|
255
255
|
if (volumeId === undefined) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/core",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.9",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/umd/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"type": "individual",
|
|
85
85
|
"url": "https://ohif.org/donate"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "7e85486ec7dc157532f83ba8b9e6c2c36c21f307"
|
|
88
88
|
}
|