@cornerstonejs/tools 4.3.12 → 4.3.14
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/stateManagement/segmentation/helpers/removeSegmentAnnotations.d.ts +1 -0
- package/dist/esm/stateManagement/segmentation/helpers/removeSegmentAnnotations.js +19 -0
- package/dist/esm/stateManagement/segmentation/removeSegment.js +11 -2
- package/dist/esm/tools/annotation/RectangleROITool.js +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function removeContourSegmentAnnotations(segmentationId: string, segmentIndex: number): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { getAnnotation } from '../../annotation/annotationState';
|
|
2
|
+
import { getAnnotationsUIDMapFromSegmentation, removeCompleteContourAnnotation, } from '../utilities';
|
|
3
|
+
import { isContourSegmentationAnnotation } from '../../../utilities/contourSegmentation';
|
|
4
|
+
export function removeContourSegmentAnnotations(segmentationId, segmentIndex) {
|
|
5
|
+
const annotationUIDsMap = getAnnotationsUIDMapFromSegmentation(segmentationId);
|
|
6
|
+
if (!annotationUIDsMap) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
const annotationUIDs = annotationUIDsMap.get(segmentIndex);
|
|
10
|
+
if (!annotationUIDs) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
annotationUIDs.forEach((annotationUID) => {
|
|
14
|
+
const annotation = getAnnotation(annotationUID);
|
|
15
|
+
if (isContourSegmentationAnnotation(annotation)) {
|
|
16
|
+
removeCompleteContourAnnotation(annotation);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
@@ -2,15 +2,24 @@ import { getActiveSegmentIndex } from './getActiveSegmentIndex';
|
|
|
2
2
|
import { getSegmentation } from './getSegmentation';
|
|
3
3
|
import { getSegmentationRepresentations } from './getSegmentationRepresentation';
|
|
4
4
|
import { getViewportIdsWithSegmentation } from './getViewportIdsWithSegmentation';
|
|
5
|
+
import { removeContourSegmentAnnotations } from './helpers/removeSegmentAnnotations';
|
|
5
6
|
import { clearSegmentValue } from './helpers/clearSegmentValue';
|
|
6
7
|
import { setActiveSegmentIndex } from './segmentIndex';
|
|
7
8
|
import { updateSegmentations } from './updateSegmentations';
|
|
8
9
|
export function removeSegment(segmentationId, segmentIndex, options = {
|
|
9
10
|
setNextSegmentAsActive: true,
|
|
10
11
|
}) {
|
|
11
|
-
clearSegmentValue(segmentationId, segmentIndex);
|
|
12
|
-
const isThisSegmentActive = getActiveSegmentIndex(segmentationId) === segmentIndex;
|
|
13
12
|
const segmentation = getSegmentation(segmentationId);
|
|
13
|
+
if (segmentation?.representationData.Contour) {
|
|
14
|
+
removeContourSegmentAnnotations(segmentationId, segmentIndex);
|
|
15
|
+
}
|
|
16
|
+
else if (segmentation?.representationData.Labelmap) {
|
|
17
|
+
clearSegmentValue(segmentationId, segmentIndex);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
throw new Error('Invalid segmentation type');
|
|
21
|
+
}
|
|
22
|
+
const isThisSegmentActive = getActiveSegmentIndex(segmentationId) === segmentIndex;
|
|
14
23
|
const { segments } = segmentation;
|
|
15
24
|
delete segments[segmentIndex];
|
|
16
25
|
const updatedSegments = {
|
|
@@ -582,7 +582,7 @@ function defaultGetTextLines(data, targetId) {
|
|
|
582
582
|
textLines.push(`Max: ${csUtils.roundNumber(max)} ${modalityUnit}`);
|
|
583
583
|
}
|
|
584
584
|
if (csUtils.isNumber(min)) {
|
|
585
|
-
textLines.push(`
|
|
585
|
+
textLines.push(`Min: ${csUtils.roundNumber(min)} ${modalityUnit}`);
|
|
586
586
|
}
|
|
587
587
|
if (csUtils.isNumber(stdDev)) {
|
|
588
588
|
textLines.push(`Std Dev: ${csUtils.roundNumber(stdDev)} ${modalityUnit}`);
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "4.3.
|
|
1
|
+
export declare const version = "4.3.14";
|
package/dist/esm/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '4.3.
|
|
1
|
+
export const version = '4.3.14';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/tools",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.14",
|
|
4
4
|
"description": "Cornerstone3D Tools",
|
|
5
5
|
"types": "./dist/esm/index.d.ts",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"canvas": "3.1.0"
|
|
109
109
|
},
|
|
110
110
|
"peerDependencies": {
|
|
111
|
-
"@cornerstonejs/core": "4.3.
|
|
111
|
+
"@cornerstonejs/core": "4.3.14",
|
|
112
112
|
"@kitware/vtk.js": "32.12.1",
|
|
113
113
|
"@types/d3-array": "3.2.1",
|
|
114
114
|
"@types/d3-interpolate": "3.0.4",
|
|
@@ -127,5 +127,5 @@
|
|
|
127
127
|
"type": "individual",
|
|
128
128
|
"url": "https://ohif.org/donate"
|
|
129
129
|
},
|
|
130
|
-
"gitHead": "
|
|
130
|
+
"gitHead": "e7c105f5d140ff5077d19f6108cbff5261c0c03e"
|
|
131
131
|
}
|