@cornerstonejs/core 3.7.6 → 3.7.8
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.
|
@@ -1364,6 +1364,10 @@ class StackViewport extends Viewport {
|
|
|
1364
1364
|
return resultList;
|
|
1365
1365
|
}
|
|
1366
1366
|
_loadAndDisplayImageGPU(imageId, imageIdIndex) {
|
|
1367
|
+
if (!imageId) {
|
|
1368
|
+
console.warn('No image id set yet to load');
|
|
1369
|
+
return;
|
|
1370
|
+
}
|
|
1367
1371
|
const eventDetail = {
|
|
1368
1372
|
imageId,
|
|
1369
1373
|
imageIdIndex,
|
|
@@ -1563,15 +1567,18 @@ class StackViewport extends Viewport {
|
|
|
1563
1567
|
}
|
|
1564
1568
|
scroll(delta, debounce = true, loop = false) {
|
|
1565
1569
|
const imageIds = this.imageIds;
|
|
1570
|
+
if (isNaN(this.targetImageIdIndex)) {
|
|
1571
|
+
return;
|
|
1572
|
+
}
|
|
1566
1573
|
const currentTargetImageIdIndex = this.targetImageIdIndex;
|
|
1567
1574
|
const numberOfFrames = imageIds.length;
|
|
1568
1575
|
let newTargetImageIdIndex = currentTargetImageIdIndex + delta;
|
|
1569
|
-
newTargetImageIdIndex = Math.max(0, newTargetImageIdIndex);
|
|
1570
1576
|
if (loop) {
|
|
1571
|
-
newTargetImageIdIndex =
|
|
1577
|
+
newTargetImageIdIndex =
|
|
1578
|
+
(newTargetImageIdIndex + numberOfFrames) % numberOfFrames;
|
|
1572
1579
|
}
|
|
1573
1580
|
else {
|
|
1574
|
-
newTargetImageIdIndex = Math.min(numberOfFrames - 1, newTargetImageIdIndex);
|
|
1581
|
+
newTargetImageIdIndex = Math.max(0, Math.min(numberOfFrames - 1, newTargetImageIdIndex));
|
|
1575
1582
|
}
|
|
1576
1583
|
this.targetImageIdIndex = newTargetImageIdIndex;
|
|
1577
1584
|
const targetImageId = imageIds[newTargetImageIdIndex];
|
|
@@ -19,16 +19,36 @@ function isValidVolume(imageIds) {
|
|
|
19
19
|
rows,
|
|
20
20
|
seriesInstanceUID,
|
|
21
21
|
};
|
|
22
|
-
|
|
22
|
+
let validVolume = true;
|
|
23
|
+
for (let i = 0; i < imageIds.length; i++) {
|
|
24
|
+
const imageId = imageIds[i];
|
|
23
25
|
const { modality, seriesInstanceUID } = metaData.get('generalSeriesModule', imageId);
|
|
24
26
|
const { imageOrientationPatient, pixelSpacing, columns, rows } = metaData.get('imagePlaneModule', imageId);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
if (seriesInstanceUID !== baseMetadata.seriesInstanceUID) {
|
|
28
|
+
validVolume = false;
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
if (modality !== baseMetadata.modality) {
|
|
32
|
+
validVolume = false;
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
if (columns !== baseMetadata.columns) {
|
|
36
|
+
validVolume = false;
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
if (rows !== baseMetadata.rows) {
|
|
40
|
+
validVolume = false;
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
if (!isEqual(imageOrientationPatient, baseMetadata.imageOrientationPatient)) {
|
|
44
|
+
validVolume = false;
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
if (!isEqual(pixelSpacing, baseMetadata.pixelSpacing)) {
|
|
48
|
+
validVolume = false;
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
32
52
|
return validVolume;
|
|
33
53
|
}
|
|
34
54
|
export { isValidVolume };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/core",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.8",
|
|
4
4
|
"description": "Cornerstone3D Core",
|
|
5
5
|
"module": "./dist/esm/index.js",
|
|
6
6
|
"types": "./dist/esm/index.d.ts",
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"type": "individual",
|
|
83
83
|
"url": "https://ohif.org/donate"
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "50a709f450227defbf8d49a11c2f12be110bbdf1"
|
|
86
86
|
}
|