@cornerstonejs/tools 2.7.0 → 2.7.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/esm/tools/annotation/SplineROITool.js +0 -2
- package/dist/esm/tools/annotation/WholeBodySegmentTool.js +4 -4
- package/dist/esm/tools/segmentation/strategies/compositions/islandRemoval.d.ts +3 -1
- package/dist/esm/tools/segmentation/strategies/compositions/islandRemoval.js +2 -0
- package/dist/esm/tools/segmentation/strategies/compositions/labelmapStatistics.js +4 -0
- package/dist/esm/utilities/segmentation/growCut/runGrowCut.js +2 -2
- package/dist/esm/utilities/segmentation/growCut/runGrowCutForBoundingBox.d.ts +2 -2
- package/dist/esm/utilities/segmentation/growCut/runGrowCutForBoundingBox.js +0 -1
- package/package.json +3 -3
|
@@ -229,8 +229,6 @@ class SplineROITool extends ContourSegmentationBaseTool {
|
|
|
229
229
|
const { element } = eventDetail;
|
|
230
230
|
const { currentPoints } = eventDetail;
|
|
231
231
|
const { canvas: canvasPoint, world: worldPoint } = currentPoints;
|
|
232
|
-
const enabledElement = getEnabledElement(element);
|
|
233
|
-
const { renderingEngine } = enabledElement;
|
|
234
232
|
let closeContour = data.handles.points.length >= 2 && doubleClick;
|
|
235
233
|
let addNewPoint = true;
|
|
236
234
|
if (data.handles.points.length >= 3) {
|
|
@@ -18,17 +18,17 @@ class WholeBodySegmentTool extends GrowCutBaseTool {
|
|
|
18
18
|
const { element, currentPoints } = eventData;
|
|
19
19
|
const { world: currentWorldPoint } = currentPoints;
|
|
20
20
|
const enabledElement = getEnabledElement(element);
|
|
21
|
-
const {
|
|
21
|
+
const { viewport } = enabledElement;
|
|
22
22
|
const linePoints = this._getHorizontalLineWorldPoints(enabledElement, currentWorldPoint);
|
|
23
23
|
this.growCutData.horizontalLines[1] = linePoints;
|
|
24
24
|
triggerAnnotationRenderForViewportUIDs([viewport.id]);
|
|
25
25
|
};
|
|
26
|
-
this._endCallback = (evt) => {
|
|
26
|
+
this._endCallback = async (evt) => {
|
|
27
27
|
const eventData = evt.detail;
|
|
28
28
|
const { element } = eventData;
|
|
29
29
|
const enabledElement = getEnabledElement(element);
|
|
30
|
-
const {
|
|
31
|
-
this.runGrowCut();
|
|
30
|
+
const { viewport } = enabledElement;
|
|
31
|
+
await this.runGrowCut();
|
|
32
32
|
this._deactivateDraw(element);
|
|
33
33
|
this.growCutData = null;
|
|
34
34
|
resetElementCursor(element);
|
|
@@ -4,7 +4,9 @@ export declare enum SegmentationEnum {
|
|
|
4
4
|
SEGMENT = 1,
|
|
5
5
|
ISLAND = 2,
|
|
6
6
|
INTERIOR = 3,
|
|
7
|
-
EXTERIOR = 4
|
|
7
|
+
EXTERIOR = 4,
|
|
8
|
+
INTERIOR_SMALL = -5,
|
|
9
|
+
INTERIOR_TEST = -6
|
|
8
10
|
}
|
|
9
11
|
declare const _default: {
|
|
10
12
|
onInteractionEnd: (operationData: InitializedOperationData) => void;
|
|
@@ -10,6 +10,8 @@ export var SegmentationEnum;
|
|
|
10
10
|
SegmentationEnum[SegmentationEnum["ISLAND"] = 2] = "ISLAND";
|
|
11
11
|
SegmentationEnum[SegmentationEnum["INTERIOR"] = 3] = "INTERIOR";
|
|
12
12
|
SegmentationEnum[SegmentationEnum["EXTERIOR"] = 4] = "EXTERIOR";
|
|
13
|
+
SegmentationEnum[SegmentationEnum["INTERIOR_SMALL"] = -5] = "INTERIOR_SMALL";
|
|
14
|
+
SegmentationEnum[SegmentationEnum["INTERIOR_TEST"] = -6] = "INTERIOR_TEST";
|
|
13
15
|
})(SegmentationEnum || (SegmentationEnum = {}));
|
|
14
16
|
export default {
|
|
15
17
|
[StrategyCallbacks.OnInteractionEnd]: (operationData) => {
|
|
@@ -19,6 +19,10 @@ export default {
|
|
|
19
19
|
viewport,
|
|
20
20
|
});
|
|
21
21
|
const spacing = segmentationImageData.getSpacing();
|
|
22
|
+
const { boundsIJK: boundsOrig } = segmentationVoxelManager;
|
|
23
|
+
if (!boundsOrig) {
|
|
24
|
+
return VolumetricCalculator.getStatistics({ spacing });
|
|
25
|
+
}
|
|
22
26
|
segmentationVoxelManager.forEach((voxel) => {
|
|
23
27
|
const { value, pointIJK } = voxel;
|
|
24
28
|
if (indicesArr.indexOf(value) === -1) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cache } from '@cornerstonejs/core';
|
|
2
2
|
import shaderCode from './growCutShader';
|
|
3
3
|
const GB = 1024 * 1024 * 1024;
|
|
4
|
-
const WEBGPU_MEMORY_LIMIT =
|
|
4
|
+
const WEBGPU_MEMORY_LIMIT = 1.99 * GB;
|
|
5
5
|
const DEFAULT_GROWCUT_OPTIONS = {
|
|
6
6
|
windowSize: 3,
|
|
7
7
|
maxProcessingTime: 30000,
|
|
@@ -33,7 +33,7 @@ async function runGrowCut(referenceVolumeId, labelmapVolumeId, options = DEFAULT
|
|
|
33
33
|
maxStorageBufferBindingSize: WEBGPU_MEMORY_LIMIT,
|
|
34
34
|
maxBufferSize: WEBGPU_MEMORY_LIMIT,
|
|
35
35
|
};
|
|
36
|
-
const adapter = await navigator.gpu
|
|
36
|
+
const adapter = await navigator.gpu?.requestAdapter();
|
|
37
37
|
const device = await adapter.requestDevice({ requiredLimits });
|
|
38
38
|
const BUFFER_SIZE = volumePixelData.byteLength;
|
|
39
39
|
const UPDATED_VOXELS_COUNTER_BUFFER_SIZE = numIterations * Uint32Array.BYTES_PER_ELEMENT;
|
|
@@ -9,8 +9,8 @@ type BoundingBoxInfo = {
|
|
|
9
9
|
type GrowCutBoundingBoxOptions = GrowCutOptions & {
|
|
10
10
|
positiveSeedValue?: number;
|
|
11
11
|
negativeSeedValue?: number;
|
|
12
|
-
negativePixelRange
|
|
13
|
-
positivePixelRange
|
|
12
|
+
negativePixelRange?: [number, number];
|
|
13
|
+
positivePixelRange?: [number, number];
|
|
14
14
|
};
|
|
15
15
|
declare function runGrowCutForBoundingBox(referencedVolumeId: string, boundingBoxInfo: BoundingBoxInfo, options?: GrowCutBoundingBoxOptions): Promise<Types.IImageVolume>;
|
|
16
16
|
export { runGrowCutForBoundingBox as default, runGrowCutForBoundingBox };
|
|
@@ -7,7 +7,6 @@ const POSITIVE_PIXEL_RANGE = [0, 1900];
|
|
|
7
7
|
function _setNegativeSeedValues(subVolume, labelmap, options) {
|
|
8
8
|
const { negativeSeedValue = NEGATIVE_SEED_VALUE, negativePixelRange = NEGATIVE_PIXEL_RANGE, } = options;
|
|
9
9
|
const subVolPixelData = subVolume.voxelManager.getCompleteScalarDataArray();
|
|
10
|
-
const labelmapData = labelmap.voxelManager.getCompleteScalarDataArray();
|
|
11
10
|
const [width, height, numSlices] = labelmap.dimensions;
|
|
12
11
|
const middleSliceIndex = Math.floor(numSlices / 2);
|
|
13
12
|
const visited = new Array(width * height).fill(false);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/tools",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.2",
|
|
4
4
|
"description": "Cornerstone3D Tools",
|
|
5
5
|
"types": "./dist/esm/index.d.ts",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"canvas": "^2.11.2"
|
|
105
105
|
},
|
|
106
106
|
"peerDependencies": {
|
|
107
|
-
"@cornerstonejs/core": "^2.7.
|
|
107
|
+
"@cornerstonejs/core": "^2.7.2",
|
|
108
108
|
"@kitware/vtk.js": "32.1.1",
|
|
109
109
|
"@types/d3-array": "^3.0.4",
|
|
110
110
|
"@types/d3-interpolate": "^3.0.1",
|
|
@@ -123,5 +123,5 @@
|
|
|
123
123
|
"type": "individual",
|
|
124
124
|
"url": "https://ohif.org/donate"
|
|
125
125
|
},
|
|
126
|
-
"gitHead": "
|
|
126
|
+
"gitHead": "010ff3c4a19f8b20d288768c2c95231dcc7c5ed0"
|
|
127
127
|
}
|