@cornerstonejs/core 1.68.0 → 1.68.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.68.0",
3
+ "version": "1.68.2",
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": "05f4cce031a814b5301976fae7e1b4bbb936150a"
50
+ "gitHead": "7d2a43e464e709b9da393ef58fd105395112a2d9"
51
51
  }
@@ -386,14 +386,6 @@ class VolumeViewport extends BaseVolumeViewport {
386
386
  * @returns ImageId
387
387
  */
388
388
  public getCurrentImageId = (): string | undefined => {
389
- if (this.getActors().length > 1) {
390
- console.warn(
391
- `Using the first/default actor of ${
392
- this.getActors().length
393
- } actors for getCurrentImageId.`
394
- );
395
- }
396
-
397
389
  const actorEntry = this.getDefaultActor();
398
390
 
399
391
  if (!actorEntry || !actorIsA(actorEntry, 'vtkVolume')) {
@@ -0,0 +1,33 @@
1
+ function componentToHex(c) {
2
+ const hex = c.toString(16);
3
+ return hex.length == 1 ? '0' + hex : hex;
4
+ }
5
+
6
+ /**
7
+ * Converts RGB color values to a hexadecimal color string.
8
+ * @param r - The red component value (0-255).
9
+ * @param g - The green component value (0-255).
10
+ * @param b - The blue component value (0-255).
11
+ * @returns The hexadecimal color string representation.
12
+ */
13
+ function rgbToHex(r, g, b) {
14
+ return '#' + componentToHex(r) + componentToHex(g) + componentToHex(b);
15
+ }
16
+
17
+ /**
18
+ * Converts a hexadecimal color code to an RGB object.
19
+ * @param hex - The hexadecimal color code to convert.
20
+ * @returns An object representing the RGB values of the color, or null if the input is invalid.
21
+ */
22
+ function hexToRgb(hex) {
23
+ const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
24
+ return result
25
+ ? {
26
+ r: parseInt(result[1], 16),
27
+ g: parseInt(result[2], 16),
28
+ b: parseInt(result[3], 16),
29
+ }
30
+ : null;
31
+ }
32
+
33
+ export { hexToRgb, rgbToHex };
@@ -147,7 +147,7 @@ class CentralizedWorkerManager {
147
147
  try {
148
148
  // fix if any of the args keys are a function then we need to proxy it
149
149
  // for the worker to be able to call it
150
- let finalCallbacks;
150
+ let finalCallbacks = [];
151
151
  if (callbacks.length) {
152
152
  finalCallbacks = callbacks.map((cb) => {
153
153
  return Comlink.proxy(cb);