@cornerstonejs/core 4.3.2 → 4.3.4

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.
@@ -30,6 +30,7 @@ import * as metaData from '../metaData';
30
30
  import { getCameraVectors } from './helpers/getCameraVectors';
31
31
  import { isContextPoolRenderingEngine } from './helpers/isContextPoolRenderingEngine';
32
32
  import mprCameraValues from '../constants/mprCameraValues';
33
+ import { isInvalidNumber } from './helpers/isInvalidNumber';
33
34
  import { createSharpeningRenderPass } from './renderPasses';
34
35
  class BaseVolumeViewport extends Viewport {
35
36
  constructor(props) {
@@ -545,6 +546,10 @@ class BaseVolumeViewport extends Viewport {
545
546
  if (typeof voiRangeToUse === 'undefined') {
546
547
  throw new Error('voiRangeToUse is undefined, need to implement this in the new volume model');
547
548
  }
549
+ if ([voiRangeToUse.lower, voiRangeToUse.upper].some(isInvalidNumber)) {
550
+ console.warn('VOI range contains invalid values, ignoring setVOI request', voiRangeToUse);
551
+ return;
552
+ }
548
553
  const { VOILUTFunction } = this.getProperties(volumeIdToUse);
549
554
  if (VOILUTFunction === VOILUTFunctionType.SAMPLED_SIGMOID) {
550
555
  const cfun = createSigmoidRGBTransferFunction(voiRangeToUse);
@@ -0,0 +1 @@
1
+ export declare const isInvalidNumber: (value: unknown) => boolean;
@@ -0,0 +1,3 @@
1
+ export const isInvalidNumber = (value) => {
2
+ return !(typeof value === 'number' && Number.isFinite(value));
3
+ };
@@ -1 +1 @@
1
- export declare const version = "4.3.2";
1
+ export declare const version = "4.3.4";
@@ -1 +1 @@
1
- export const version = '4.3.2';
1
+ export const version = '4.3.4';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/core",
3
- "version": "4.3.2",
3
+ "version": "4.3.4",
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": "d92b1728b76c7295e00fec0821e3efc1384499a6"
100
+ "gitHead": "ddb3f0c2f7cda1e95730a750582c2a874d19f48d"
101
101
  }