@cornerstonejs/adapters 1.59.0 → 1.59.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/dist/adapters.es.js +18 -1
- package/dist/adapters.es.js.map +1 -1
- package/package.json +5 -5
package/dist/adapters.es.js
CHANGED
|
@@ -42735,6 +42735,22 @@ function getViewportImageIds(viewport) {
|
|
|
42735
42735
|
}
|
|
42736
42736
|
}
|
|
42737
42737
|
|
|
42738
|
+
function getRandomSampleFromArray(array, size) {
|
|
42739
|
+
const clonedArray = [...array];
|
|
42740
|
+
if (size >= clonedArray.length) {
|
|
42741
|
+
shuffleArray(clonedArray);
|
|
42742
|
+
return clonedArray;
|
|
42743
|
+
}
|
|
42744
|
+
shuffleArray(clonedArray);
|
|
42745
|
+
return clonedArray.slice(0, size);
|
|
42746
|
+
}
|
|
42747
|
+
function shuffleArray(array) {
|
|
42748
|
+
for (let i = array.length - 1; i > 0; i--) {
|
|
42749
|
+
const j = Math.floor(Math.random() * (i + 1));
|
|
42750
|
+
[array[i], array[j]] = [array[j], array[i]];
|
|
42751
|
+
}
|
|
42752
|
+
}
|
|
42753
|
+
|
|
42738
42754
|
function linePlaneIntersection(p0, p1, plane) {
|
|
42739
42755
|
const [x0, y0, z0] = p0;
|
|
42740
42756
|
const [x1, y1, z1] = p1;
|
|
@@ -42838,6 +42854,7 @@ var utilities = /*#__PURE__*/Object.freeze({
|
|
|
42838
42854
|
getImageLegacy: getImageLegacy,
|
|
42839
42855
|
getImageSliceDataForVolumeViewport: getImageSliceDataForVolumeViewport,
|
|
42840
42856
|
getMinMax: getMinMax,
|
|
42857
|
+
getRandomSampleFromArray: getRandomSampleFromArray,
|
|
42841
42858
|
getRuntimeId: getRuntimeId,
|
|
42842
42859
|
getScalarDataType: getScalarDataType,
|
|
42843
42860
|
getScalingParameters: getScalingParameters,
|
|
@@ -48289,7 +48306,7 @@ class FrameOfReferenceSpecificAnnotationManager {
|
|
|
48289
48306
|
return [];
|
|
48290
48307
|
}
|
|
48291
48308
|
if (toolName) {
|
|
48292
|
-
return annotations[groupKey][toolName];
|
|
48309
|
+
return annotations[groupKey][toolName] ? annotations[groupKey][toolName] : [];
|
|
48293
48310
|
}
|
|
48294
48311
|
return annotations[groupKey];
|
|
48295
48312
|
};
|