@cornerstonejs/core 1.8.0 → 1.9.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.
- package/dist/cjs/RenderingEngine/StackViewport.js +14 -4
- package/dist/cjs/RenderingEngine/StackViewport.js.map +1 -1
- package/dist/esm/RenderingEngine/StackViewport.js +14 -4
- package/dist/esm/RenderingEngine/StackViewport.js.map +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/package.json +2 -2
- package/src/RenderingEngine/StackViewport.ts +20 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/umd/index.js",
|
|
6
6
|
"types": "dist/esm/index.d.ts",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"type": "individual",
|
|
47
47
|
"url": "https://ohif.org/donate"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "9330feafe97d0b7ce13e94de98d3d136ff2533f0"
|
|
50
50
|
}
|
|
@@ -2050,10 +2050,15 @@ class StackViewport extends Viewport implements IStackViewport {
|
|
|
2050
2050
|
const monochrome1 =
|
|
2051
2051
|
imagePixelModule.photometricInterpretation === 'MONOCHROME1';
|
|
2052
2052
|
|
|
2053
|
+
// invalidate the stack so that we can set the voi range
|
|
2054
|
+
this.stackInvalidated = true;
|
|
2055
|
+
|
|
2053
2056
|
this.setVOI(this._getInitialVOIRange(image), {
|
|
2054
2057
|
forceRecreateLUTFunction: !!monochrome1,
|
|
2055
2058
|
});
|
|
2056
|
-
|
|
2059
|
+
|
|
2060
|
+
// should carry over the invert color from the previous image if has been applied
|
|
2061
|
+
this.setInvertColor(this.invert || !!monochrome1);
|
|
2057
2062
|
|
|
2058
2063
|
// Saving position of camera on render, to cache the panning
|
|
2059
2064
|
this.cameraFocalPointOnRender = this.getCamera().focalPoint;
|
|
@@ -2107,9 +2112,20 @@ class StackViewport extends Viewport implements IStackViewport {
|
|
|
2107
2112
|
windowWidth: number | number[],
|
|
2108
2113
|
windowCenter: number | number[]
|
|
2109
2114
|
): { lower: number; upper: number } | undefined {
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2115
|
+
let center, width;
|
|
2116
|
+
|
|
2117
|
+
if (typeof windowCenter === 'number' && typeof windowWidth === 'number') {
|
|
2118
|
+
center = windowCenter;
|
|
2119
|
+
width = windowWidth;
|
|
2120
|
+
} else if (Array.isArray(windowCenter) && Array.isArray(windowWidth)) {
|
|
2121
|
+
center = windowCenter[0];
|
|
2122
|
+
width = windowWidth[0];
|
|
2123
|
+
}
|
|
2124
|
+
|
|
2125
|
+
// If center and width are defined, convert them to low-high range
|
|
2126
|
+
if (center !== undefined && width !== undefined) {
|
|
2127
|
+
return windowLevelUtil.toLowHighRange(width, center);
|
|
2128
|
+
}
|
|
2113
2129
|
}
|
|
2114
2130
|
|
|
2115
2131
|
/**
|