@cornerstonejs/core 1.35.2 → 1.36.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/core",
3
- "version": "1.35.2",
3
+ "version": "1.36.0",
4
4
  "description": "",
5
5
  "main": "src/index.ts",
6
6
  "types": "dist/types/index.d.ts",
@@ -47,5 +47,5 @@
47
47
  "type": "individual",
48
48
  "url": "https://ohif.org/donate"
49
49
  },
50
- "gitHead": "323d50dd5e96fd476514db0cd2b62d526d480de0"
50
+ "gitHead": "616ef6915f122cab6d1e27e2d02ebc95484a4e37"
51
51
  }
@@ -239,7 +239,7 @@ class RequestPoolManager {
239
239
  this.numRequests[type]++;
240
240
  this.awake = true;
241
241
 
242
- requestDetails.requestFn().finally(() => {
242
+ requestDetails.requestFn()?.finally(() => {
243
243
  this.numRequests[type]--;
244
244
  this.startAgain();
245
245
  });
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Four elements RGBA as 0-255
3
+ */
4
+ export type Color = [number, number, number, number];
5
+
6
+ /**
7
+ * Color LUT Array - Array of colors
8
+ * [[0,0,0,0], [200,200,200,200], ....]
9
+ */
10
+ export type ColorLUT = Array<Color>;
@@ -98,6 +98,7 @@ export type {
98
98
  IImagesLoader,
99
99
  } from './IRetrieveConfiguration';
100
100
  import type { ImageLoadListener } from './ImageLoadListener';
101
+ import type { Color, ColorLUT } from './Color';
101
102
  import type VideoViewportProperties from './VideoViewportProperties';
102
103
  import type IVideoViewport from './IVideoViewport';
103
104
  import type {
@@ -211,4 +212,6 @@ export type {
211
212
  // video
212
213
  InternalVideoCamera,
213
214
  VideoViewportInput,
215
+ Color,
216
+ ColorLUT,
214
217
  };
@@ -31,7 +31,12 @@ const defaultArrayMerge = (target, source, optionsArgument) => {
31
31
  } else if (isMergeableObject(e)) {
32
32
  destination[i] = deepMerge(target[i], e, optionsArgument);
33
33
  } else if (target.indexOf(e) === -1) {
34
- destination.push(cloneIfNecessary(e, optionsArgument));
34
+ // IMPORTANT: WE SHOULD NOT PUSH NEW ELEMENTS TO THE ARRAY
35
+ // INSTEAD WE SHOULD REPLACE THE ELEMENT, this will result
36
+ // in unexpected behaviors if the initial tool parameters
37
+ // are desired to override the default tool parameters that are
38
+ // arrays
39
+ destination[i] = cloneIfNecessary(e, optionsArgument);
35
40
  }
36
41
  });
37
42