@cornerstonejs/core 1.16.0 → 1.16.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/core",
3
- "version": "1.16.0",
3
+ "version": "1.16.2",
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": "e36741ef4ad046104fc63c1169073b48cbef8856"
49
+ "gitHead": "c2dc82d147694ce72b5cadde2ef25f5825891807"
50
50
  }
@@ -130,6 +130,8 @@ class StackViewport extends Viewport implements IStackViewport {
130
130
  private VOILUTFunction: VOILUTFunctionType;
131
131
  //
132
132
  private invert = false;
133
+ // The initial invert of the image loaded as opposed to the invert status of the viewport itself (see above).
134
+ private initialInvert = false;
133
135
  private interpolationType: InterpolationType;
134
136
 
135
137
  // Helpers
@@ -730,7 +732,7 @@ class StackViewport extends Viewport implements IStackViewport {
730
732
  this.setRotation(0);
731
733
  }
732
734
  this.setInterpolationType(InterpolationType.LINEAR);
733
- this.setInvertColor(false);
735
+ this.setInvertColor(this.initialInvert);
734
736
  }
735
737
 
736
738
  private _setPropertiesFromCache(): void {
@@ -2066,8 +2068,10 @@ class StackViewport extends Viewport implements IStackViewport {
2066
2068
  forceRecreateLUTFunction: !!monochrome1,
2067
2069
  });
2068
2070
 
2071
+ this.initialInvert = !!monochrome1;
2072
+
2069
2073
  // should carry over the invert color from the previous image if has been applied
2070
- this.setInvertColor(this.invert || !!monochrome1);
2074
+ this.setInvertColor(this.invert || this.initialInvert);
2071
2075
 
2072
2076
  // Saving position of camera on render, to cache the panning
2073
2077
  this.cameraFocalPointOnRender = this.getCamera().focalPoint;
package/src/init.ts CHANGED
@@ -100,7 +100,7 @@ function hasSharedArrayBuffer() {
100
100
  * @returns A promise that resolves to true cornerstone has been initialized successfully.
101
101
  * @category Initialization
102
102
  */
103
- async function init(configuration = {}): Promise<boolean> {
103
+ async function init(configuration = config): Promise<boolean> {
104
104
  if (csRenderInitialized) {
105
105
  return csRenderInitialized;
106
106
  }