@cornerstonejs/tools 1.11.1 → 1.11.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/utilities/dynamicVolume/getDataInTime.js +7 -4
- package/dist/cjs/utilities/dynamicVolume/getDataInTime.js.map +1 -1
- package/dist/esm/utilities/dynamicVolume/getDataInTime.js +7 -4
- package/dist/esm/utilities/dynamicVolume/getDataInTime.js.map +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/package.json +3 -3
- package/src/utilities/dynamicVolume/getDataInTime.ts +9 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/tools",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.3",
|
|
4
4
|
"description": "Cornerstone3D Tools",
|
|
5
5
|
"main": "dist/umd/index.js",
|
|
6
6
|
"types": "dist/esm/index.d.ts",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"webpack:watch": "webpack --mode development --progress --watch --config ./.webpack/webpack.dev.js"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@cornerstonejs/core": "^1.11.
|
|
32
|
+
"@cornerstonejs/core": "^1.11.3",
|
|
33
33
|
"lodash.clonedeep": "4.5.0",
|
|
34
34
|
"lodash.get": "^4.4.2"
|
|
35
35
|
},
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"type": "individual",
|
|
53
53
|
"url": "https://ohif.org/donate"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "c0a3b216dfe15672558bd1186751f68d95a8f7ab"
|
|
56
56
|
}
|
|
@@ -40,13 +40,16 @@ function getDataInTime(
|
|
|
40
40
|
|
|
41
41
|
if (options.maskVolumeId) {
|
|
42
42
|
const segmentationVolume = cache.getVolume(options.maskVolumeId);
|
|
43
|
+
const segScalarData = segmentationVolume.getScalarData();
|
|
44
|
+
const indexArray = [];
|
|
45
|
+
|
|
46
|
+
// Get the index of every non-zero voxel in mask
|
|
47
|
+
for (let i = 0, len = segScalarData.length; i < len; i++) {
|
|
48
|
+
if (segScalarData[i] !== 0) {
|
|
49
|
+
indexArray.push(i);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
43
52
|
|
|
44
|
-
// Get the index of every non-zero voxel in mask by mapping indexes to
|
|
45
|
-
// new array, then using the array to filter
|
|
46
|
-
const indexArray = segmentationVolume
|
|
47
|
-
.getScalarData()
|
|
48
|
-
.map((_, i) => i)
|
|
49
|
-
.filter((i) => segmentationVolume.getScalarData()[i] !== 0);
|
|
50
53
|
const dataInTime = _getTimePointDataMask(frames, indexArray, dynamicVolume);
|
|
51
54
|
|
|
52
55
|
return dataInTime;
|