@cornerstonejs/core 1.9.2 → 1.9.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/core",
3
- "version": "1.9.2",
3
+ "version": "1.9.3",
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": "19653711d5666fb932862b5c8ac327081ade5248"
49
+ "gitHead": "64d4409021e5090043cace49fbefa75f27bfad83"
50
50
  }
@@ -606,7 +606,9 @@ class StackViewport extends Viewport implements IStackViewport {
606
606
  this.hasPixelSpacing = scale > 0 || imagePlaneModule.rowPixelSpacing > 0;
607
607
  imagePlaneModule.calibration = calibration;
608
608
 
609
- if (!isUpdated) return imagePlaneModule;
609
+ if (!isUpdated) {
610
+ return imagePlaneModule;
611
+ }
610
612
 
611
613
  this.calibration = calibration;
612
614
  this._publishCalibratedEvent = true;
@@ -1755,10 +1757,17 @@ class StackViewport extends Viewport implements IStackViewport {
1755
1757
  return;
1756
1758
  }
1757
1759
 
1758
- //If Photometric Interpretation is not the same for the next image we are trying to load, invalidate the stack to recreate the VTK imageData
1760
+ // If Photometric Interpretation is not the same for the next image we are trying to load
1761
+ // invalidate the stack to recreate the VTK imageData
1762
+ const csImgFrame = this.csImage?.imageFrame;
1763
+ const imgFrame = image?.imageFrame;
1764
+
1765
+ // if a volume is decached into images then the imageFrame will be undefined
1759
1766
  if (
1760
- this.csImage?.imageFrame.photometricInterpretation !==
1761
- image?.imageFrame?.photometricInterpretation
1767
+ csImgFrame?.photometricInterpretation !==
1768
+ imgFrame?.photometricInterpretation ||
1769
+ this.csImage?.photometricInterpretation !==
1770
+ image?.photometricInterpretation
1762
1771
  ) {
1763
1772
  this.stackInvalidated = true;
1764
1773
  }
@@ -2564,7 +2573,9 @@ class StackViewport extends Viewport implements IStackViewport {
2564
2573
  public hasImageURI = (imageURI: string): boolean => {
2565
2574
  const imageIds = this.imageIds;
2566
2575
  for (let i = 0; i < imageIds.length; i++) {
2567
- if (imageIdToURI(imageIds[i]) === imageURI) return true;
2576
+ if (imageIdToURI(imageIds[i]) === imageURI) {
2577
+ return true;
2578
+ }
2568
2579
  }
2569
2580
 
2570
2581
  return false;
@@ -72,6 +72,8 @@ interface IImage {
72
72
  sliceThickness?: number;
73
73
  /** whether image pixels are inverted in color */
74
74
  invert: boolean;
75
+ /** image photometric interpretation */
76
+ photometricInterpretation?: string;
75
77
  /** image size in number of bytes */
76
78
  sizeInBytes: number;
77
79
  /** CPU: custom modality LUT for image */