@cornerstonejs/core 1.2.7 → 1.2.8

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.2.7",
3
+ "version": "1.2.8",
4
4
  "description": "",
5
5
  "main": "dist/umd/index.js",
6
6
  "types": "dist/esm/index.d.ts",
@@ -44,5 +44,5 @@
44
44
  "type": "individual",
45
45
  "url": "https://ohif.org/donate"
46
46
  },
47
- "gitHead": "4b9c08e09216daac428c258bcb123a1ed53eb3c0"
47
+ "gitHead": "1b59634912012888252762259457e616ea330777"
48
48
  }
@@ -1810,7 +1810,10 @@ class StackViewport extends Viewport implements IStackViewport {
1810
1810
  }
1811
1811
 
1812
1812
  //If Photometric Interpretation is not the same for the next image we are trying to load, invalidate the stack to recreate the VTK imageData
1813
- if (this.csImage?.imageFrame.photometricInterpretation !== image.imageFrame.photometricInterpretation) {
1813
+ if (
1814
+ this.csImage?.imageFrame?.photometricInterpretation !==
1815
+ image.imageFrame?.photometricInterpretation
1816
+ ) {
1814
1817
  this.stackInvalidated = true;
1815
1818
  }
1816
1819
 
@@ -2098,10 +2101,13 @@ class StackViewport extends Viewport implements IStackViewport {
2098
2101
  // @ts-ignore: vtkjs incorrect typing
2099
2102
  activeCamera.setFreezeFocalPoint(true);
2100
2103
 
2101
- this.setVOI(this._getInitialVOIRange(image));
2102
- this.setInvertColor(
2103
- imagePixelModule.photometricInterpretation === 'MONOCHROME1'
2104
- );
2104
+ const monochrome1 =
2105
+ imagePixelModule.photometricInterpretation === 'MONOCHROME1';
2106
+
2107
+ this.setVOI(this._getInitialVOIRange(image), {
2108
+ forceRecreateLUTFunction: !!monochrome1,
2109
+ });
2110
+ this.setInvertColor(!!monochrome1);
2105
2111
 
2106
2112
  // Saving position of camera on render, to cache the panning
2107
2113
  this.cameraFocalPointOnRender = this.getCamera().focalPoint;