@cornerstonejs/core 4.0.0-beta.4 → 4.0.0-beta.5
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.
|
@@ -15,6 +15,7 @@ import { RENDERING_DEFAULTS } from '../constants';
|
|
|
15
15
|
import { InterpolationType } from '../enums';
|
|
16
16
|
import { deepClone } from '../utilities/deepClone';
|
|
17
17
|
import { updatePlaneRestriction } from '../utilities/updatePlaneRestriction';
|
|
18
|
+
import { getConfiguration } from '../init';
|
|
18
19
|
class Viewport {
|
|
19
20
|
static { this.CameraViewPresentation = {
|
|
20
21
|
rotation: true,
|
|
@@ -27,7 +28,10 @@ class Viewport {
|
|
|
27
28
|
paletteLut: true,
|
|
28
29
|
}; }
|
|
29
30
|
constructor(props) {
|
|
30
|
-
this.insetImageMultiplier =
|
|
31
|
+
this.insetImageMultiplier = getConfiguration().rendering
|
|
32
|
+
?.useLegacyCameraFOV
|
|
33
|
+
? 1.1
|
|
34
|
+
: 1;
|
|
31
35
|
this.flipHorizontal = false;
|
|
32
36
|
this.flipVertical = false;
|
|
33
37
|
this.viewportStatus = ViewportStatus.NO_DATA;
|
|
@@ -525,7 +529,19 @@ class Viewport {
|
|
|
525
529
|
const idx = [middleIJK[0], middleIJK[1], middleIJK[2]];
|
|
526
530
|
imageData.indexToWorld(idx, focalPoint);
|
|
527
531
|
}
|
|
528
|
-
|
|
532
|
+
let widthWorld;
|
|
533
|
+
let heightWorld;
|
|
534
|
+
const config = getConfiguration();
|
|
535
|
+
const useLegacyMethod = config.rendering?.useLegacyCameraFOV ?? false;
|
|
536
|
+
if (imageData && !useLegacyMethod) {
|
|
537
|
+
const extent = imageData.getExtent();
|
|
538
|
+
const spacing = imageData.getSpacing();
|
|
539
|
+
widthWorld = (extent[1] - extent[0]) * spacing[0];
|
|
540
|
+
heightWorld = (extent[3] - extent[2]) * spacing[1];
|
|
541
|
+
}
|
|
542
|
+
else {
|
|
543
|
+
({ widthWorld, heightWorld } = this._getWorldDistanceViewUpAndViewRight(bounds, viewUp, viewPlaneNormal));
|
|
544
|
+
}
|
|
529
545
|
const canvasSize = [this.sWidth, this.sHeight];
|
|
530
546
|
const boundsAspectRatio = widthWorld / heightWorld;
|
|
531
547
|
const canvasAspectRatio = canvasSize[0] / canvasSize[1];
|
package/dist/esm/init.js
CHANGED
|
@@ -7,6 +7,7 @@ interface Cornerstone3DConfig {
|
|
|
7
7
|
rendering?: {
|
|
8
8
|
preferSizeOverAccuracy?: boolean;
|
|
9
9
|
useCPURendering?: boolean;
|
|
10
|
+
useLegacyCameraFOV?: boolean;
|
|
10
11
|
strictZSpacingForVolumeViewport?: boolean;
|
|
11
12
|
renderingEngineMode?: RenderingEngineModeType;
|
|
12
13
|
webGlContextCount?: number;
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "4.0.0-beta.
|
|
1
|
+
export declare const version = "4.0.0-beta.5";
|
package/dist/esm/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '4.0.0-beta.
|
|
1
|
+
export const version = '4.0.0-beta.5';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/core",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.5",
|
|
4
4
|
"description": "Cornerstone3D Core",
|
|
5
5
|
"module": "./dist/esm/index.js",
|
|
6
6
|
"types": "./dist/esm/index.d.ts",
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
"type": "individual",
|
|
98
98
|
"url": "https://ohif.org/donate"
|
|
99
99
|
},
|
|
100
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "c983ea46160362885b27f3c72cc84731cfe86b99"
|
|
101
101
|
}
|