@cornerstonejs/tools 0.53.0 → 0.54.0
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/segmentation/index.d.ts +2 -1
- package/dist/cjs/utilities/segmentation/index.js +3 -1
- package/dist/cjs/utilities/segmentation/index.js.map +1 -1
- package/dist/cjs/utilities/segmentation/rectangleROIThresholdVolumeByRange.d.ts +1 -5
- package/dist/cjs/utilities/segmentation/rectangleROIThresholdVolumeByRange.js.map +1 -1
- package/dist/cjs/utilities/segmentation/thresholdSegmentationByRange.d.ts +4 -0
- package/dist/cjs/utilities/segmentation/thresholdSegmentationByRange.js +54 -0
- package/dist/cjs/utilities/segmentation/thresholdSegmentationByRange.js.map +1 -0
- package/dist/cjs/utilities/segmentation/thresholdVolumeByRange.d.ts +1 -5
- package/dist/cjs/utilities/segmentation/thresholdVolumeByRange.js +4 -49
- package/dist/cjs/utilities/segmentation/thresholdVolumeByRange.js.map +1 -1
- package/dist/cjs/utilities/segmentation/utilities.d.ts +11 -0
- package/dist/cjs/utilities/segmentation/utilities.js +55 -0
- package/dist/cjs/utilities/segmentation/utilities.js.map +1 -1
- package/dist/esm/utilities/segmentation/index.d.ts +2 -1
- package/dist/esm/utilities/segmentation/index.js +2 -1
- package/dist/esm/utilities/segmentation/index.js.map +1 -1
- package/dist/esm/utilities/segmentation/rectangleROIThresholdVolumeByRange.d.ts +1 -5
- package/dist/esm/utilities/segmentation/rectangleROIThresholdVolumeByRange.js.map +1 -1
- package/dist/esm/utilities/segmentation/thresholdSegmentationByRange.d.ts +4 -0
- package/dist/esm/utilities/segmentation/thresholdSegmentationByRange.js +52 -0
- package/dist/esm/utilities/segmentation/thresholdSegmentationByRange.js.map +1 -0
- package/dist/esm/utilities/segmentation/thresholdVolumeByRange.d.ts +1 -5
- package/dist/esm/utilities/segmentation/thresholdVolumeByRange.js +3 -45
- package/dist/esm/utilities/segmentation/thresholdVolumeByRange.js.map +1 -1
- package/dist/esm/utilities/segmentation/utilities.d.ts +11 -0
- package/dist/esm/utilities/segmentation/utilities.js +52 -0
- package/dist/esm/utilities/segmentation/utilities.js.map +1 -1
- package/dist/umd/index.js +1 -2
- package/dist/umd/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/umd/index.js.LICENSE.txt +0 -6
|
@@ -8,4 +8,5 @@ import { triggerSegmentationRender } from './triggerSegmentationRender';
|
|
|
8
8
|
import floodFill from './floodFill';
|
|
9
9
|
import { getBrushSizeForToolGroup, setBrushSizeForToolGroup } from './brushSizeForToolGroup';
|
|
10
10
|
import { getBrushThresholdForToolGroup, setBrushThresholdForToolGroup } from './brushThresholdForToolGroup';
|
|
11
|
-
|
|
11
|
+
import thresholdSegmentationByRange from './thresholdSegmentationByRange';
|
|
12
|
+
export { thresholdVolumeByRange, createMergedLabelmapForIndex, isValidRepresentationConfig, getDefaultRepresentationConfig, createLabelmapVolumeForViewport, rectangleROIThresholdVolumeByRange, triggerSegmentationRender, floodFill, getBrushSizeForToolGroup, setBrushSizeForToolGroup, getBrushThresholdForToolGroup, setBrushThresholdForToolGroup, thresholdSegmentationByRange, };
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.setBrushThresholdForToolGroup = exports.getBrushThresholdForToolGroup = exports.setBrushSizeForToolGroup = exports.getBrushSizeForToolGroup = exports.floodFill = exports.triggerSegmentationRender = exports.rectangleROIThresholdVolumeByRange = exports.createLabelmapVolumeForViewport = exports.getDefaultRepresentationConfig = exports.isValidRepresentationConfig = exports.createMergedLabelmapForIndex = exports.thresholdVolumeByRange = void 0;
|
|
6
|
+
exports.thresholdSegmentationByRange = exports.setBrushThresholdForToolGroup = exports.getBrushThresholdForToolGroup = exports.setBrushSizeForToolGroup = exports.getBrushSizeForToolGroup = exports.floodFill = exports.triggerSegmentationRender = exports.rectangleROIThresholdVolumeByRange = exports.createLabelmapVolumeForViewport = exports.getDefaultRepresentationConfig = exports.isValidRepresentationConfig = exports.createMergedLabelmapForIndex = exports.thresholdVolumeByRange = void 0;
|
|
7
7
|
const thresholdVolumeByRange_1 = __importDefault(require("./thresholdVolumeByRange"));
|
|
8
8
|
exports.thresholdVolumeByRange = thresholdVolumeByRange_1.default;
|
|
9
9
|
const rectangleROIThresholdVolumeByRange_1 = __importDefault(require("./rectangleROIThresholdVolumeByRange"));
|
|
@@ -26,4 +26,6 @@ Object.defineProperty(exports, "setBrushSizeForToolGroup", { enumerable: true, g
|
|
|
26
26
|
const brushThresholdForToolGroup_1 = require("./brushThresholdForToolGroup");
|
|
27
27
|
Object.defineProperty(exports, "getBrushThresholdForToolGroup", { enumerable: true, get: function () { return brushThresholdForToolGroup_1.getBrushThresholdForToolGroup; } });
|
|
28
28
|
Object.defineProperty(exports, "setBrushThresholdForToolGroup", { enumerable: true, get: function () { return brushThresholdForToolGroup_1.setBrushThresholdForToolGroup; } });
|
|
29
|
+
const thresholdSegmentationByRange_1 = __importDefault(require("./thresholdSegmentationByRange"));
|
|
30
|
+
exports.thresholdSegmentationByRange = thresholdSegmentationByRange_1.default;
|
|
29
31
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utilities/segmentation/index.ts"],"names":[],"mappings":";;;;;;AAAA,sFAA8D;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utilities/segmentation/index.ts"],"names":[],"mappings":";;;;;;AAAA,sFAA8D;AAmB5D,iCAnBK,gCAAsB,CAmBL;AAlBxB,8GAAsF;AAuBpF,6CAvBK,4CAAkC,CAuBL;AAtBpC,kGAA0E;AAkBxE,uCAlBK,sCAA4B,CAkBL;AAjB9B,gGAAwE;AAkBtE,sCAlBK,qCAA2B,CAkBL;AAjB7B,sGAA8E;AAkB5E,yCAlBK,wCAA8B,CAkBL;AAjBhC,wGAAgF;AAkB9E,0CAlBK,yCAA+B,CAkBL;AAjBjC,2EAAwE;AAmBtE,0GAnBO,qDAAyB,OAmBP;AAlB3B,4DAAoC;AAmBlC,oBAnBK,mBAAS,CAmBL;AAlBX,mEAGiC;AAgB/B,yGAlBA,gDAAwB,OAkBA;AACxB,yGAlBA,gDAAwB,OAkBA;AAhB1B,6EAGsC;AAcpC,8GAhBA,0DAA6B,OAgBA;AAC7B,8GAhBA,0DAA6B,OAgBA;AAd/B,kGAA0E;AAexE,uCAfK,sCAA4B,CAeL"}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import type { Types } from '@cornerstonejs/core';
|
|
2
|
-
|
|
3
|
-
volume: Types.IImageVolume;
|
|
4
|
-
lower: number;
|
|
5
|
-
upper: number;
|
|
6
|
-
};
|
|
2
|
+
import { ThresholdInformation } from './utilities';
|
|
7
3
|
export declare type ThresholdOptions = {
|
|
8
4
|
numSlicesToProject?: number;
|
|
9
5
|
overwrite: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rectangleROIThresholdVolumeByRange.js","sourceRoot":"","sources":["../../../../src/utilities/segmentation/rectangleROIThresholdVolumeByRange.ts"],"names":[],"mappings":";;;;;AACA,iEAAyD;AACzD,uCAGqB;AAErB,sFAA8D;AAC9D,oIAA4G;
|
|
1
|
+
{"version":3,"file":"rectangleROIThresholdVolumeByRange.js","sourceRoot":"","sources":["../../../../src/utilities/segmentation/rectangleROIThresholdVolumeByRange.ts"],"names":[],"mappings":";;;;;AACA,iEAAyD;AACzD,uCAGqB;AAErB,sFAA8D;AAC9D,oIAA4G;AA+B5G,SAAS,kCAAkC,CACzC,cAAwB,EACxB,kBAAsC,EACtC,0BAAkD,EAClD,OAAyB;IAEzB,MAAM,WAAW,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,aAAa,EAAE,EAAE;QACvD,OAAO,kBAAK,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;IAEH,oBAAoB,CAAC,WAAW,CAAC,CAAC;IAElC,IAAI,SAAS,CAAC;IACd,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,0BAA0B,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAE1D,MAAM,UAAU,GACd,0BAA0B,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC,MAAM,CAAC;QAC9D,IAAI,UAAU,KAAK,kBAAkB,CAAC,aAAa,EAAE,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,EAAE;YACvE,SAAS,GAAG,IAAA,8CAAoC,EAC9C,WAAW,EACX,0BAA0B,CAAC,CAAC,CAAC,CAAC,MAAM,EACpC,OAAO,CACR,CAAC;SACH;KACF;IAED,MAAM,wBAAwB,GAAG,IAAA,gCAAsB,EACrD,kBAAkB,EAClB,0BAA0B,kCACrB,OAAO,KAAE,SAAS,IACxB,CAAC;IAEF,OAAO,wBAAwB,CAAC;AAClC,CAAC;AAED,SAAS,oBAAoB,CAAC,WAAW;IACvC,MAAM,cAAc,GAAG;QACrB,iCAAyB,CAAC,QAAQ;QAClC,yCAAiC,CAAC,QAAQ;KAC3C,CAAC;IAEF,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE;QACpC,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAC1C,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;YAClC,MAAM,IAAI,KAAK,CACb,sHAAsH,CACvH,CAAC;SACH;KACF;AACH,CAAC;AAED,kBAAe,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Types } from '@cornerstonejs/core';
|
|
2
|
+
import { ThresholdInformation } from './utilities';
|
|
3
|
+
declare function thresholdSegmentationByRange(segmentationVolume: Types.IImageVolume, segmentationIndex: number, thresholdVolumeInformation: ThresholdInformation[], overlapType: number): Types.IImageVolume;
|
|
4
|
+
export default thresholdSegmentationByRange;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utilities_1 = require("../../utilities");
|
|
4
|
+
const triggerSegmentationEvents_1 = require("../../stateManagement/segmentation/triggerSegmentationEvents");
|
|
5
|
+
const utilities_2 = require("./utilities");
|
|
6
|
+
function thresholdSegmentationByRange(segmentationVolume, segmentationIndex, thresholdVolumeInformation, overlapType) {
|
|
7
|
+
const scalarData = segmentationVolume.getScalarData();
|
|
8
|
+
const { baseVolumeIdx, volumeInfoList } = (0, utilities_2.processVolumes)(segmentationVolume, thresholdVolumeInformation);
|
|
9
|
+
volumeInfoList.forEach((volumeInfo) => {
|
|
10
|
+
const { volumeSize } = volumeInfo;
|
|
11
|
+
if (volumeSize === scalarData.length) {
|
|
12
|
+
_handleSameSizeVolume(scalarData, segmentationIndex, volumeInfo);
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
_handleDifferentSizeVolume(scalarData, segmentationIndex, volumeInfo, volumeInfoList, baseVolumeIdx, overlapType);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
(0, triggerSegmentationEvents_1.triggerSegmentationDataModified)(segmentationVolume.volumeId);
|
|
19
|
+
return segmentationVolume;
|
|
20
|
+
}
|
|
21
|
+
function _handleDifferentSizeVolume(scalarData, segmentationIndex, volumeInfo, volumeInfoList, baseVolumeIdx, overlapType) {
|
|
22
|
+
const { imageData, lower, upper, dimensions } = volumeInfo;
|
|
23
|
+
let total, overlaps, range;
|
|
24
|
+
for (let i = 0; i < scalarData.length; i++) {
|
|
25
|
+
if (scalarData[i] === segmentationIndex) {
|
|
26
|
+
const overlapBounds = (0, utilities_2.getVoxelOverlap)(imageData, dimensions, volumeInfoList[baseVolumeIdx].spacing, volumeInfoList[baseVolumeIdx].imageData.getPoint(i));
|
|
27
|
+
const callbackOverlap = ({ value }) => {
|
|
28
|
+
total = total + 1;
|
|
29
|
+
if (value >= range.lower && value <= range.upper) {
|
|
30
|
+
overlaps = overlaps + 1;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
total = 0;
|
|
34
|
+
overlaps = 0;
|
|
35
|
+
range = { lower, upper };
|
|
36
|
+
let overlapTest = false;
|
|
37
|
+
(0, utilities_1.pointInShapeCallback)(imageData, () => true, callbackOverlap, overlapBounds);
|
|
38
|
+
overlapTest = overlapType === 0 ? overlaps > 0 : overlaps === total;
|
|
39
|
+
scalarData[i] = overlapTest ? segmentationIndex : 0;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return { total, range, overlaps };
|
|
43
|
+
}
|
|
44
|
+
function _handleSameSizeVolume(scalarData, segmentationIndex, volumeInfo) {
|
|
45
|
+
const { referenceValues, lower, upper } = volumeInfo;
|
|
46
|
+
for (let i = 0; i < scalarData.length; i++) {
|
|
47
|
+
if (scalarData[i] === segmentationIndex) {
|
|
48
|
+
const value = referenceValues[i];
|
|
49
|
+
scalarData[i] = value >= lower && value <= upper ? segmentationIndex : 0;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.default = thresholdSegmentationByRange;
|
|
54
|
+
//# sourceMappingURL=thresholdSegmentationByRange.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thresholdSegmentationByRange.js","sourceRoot":"","sources":["../../../../src/utilities/segmentation/thresholdSegmentationByRange.ts"],"names":[],"mappings":";;AACA,+CAAuD;AACvD,4GAA+G;AAC/G,2CAIqB;AAarB,SAAS,4BAA4B,CACnC,kBAAsC,EACtC,iBAAyB,EACzB,0BAAkD,EAClD,WAAmB;IAEnB,MAAM,UAAU,GAAG,kBAAkB,CAAC,aAAa,EAAE,CAAC;IAGtD,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,GAAG,IAAA,0BAAc,EACtD,kBAAkB,EAClB,0BA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';
|
|
3
|
+
import { ThresholdInformation } from './utilities';
|
|
3
4
|
export declare type ThresholdRangeOptions = {
|
|
4
5
|
overwrite: boolean;
|
|
5
6
|
boundsIJK: BoundsIJK;
|
|
6
7
|
overlapType?: number;
|
|
7
8
|
};
|
|
8
|
-
export declare type ThresholdInformation = {
|
|
9
|
-
volume: Types.IImageVolume;
|
|
10
|
-
lower: number;
|
|
11
|
-
upper: number;
|
|
12
|
-
};
|
|
13
9
|
declare function thresholdVolumeByRange(segmentationVolume: Types.IImageVolume, thresholdVolumeInformation: ThresholdInformation[], options: ThresholdRangeOptions): Types.IImageVolume;
|
|
14
10
|
export default thresholdVolumeByRange;
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const core_1 = require("@cornerstonejs/core");
|
|
7
3
|
const utilities_1 = require("../../utilities");
|
|
8
4
|
const triggerSegmentationEvents_1 = require("../../stateManagement/segmentation/triggerSegmentationEvents");
|
|
9
|
-
const
|
|
10
|
-
const equalsCheck = (a, b) => {
|
|
11
|
-
return JSON.stringify(a) === JSON.stringify(b);
|
|
12
|
-
};
|
|
5
|
+
const utilities_2 = require("./utilities");
|
|
13
6
|
function thresholdVolumeByRange(segmentationVolume, thresholdVolumeInformation, options) {
|
|
14
|
-
const {
|
|
7
|
+
const { imageData: segmentationImageData } = segmentationVolume;
|
|
15
8
|
const scalarData = segmentationVolume.getScalarData();
|
|
16
9
|
const { overwrite, boundsIJK } = options;
|
|
17
10
|
const overlapType = (options === null || options === void 0 ? void 0 : options.overlapType) || 0;
|
|
@@ -20,28 +13,7 @@ function thresholdVolumeByRange(segmentationVolume, thresholdVolumeInformation,
|
|
|
20
13
|
scalarData[i] = 0;
|
|
21
14
|
}
|
|
22
15
|
}
|
|
23
|
-
const volumeInfoList =
|
|
24
|
-
let baseVolumeIdx = 0;
|
|
25
|
-
for (let i = 0; i < thresholdVolumeInformation.length; i++) {
|
|
26
|
-
const { imageData, spacing, dimensions } = thresholdVolumeInformation[i].volume;
|
|
27
|
-
const volumeSize = thresholdVolumeInformation[i].volume.getScalarData().length;
|
|
28
|
-
if (volumeSize === scalarData.length &&
|
|
29
|
-
equalsCheck(spacing, segmentationSpacing)) {
|
|
30
|
-
baseVolumeIdx = i;
|
|
31
|
-
}
|
|
32
|
-
const referenceValues = imageData.getPointData().getScalars().getData();
|
|
33
|
-
const lower = thresholdVolumeInformation[i].lower;
|
|
34
|
-
const upper = thresholdVolumeInformation[i].upper;
|
|
35
|
-
volumeInfoList.push({
|
|
36
|
-
imageData,
|
|
37
|
-
referenceValues,
|
|
38
|
-
lower,
|
|
39
|
-
upper,
|
|
40
|
-
spacing,
|
|
41
|
-
dimensions,
|
|
42
|
-
volumeSize,
|
|
43
|
-
});
|
|
44
|
-
}
|
|
16
|
+
const { baseVolumeIdx, volumeInfoList } = (0, utilities_2.processVolumes)(segmentationVolume, thresholdVolumeInformation);
|
|
45
17
|
let overlaps, total, range;
|
|
46
18
|
const testOverlapRange = (volumeInfo, voxelSpacing, voxelCenter) => {
|
|
47
19
|
const callbackOverlap = ({ value }) => {
|
|
@@ -51,7 +23,7 @@ function thresholdVolumeByRange(segmentationVolume, thresholdVolumeInformation,
|
|
|
51
23
|
}
|
|
52
24
|
};
|
|
53
25
|
const { imageData, dimensions, lower, upper } = volumeInfo;
|
|
54
|
-
const overlapBounds = getVoxelOverlap(imageData, dimensions, voxelSpacing, voxelCenter);
|
|
26
|
+
const overlapBounds = (0, utilities_2.getVoxelOverlap)(imageData, dimensions, voxelSpacing, voxelCenter);
|
|
55
27
|
total = 0;
|
|
56
28
|
overlaps = 0;
|
|
57
29
|
range = { lower, upper };
|
|
@@ -76,23 +48,6 @@ function thresholdVolumeByRange(segmentationVolume, thresholdVolumeInformation,
|
|
|
76
48
|
return true;
|
|
77
49
|
}
|
|
78
50
|
};
|
|
79
|
-
const getVoxelOverlap = (imageData, dimensions, voxelSpacing, voxelCenter) => {
|
|
80
|
-
const voxelCornersWorld = [];
|
|
81
|
-
for (let i = 0; i < 2; i++) {
|
|
82
|
-
for (let j = 0; j < 2; j++) {
|
|
83
|
-
for (let k = 0; k < 2; k++) {
|
|
84
|
-
const point = voxelCenter;
|
|
85
|
-
point[0] = point[0] + ((i * 2 - 1) * voxelSpacing[0]) / 2;
|
|
86
|
-
point[1] = point[1] + ((j * 2 - 1) * voxelSpacing[1]) / 2;
|
|
87
|
-
point[2] = point[2] + ((k * 2 - 1) * voxelSpacing[2]) / 2;
|
|
88
|
-
voxelCornersWorld.push(point);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
const voxelCornersIJK = voxelCornersWorld.map((world) => core_1.utilities.transformWorldToIndex(imageData, world));
|
|
93
|
-
const overlapBounds = (0, getBoundingBoxAroundShape_1.default)(voxelCornersIJK, dimensions);
|
|
94
|
-
return overlapBounds;
|
|
95
|
-
};
|
|
96
51
|
const callback = ({ index, pointIJK, pointLPS }) => {
|
|
97
52
|
let insert = volumeInfoList.length > 0;
|
|
98
53
|
for (let i = 0; i < volumeInfoList.length; i++) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thresholdVolumeByRange.js","sourceRoot":"","sources":["../../../../src/utilities/segmentation/thresholdVolumeByRange.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"thresholdVolumeByRange.js","sourceRoot":"","sources":["../../../../src/utilities/segmentation/thresholdVolumeByRange.ts"],"names":[],"mappings":";;AACA,+CAAuD;AACvD,4GAA+G;AAE/G,2CAIqB;AA2BrB,SAAS,sBAAsB,CAC7B,kBAAsC,EACtC,0BAAkD,EAClD,OAA8B;IAE9B,MAAM,EAAE,SAAS,EAAE,qBAAqB,EAAE,GAAG,kBAAkB,CAAC;IAChE,MAAM,UAAU,GAA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,CAAC,MAAM,EAAE;gBACX,MAAM;aACP;SACF;QAGD,IAAI,MAAM;YAAE,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC,CAAC;IAEF,IAAA,gCAAoB,EAAC,qBAAqB,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;IAE7E,IAAA,2DAA+B,EAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAE7D,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AAED,kBAAe,sBAAsB,CAAC"}
|
|
@@ -1,2 +1,13 @@
|
|
|
1
|
+
import { Types } from '@cornerstonejs/core';
|
|
1
2
|
import BrushTool from '../../tools/segmentation/BrushTool';
|
|
3
|
+
export declare type ThresholdInformation = {
|
|
4
|
+
volume: Types.IImageVolume;
|
|
5
|
+
lower: number;
|
|
6
|
+
upper: number;
|
|
7
|
+
};
|
|
2
8
|
export default function getBrushToolInstances(toolGroupId: any): BrushTool[];
|
|
9
|
+
export declare function getVoxelOverlap(imageData: any, dimensions: any, voxelSpacing: any, voxelCenter: any): [Types.Point2, Types.Point2, Types.Point2];
|
|
10
|
+
export declare function processVolumes(segmentationVolume: Types.IImageVolume, thresholdVolumeInformation: ThresholdInformation[]): {
|
|
11
|
+
volumeInfoList: any[];
|
|
12
|
+
baseVolumeIdx: number;
|
|
13
|
+
};
|
|
@@ -3,8 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.processVolumes = exports.getVoxelOverlap = void 0;
|
|
7
|
+
const core_1 = require("@cornerstonejs/core");
|
|
6
8
|
const ToolGroupManager_1 = require("../../store/ToolGroupManager");
|
|
7
9
|
const BrushTool_1 = __importDefault(require("../../tools/segmentation/BrushTool"));
|
|
10
|
+
const getBoundingBoxAroundShape_1 = __importDefault(require("../boundingBox/getBoundingBoxAroundShape"));
|
|
8
11
|
function getBrushToolInstances(toolGroupId) {
|
|
9
12
|
const toolGroup = (0, ToolGroupManager_1.getToolGroup)(toolGroupId);
|
|
10
13
|
if (toolGroup === undefined) {
|
|
@@ -18,4 +21,56 @@ function getBrushToolInstances(toolGroupId) {
|
|
|
18
21
|
return brushBasedToolInstances;
|
|
19
22
|
}
|
|
20
23
|
exports.default = getBrushToolInstances;
|
|
24
|
+
const equalsCheck = (a, b) => {
|
|
25
|
+
return JSON.stringify(a) === JSON.stringify(b);
|
|
26
|
+
};
|
|
27
|
+
function getVoxelOverlap(imageData, dimensions, voxelSpacing, voxelCenter) {
|
|
28
|
+
const voxelCornersWorld = [];
|
|
29
|
+
for (let i = 0; i < 2; i++) {
|
|
30
|
+
for (let j = 0; j < 2; j++) {
|
|
31
|
+
for (let k = 0; k < 2; k++) {
|
|
32
|
+
const point = voxelCenter;
|
|
33
|
+
point[0] = point[0] + ((i * 2 - 1) * voxelSpacing[0]) / 2;
|
|
34
|
+
point[1] = point[1] + ((j * 2 - 1) * voxelSpacing[1]) / 2;
|
|
35
|
+
point[2] = point[2] + ((k * 2 - 1) * voxelSpacing[2]) / 2;
|
|
36
|
+
voxelCornersWorld.push(point);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const voxelCornersIJK = voxelCornersWorld.map((world) => core_1.utilities.transformWorldToIndex(imageData, world));
|
|
41
|
+
const overlapBounds = (0, getBoundingBoxAroundShape_1.default)(voxelCornersIJK, dimensions);
|
|
42
|
+
return overlapBounds;
|
|
43
|
+
}
|
|
44
|
+
exports.getVoxelOverlap = getVoxelOverlap;
|
|
45
|
+
function processVolumes(segmentationVolume, thresholdVolumeInformation) {
|
|
46
|
+
const { spacing: segmentationSpacing, imageData: segmentationImageData } = segmentationVolume;
|
|
47
|
+
const scalarData = segmentationVolume.getScalarData();
|
|
48
|
+
const volumeInfoList = [];
|
|
49
|
+
let baseVolumeIdx = 0;
|
|
50
|
+
for (let i = 0; i < thresholdVolumeInformation.length; i++) {
|
|
51
|
+
const { imageData, spacing, dimensions } = thresholdVolumeInformation[i].volume;
|
|
52
|
+
const volumeSize = thresholdVolumeInformation[i].volume.getScalarData().length;
|
|
53
|
+
if (volumeSize === scalarData.length &&
|
|
54
|
+
equalsCheck(spacing, segmentationSpacing)) {
|
|
55
|
+
baseVolumeIdx = i;
|
|
56
|
+
}
|
|
57
|
+
const referenceValues = imageData.getPointData().getScalars().getData();
|
|
58
|
+
const lower = thresholdVolumeInformation[i].lower;
|
|
59
|
+
const upper = thresholdVolumeInformation[i].upper;
|
|
60
|
+
volumeInfoList.push({
|
|
61
|
+
imageData,
|
|
62
|
+
referenceValues,
|
|
63
|
+
lower,
|
|
64
|
+
upper,
|
|
65
|
+
spacing,
|
|
66
|
+
dimensions,
|
|
67
|
+
volumeSize,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
volumeInfoList,
|
|
72
|
+
baseVolumeIdx,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
exports.processVolumes = processVolumes;
|
|
21
76
|
//# sourceMappingURL=utilities.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.js","sourceRoot":"","sources":["../../../../src/utilities/segmentation/utilities.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utilities.js","sourceRoot":"","sources":["../../../../src/utilities/segmentation/utilities.ts"],"names":[],"mappings":";;;;;;AACA,8CAA2D;AAC3D,mEAA4D;AAC5D,mFAA2D;AAC3D,yGAAiF;AAQjF,SAAwB,qBAAqB,CAAC,WAAW;IACvD,MAAM,SAAS,GAAG,IAAA,+BAAY,EAAC,WAAW,CAAC,CAAC;IAE5C,IAAI,SAAS,KAAK,SAAS,EAAE;QAC3B,OAAO;KACR;IAED,MAAM,aAAa,GAAG,SAAS,CAAC,cAAc,CAAC;IAE/C,IAAI,CAAC,MAAM,CA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OAAO,EAAE,CAAC;QACxE,MAAM,KAAK,GAAG,0BAA0B,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QAClD,MAAM,KAAK,GAAG,0BAA0B,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QAElD,cAAc,CAAC,IAAI,CAAC;YAClB,SAAS;YACT,eAAe;YACf,KAAK;YACL,KAAK;YACL,OAAO;YACP,UAAU;YACV,UAAU;SACX,CAAC,CAAC;KACJ;IAED,OAAO;QACL,cAAc;QACd,aAAa;KACd,CAAC;AACJ,CAAC;AA7CD,wCA6CC"}
|
|
@@ -8,4 +8,5 @@ import { triggerSegmentationRender } from './triggerSegmentationRender';
|
|
|
8
8
|
import floodFill from './floodFill';
|
|
9
9
|
import { getBrushSizeForToolGroup, setBrushSizeForToolGroup } from './brushSizeForToolGroup';
|
|
10
10
|
import { getBrushThresholdForToolGroup, setBrushThresholdForToolGroup } from './brushThresholdForToolGroup';
|
|
11
|
-
|
|
11
|
+
import thresholdSegmentationByRange from './thresholdSegmentationByRange';
|
|
12
|
+
export { thresholdVolumeByRange, createMergedLabelmapForIndex, isValidRepresentationConfig, getDefaultRepresentationConfig, createLabelmapVolumeForViewport, rectangleROIThresholdVolumeByRange, triggerSegmentationRender, floodFill, getBrushSizeForToolGroup, setBrushSizeForToolGroup, getBrushThresholdForToolGroup, setBrushThresholdForToolGroup, thresholdSegmentationByRange, };
|
|
@@ -8,5 +8,6 @@ import { triggerSegmentationRender } from './triggerSegmentationRender';
|
|
|
8
8
|
import floodFill from './floodFill';
|
|
9
9
|
import { getBrushSizeForToolGroup, setBrushSizeForToolGroup, } from './brushSizeForToolGroup';
|
|
10
10
|
import { getBrushThresholdForToolGroup, setBrushThresholdForToolGroup, } from './brushThresholdForToolGroup';
|
|
11
|
-
|
|
11
|
+
import thresholdSegmentationByRange from './thresholdSegmentationByRange';
|
|
12
|
+
export { thresholdVolumeByRange, createMergedLabelmapForIndex, isValidRepresentationConfig, getDefaultRepresentationConfig, createLabelmapVolumeForViewport, rectangleROIThresholdVolumeByRange, triggerSegmentationRender, floodFill, getBrushSizeForToolGroup, setBrushSizeForToolGroup, getBrushThresholdForToolGroup, setBrushThresholdForToolGroup, thresholdSegmentationByRange, };
|
|
12
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utilities/segmentation/index.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,kCAAkC,MAAM,sCAAsC,CAAC;AACtF,OAAO,4BAA4B,MAAM,gCAAgC,CAAC;AAC1E,OAAO,2BAA2B,MAAM,+BAA+B,CAAC;AACxE,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAC9E,OAAO,+BAA+B,MAAM,mCAAmC,CAAC;AAChF,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,EACL,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,GAC9B,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utilities/segmentation/index.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,kCAAkC,MAAM,sCAAsC,CAAC;AACtF,OAAO,4BAA4B,MAAM,gCAAgC,CAAC;AAC1E,OAAO,2BAA2B,MAAM,+BAA+B,CAAC;AACxE,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAC9E,OAAO,+BAA+B,MAAM,mCAAmC,CAAC;AAChF,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,EACL,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,GAC9B,MAAM,8BAA8B,CAAC;AACtC,OAAO,4BAA4B,MAAM,gCAAgC,CAAC;AAE1E,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC5B,2BAA2B,EAC3B,8BAA8B,EAC9B,+BAA+B,EAC/B,kCAAkC,EAClC,yBAAyB,EACzB,SAAS,EACT,wBAAwB,EACxB,wBAAwB,EACxB,6BAA6B,EAC7B,6BAA6B,EAC7B,4BAA4B,GAC7B,CAAC"}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import type { Types } from '@cornerstonejs/core';
|
|
2
|
-
|
|
3
|
-
volume: Types.IImageVolume;
|
|
4
|
-
lower: number;
|
|
5
|
-
upper: number;
|
|
6
|
-
};
|
|
2
|
+
import { ThresholdInformation } from './utilities';
|
|
7
3
|
export declare type ThresholdOptions = {
|
|
8
4
|
numSlicesToProject?: number;
|
|
9
5
|
overwrite: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rectangleROIThresholdVolumeByRange.js","sourceRoot":"","sources":["../../../../src/utilities/segmentation/rectangleROIThresholdVolumeByRange.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AACzD,OAAO,EACL,iCAAiC,EACjC,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AAErB,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,oCAAoC,MAAM,0DAA0D,CAAC;
|
|
1
|
+
{"version":3,"file":"rectangleROIThresholdVolumeByRange.js","sourceRoot":"","sources":["../../../../src/utilities/segmentation/rectangleROIThresholdVolumeByRange.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AACzD,OAAO,EACL,iCAAiC,EACjC,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AAErB,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAC9D,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SACH;KACF;AACH,CAAC;AAED,eAAe,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Types } from '@cornerstonejs/core';
|
|
2
|
+
import { ThresholdInformation } from './utilities';
|
|
3
|
+
declare function thresholdSegmentationByRange(segmentationVolume: Types.IImageVolume, segmentationIndex: number, thresholdVolumeInformation: ThresholdInformation[], overlapType: number): Types.IImageVolume;
|
|
4
|
+
export default thresholdSegmentationByRange;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { pointInShapeCallback } from '../../utilities';
|
|
2
|
+
import { triggerSegmentationDataModified } from '../../stateManagement/segmentation/triggerSegmentationEvents';
|
|
3
|
+
import { getVoxelOverlap, processVolumes, } from './utilities';
|
|
4
|
+
function thresholdSegmentationByRange(segmentationVolume, segmentationIndex, thresholdVolumeInformation, overlapType) {
|
|
5
|
+
const scalarData = segmentationVolume.getScalarData();
|
|
6
|
+
const { baseVolumeIdx, volumeInfoList } = processVolumes(segmentationVolume, thresholdVolumeInformation);
|
|
7
|
+
volumeInfoList.forEach((volumeInfo) => {
|
|
8
|
+
const { volumeSize } = volumeInfo;
|
|
9
|
+
if (volumeSize === scalarData.length) {
|
|
10
|
+
_handleSameSizeVolume(scalarData, segmentationIndex, volumeInfo);
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
_handleDifferentSizeVolume(scalarData, segmentationIndex, volumeInfo, volumeInfoList, baseVolumeIdx, overlapType);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
triggerSegmentationDataModified(segmentationVolume.volumeId);
|
|
17
|
+
return segmentationVolume;
|
|
18
|
+
}
|
|
19
|
+
function _handleDifferentSizeVolume(scalarData, segmentationIndex, volumeInfo, volumeInfoList, baseVolumeIdx, overlapType) {
|
|
20
|
+
const { imageData, lower, upper, dimensions } = volumeInfo;
|
|
21
|
+
let total, overlaps, range;
|
|
22
|
+
for (let i = 0; i < scalarData.length; i++) {
|
|
23
|
+
if (scalarData[i] === segmentationIndex) {
|
|
24
|
+
const overlapBounds = getVoxelOverlap(imageData, dimensions, volumeInfoList[baseVolumeIdx].spacing, volumeInfoList[baseVolumeIdx].imageData.getPoint(i));
|
|
25
|
+
const callbackOverlap = ({ value }) => {
|
|
26
|
+
total = total + 1;
|
|
27
|
+
if (value >= range.lower && value <= range.upper) {
|
|
28
|
+
overlaps = overlaps + 1;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
total = 0;
|
|
32
|
+
overlaps = 0;
|
|
33
|
+
range = { lower, upper };
|
|
34
|
+
let overlapTest = false;
|
|
35
|
+
pointInShapeCallback(imageData, () => true, callbackOverlap, overlapBounds);
|
|
36
|
+
overlapTest = overlapType === 0 ? overlaps > 0 : overlaps === total;
|
|
37
|
+
scalarData[i] = overlapTest ? segmentationIndex : 0;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return { total, range, overlaps };
|
|
41
|
+
}
|
|
42
|
+
function _handleSameSizeVolume(scalarData, segmentationIndex, volumeInfo) {
|
|
43
|
+
const { referenceValues, lower, upper } = volumeInfo;
|
|
44
|
+
for (let i = 0; i < scalarData.length; i++) {
|
|
45
|
+
if (scalarData[i] === segmentationIndex) {
|
|
46
|
+
const value = referenceValues[i];
|
|
47
|
+
scalarData[i] = value >= lower && value <= upper ? segmentationIndex : 0;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
export default thresholdSegmentationByRange;
|
|
52
|
+
//# sourceMappingURL=thresholdSegmentationByRange.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thresholdSegmentationByRange.js","sourceRoot":"","sources":["../../../../src/utilities/segmentation/thresholdSegmentationByRange.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,+BAA+B,EAAE,MAAM,8DAA8D,CAAC;AAC/G,OAAO,EACL,eAAe,EACf,cAAc,GAEf,MAAM,aAA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AK,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;SAC1E;KACF;AACH,CAAC;AAED,eAAe,4BAA4B,CAAC"}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { Types } from '@cornerstonejs/core';
|
|
2
2
|
import { BoundsIJK } from '../../types';
|
|
3
|
+
import { ThresholdInformation } from './utilities';
|
|
3
4
|
export declare type ThresholdRangeOptions = {
|
|
4
5
|
overwrite: boolean;
|
|
5
6
|
boundsIJK: BoundsIJK;
|
|
6
7
|
overlapType?: number;
|
|
7
8
|
};
|
|
8
|
-
export declare type ThresholdInformation = {
|
|
9
|
-
volume: Types.IImageVolume;
|
|
10
|
-
lower: number;
|
|
11
|
-
upper: number;
|
|
12
|
-
};
|
|
13
9
|
declare function thresholdVolumeByRange(segmentationVolume: Types.IImageVolume, thresholdVolumeInformation: ThresholdInformation[], options: ThresholdRangeOptions): Types.IImageVolume;
|
|
14
10
|
export default thresholdVolumeByRange;
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import { utilities as csUtils } from '@cornerstonejs/core';
|
|
2
1
|
import { pointInShapeCallback } from '../../utilities';
|
|
3
2
|
import { triggerSegmentationDataModified } from '../../stateManagement/segmentation/triggerSegmentationEvents';
|
|
4
|
-
import
|
|
5
|
-
const equalsCheck = (a, b) => {
|
|
6
|
-
return JSON.stringify(a) === JSON.stringify(b);
|
|
7
|
-
};
|
|
3
|
+
import { getVoxelOverlap, processVolumes, } from './utilities';
|
|
8
4
|
function thresholdVolumeByRange(segmentationVolume, thresholdVolumeInformation, options) {
|
|
9
|
-
const {
|
|
5
|
+
const { imageData: segmentationImageData } = segmentationVolume;
|
|
10
6
|
const scalarData = segmentationVolume.getScalarData();
|
|
11
7
|
const { overwrite, boundsIJK } = options;
|
|
12
8
|
const overlapType = options?.overlapType || 0;
|
|
@@ -15,28 +11,7 @@ function thresholdVolumeByRange(segmentationVolume, thresholdVolumeInformation,
|
|
|
15
11
|
scalarData[i] = 0;
|
|
16
12
|
}
|
|
17
13
|
}
|
|
18
|
-
const volumeInfoList =
|
|
19
|
-
let baseVolumeIdx = 0;
|
|
20
|
-
for (let i = 0; i < thresholdVolumeInformation.length; i++) {
|
|
21
|
-
const { imageData, spacing, dimensions } = thresholdVolumeInformation[i].volume;
|
|
22
|
-
const volumeSize = thresholdVolumeInformation[i].volume.getScalarData().length;
|
|
23
|
-
if (volumeSize === scalarData.length &&
|
|
24
|
-
equalsCheck(spacing, segmentationSpacing)) {
|
|
25
|
-
baseVolumeIdx = i;
|
|
26
|
-
}
|
|
27
|
-
const referenceValues = imageData.getPointData().getScalars().getData();
|
|
28
|
-
const lower = thresholdVolumeInformation[i].lower;
|
|
29
|
-
const upper = thresholdVolumeInformation[i].upper;
|
|
30
|
-
volumeInfoList.push({
|
|
31
|
-
imageData,
|
|
32
|
-
referenceValues,
|
|
33
|
-
lower,
|
|
34
|
-
upper,
|
|
35
|
-
spacing,
|
|
36
|
-
dimensions,
|
|
37
|
-
volumeSize,
|
|
38
|
-
});
|
|
39
|
-
}
|
|
14
|
+
const { baseVolumeIdx, volumeInfoList } = processVolumes(segmentationVolume, thresholdVolumeInformation);
|
|
40
15
|
let overlaps, total, range;
|
|
41
16
|
const testOverlapRange = (volumeInfo, voxelSpacing, voxelCenter) => {
|
|
42
17
|
const callbackOverlap = ({ value }) => {
|
|
@@ -71,23 +46,6 @@ function thresholdVolumeByRange(segmentationVolume, thresholdVolumeInformation,
|
|
|
71
46
|
return true;
|
|
72
47
|
}
|
|
73
48
|
};
|
|
74
|
-
const getVoxelOverlap = (imageData, dimensions, voxelSpacing, voxelCenter) => {
|
|
75
|
-
const voxelCornersWorld = [];
|
|
76
|
-
for (let i = 0; i < 2; i++) {
|
|
77
|
-
for (let j = 0; j < 2; j++) {
|
|
78
|
-
for (let k = 0; k < 2; k++) {
|
|
79
|
-
const point = voxelCenter;
|
|
80
|
-
point[0] = point[0] + ((i * 2 - 1) * voxelSpacing[0]) / 2;
|
|
81
|
-
point[1] = point[1] + ((j * 2 - 1) * voxelSpacing[1]) / 2;
|
|
82
|
-
point[2] = point[2] + ((k * 2 - 1) * voxelSpacing[2]) / 2;
|
|
83
|
-
voxelCornersWorld.push(point);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
const voxelCornersIJK = voxelCornersWorld.map((world) => csUtils.transformWorldToIndex(imageData, world));
|
|
88
|
-
const overlapBounds = getBoundingBoxAroundShape(voxelCornersIJK, dimensions);
|
|
89
|
-
return overlapBounds;
|
|
90
|
-
};
|
|
91
49
|
const callback = ({ index, pointIJK, pointLPS }) => {
|
|
92
50
|
let insert = volumeInfoList.length > 0;
|
|
93
51
|
for (let i = 0; i < volumeInfoList.length; i++) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thresholdVolumeByRange.js","sourceRoot":"","sources":["../../../../src/utilities/segmentation/thresholdVolumeByRange.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"thresholdVolumeByRange.js","sourceRoot":"","sources":["../../../../src/utilities/segmentation/thresholdVolumeByRange.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,+BAA+B,EAAE,MAAM,8DAA8D,CAAC;AAE/G,OAAO,EACL,eAAe,EACf,cAAc,GAEf,MAAM,aAAa,CAAC;AA2BrB,SAAS,sBAAsB,CAC7B,kBAAsC,EACtC,0BAAkD,EAClD,OAA8B;IAE9B,MAAM,EAAE,SAAS,EAAE,qBAAqB,EAAE,GAAG,kBAAkB,CAAC;IAChE,MAAM,UAAU,GAAG,kBAAkB,CAAC,aAAa,EAAE,CAAC;IAEtD,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IACzC,MAAM,WAAW,GAAG,OAAO,EAAE,WAAW,IAAI,CAAC,CAAC;IAG9C,IAAI,SAAS,EAAE;QACb,KAAK,I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AAkB,CAAC,QAAQ,CAAC,CAAC;IAE7D,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AAED,eAAe,sBAAsB,CAAC"}
|
|
@@ -1,2 +1,13 @@
|
|
|
1
|
+
import { Types } from '@cornerstonejs/core';
|
|
1
2
|
import BrushTool from '../../tools/segmentation/BrushTool';
|
|
3
|
+
export declare type ThresholdInformation = {
|
|
4
|
+
volume: Types.IImageVolume;
|
|
5
|
+
lower: number;
|
|
6
|
+
upper: number;
|
|
7
|
+
};
|
|
2
8
|
export default function getBrushToolInstances(toolGroupId: any): BrushTool[];
|
|
9
|
+
export declare function getVoxelOverlap(imageData: any, dimensions: any, voxelSpacing: any, voxelCenter: any): [Types.Point2, Types.Point2, Types.Point2];
|
|
10
|
+
export declare function processVolumes(segmentationVolume: Types.IImageVolume, thresholdVolumeInformation: ThresholdInformation[]): {
|
|
11
|
+
volumeInfoList: any[];
|
|
12
|
+
baseVolumeIdx: number;
|
|
13
|
+
};
|