@cornerstonejs/core 1.68.1 → 1.68.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/dist/cjs/RenderingEngine/VolumeViewport.js +0 -3
- package/dist/cjs/RenderingEngine/VolumeViewport.js.map +1 -1
- package/dist/cjs/utilities/color.d.ts +7 -0
- package/dist/cjs/utilities/color.js +23 -0
- package/dist/cjs/utilities/color.js.map +1 -0
- package/dist/cjs/webWorkerManager/webWorkerManager.js +1 -1
- package/dist/cjs/webWorkerManager/webWorkerManager.js.map +1 -1
- package/dist/esm/RenderingEngine/VolumeViewport.js +0 -3
- package/dist/esm/RenderingEngine/VolumeViewport.js.map +1 -1
- package/dist/esm/utilities/color.js +19 -0
- package/dist/esm/utilities/color.js.map +1 -0
- package/dist/esm/webWorkerManager/webWorkerManager.js +1 -1
- package/dist/esm/webWorkerManager/webWorkerManager.js.map +1 -1
- package/dist/types/RenderingEngine/VolumeViewport.d.ts.map +1 -1
- package/dist/types/utilities/color.d.ts +8 -0
- package/dist/types/utilities/color.d.ts.map +1 -0
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/package.json +2 -2
- package/src/RenderingEngine/VolumeViewport.ts +0 -8
- package/src/utilities/color.ts +33 -0
- package/src/webWorkerManager/webWorkerManager.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/core",
|
|
3
|
-
"version": "1.68.
|
|
3
|
+
"version": "1.68.3",
|
|
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": "
|
|
50
|
+
"gitHead": "648e1625502b28ab85282c9edd50b9a51ebd34e0"
|
|
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);
|