@cornerstonejs/core 2.7.1 → 2.7.3
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/esm/RenderingEngine/StackViewport.js +1 -3
- package/dist/esm/RenderingEngine/Viewport.js +4 -0
- package/dist/esm/RenderingEngine/VolumeViewport.js +4 -0
- package/dist/esm/utilities/historyMemo/index.d.ts +2 -1
- package/dist/esm/utilities/historyMemo/index.js +7 -0
- package/package.json +2 -2
|
@@ -1023,9 +1023,7 @@ class StackViewport extends Viewport {
|
|
|
1023
1023
|
}
|
|
1024
1024
|
getImageDataMetadata(image) {
|
|
1025
1025
|
const { imagePlaneModule, imagePixelModule } = this.buildMetadata(image);
|
|
1026
|
-
let rowCosines, columnCosines;
|
|
1027
|
-
rowCosines = imagePlaneModule.rowCosines;
|
|
1028
|
-
columnCosines = imagePlaneModule.columnCosines;
|
|
1026
|
+
let { rowCosines, columnCosines } = imagePlaneModule;
|
|
1029
1027
|
if (rowCosines == null || columnCosines == null) {
|
|
1030
1028
|
rowCosines = [1, 0, 0];
|
|
1031
1029
|
columnCosines = [0, 1, 0];
|
|
@@ -599,6 +599,10 @@ class Viewport {
|
|
|
599
599
|
}
|
|
600
600
|
getVtkActiveCamera() {
|
|
601
601
|
const renderer = this.getRenderer();
|
|
602
|
+
if (!renderer) {
|
|
603
|
+
console.warn('No renderer found for the viewport');
|
|
604
|
+
return null;
|
|
605
|
+
}
|
|
602
606
|
return renderer.getActiveCamera();
|
|
603
607
|
}
|
|
604
608
|
getCameraNoRotation() {
|
|
@@ -157,6 +157,10 @@ class VolumeViewport extends BaseVolumeViewport {
|
|
|
157
157
|
}
|
|
158
158
|
setCameraClippingRange() {
|
|
159
159
|
const activeCamera = this.getVtkActiveCamera();
|
|
160
|
+
if (!activeCamera) {
|
|
161
|
+
console.warn('No active camera found');
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
160
164
|
if (activeCamera.getParallelProjection()) {
|
|
161
165
|
activeCamera.setClippingRange(-RENDERING_DEFAULTS.MAXIMUM_RAY_DISTANCE, RENDERING_DEFAULTS.MAXIMUM_RAY_DISTANCE);
|
|
162
166
|
}
|
|
@@ -12,7 +12,8 @@ export declare class HistoryMemo {
|
|
|
12
12
|
private undoAvailable;
|
|
13
13
|
private ring;
|
|
14
14
|
constructor(label?: string, size?: number);
|
|
15
|
-
get size():
|
|
15
|
+
get size(): number;
|
|
16
|
+
set size(newSize: number);
|
|
16
17
|
undo(items?: number): void;
|
|
17
18
|
redo(items?: number): void;
|
|
18
19
|
push(item: Memo | Memoable): Memo;
|
|
@@ -10,6 +10,13 @@ export class HistoryMemo {
|
|
|
10
10
|
get size() {
|
|
11
11
|
return this._size;
|
|
12
12
|
}
|
|
13
|
+
set size(newSize) {
|
|
14
|
+
this.ring = new Array(newSize);
|
|
15
|
+
this._size = newSize;
|
|
16
|
+
this.position = -1;
|
|
17
|
+
this.redoAvailable = 0;
|
|
18
|
+
this.undoAvailable = 0;
|
|
19
|
+
}
|
|
13
20
|
undo(items = 1) {
|
|
14
21
|
while (items > 0 && this.undoAvailable > 0) {
|
|
15
22
|
const item = this.ring[this.position];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/core",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.3",
|
|
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": "
|
|
85
|
+
"gitHead": "b93d749cd3d670af26430c9ef00413dcb1103559"
|
|
86
86
|
}
|