@cornerstonejs/polymorphic-segmentation 5.1.4 → 5.2.1
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/Contour/contourComputationStrategies.d.ts +2 -2
- package/dist/esm/Contour/contourComputationStrategies.js +4 -4
- package/dist/esm/Contour/utils/createAndAddContourSegmentationsFromClippedSurfaces.d.ts +1 -1
- package/dist/esm/Contour/utils/extractContourData.d.ts +2 -2
- package/dist/esm/Contour/utils/updateContoursOnCameraModified.js +3 -3
- package/dist/esm/Labelmap/convertContourToLabelmap.d.ts +1 -1
- package/dist/esm/Labelmap/labelmapComputationStrategies.d.ts +1 -1
- package/dist/esm/Labelmap/labelmapComputationStrategies.js +2 -2
- package/dist/esm/Surface/createAndCacheSurfacesFromRaw.d.ts +2 -2
- package/dist/esm/Surface/surfaceComputationStrategies.d.ts +1 -1
- package/dist/esm/Surface/surfaceComputationStrategies.js +3 -3
- package/dist/esm/Surface/updateSurfaceData.js +2 -2
- package/dist/esm/index.d.ts +9 -9
- package/dist/esm/index.js +9 -9
- package/dist/esm/package.json +3 -0
- package/dist/esm/types/index.d.ts +1 -1
- package/dist/esm/utilities/clipAndCacheSurfacesForViewport.js +1 -1
- package/dist/esm/utilities/index.d.ts +1 -1
- package/dist/esm/utilities/index.js +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/workers/polySegConverters.js +6 -6
- package/package.json +14 -12
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PolySegConversionOptions } from '../types';
|
|
2
|
-
import type { SurfaceClipResult } from '../utilities/clipAndCacheSurfacesForViewport';
|
|
1
|
+
import type { PolySegConversionOptions } from '../types/index.js';
|
|
2
|
+
import type { SurfaceClipResult } from '../utilities/clipAndCacheSurfacesForViewport.js';
|
|
3
3
|
export type RawContourData = Map<number, SurfaceClipResult[]>;
|
|
4
4
|
export declare function computeContourData(segmentationId: string, options?: PolySegConversionOptions): Promise<{
|
|
5
5
|
annotationUIDsMap: Map<number, Set<string>>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { cache } from '@cornerstonejs/core';
|
|
2
2
|
import { Enums, segmentation, utilities } from '@cornerstonejs/tools';
|
|
3
|
-
import { extractContourData } from './utils/extractContourData';
|
|
4
|
-
import { computeSurfaceFromLabelmapSegmentation } from '../Surface/surfaceComputationStrategies';
|
|
5
|
-
import { clipAndCacheSurfacesForViewport } from '../utilities/clipAndCacheSurfacesForViewport';
|
|
6
|
-
import { createAndAddContourSegmentationsFromClippedSurfaces } from './utils/createAndAddContourSegmentationsFromClippedSurfaces';
|
|
3
|
+
import { extractContourData } from './utils/extractContourData.js';
|
|
4
|
+
import { computeSurfaceFromLabelmapSegmentation } from '../Surface/surfaceComputationStrategies.js';
|
|
5
|
+
import { clipAndCacheSurfacesForViewport } from '../utilities/clipAndCacheSurfacesForViewport.js';
|
|
6
|
+
import { createAndAddContourSegmentationsFromClippedSurfaces } from './utils/createAndAddContourSegmentationsFromClippedSurfaces.js';
|
|
7
7
|
const { getUniqueSegmentIndices } = utilities.segmentation;
|
|
8
8
|
const { getSegmentation } = segmentation.state;
|
|
9
9
|
const { segmentationStyle } = segmentation;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type Types } from '@cornerstonejs/core';
|
|
2
|
-
import type { RawContourData } from '../contourComputationStrategies';
|
|
2
|
+
import type { RawContourData } from '../contourComputationStrategies.js';
|
|
3
3
|
export declare function createAndAddContourSegmentationsFromClippedSurfaces(rawContourData: RawContourData, viewport: Types.IViewport, segmentationId: string): Map<number, Set<string>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { PolyDataClipCacheType } from '../../utilities/clipAndCacheSurfacesForViewport';
|
|
2
|
-
import type { RawContourData } from '../contourComputationStrategies';
|
|
1
|
+
import type { PolyDataClipCacheType } from '../../utilities/clipAndCacheSurfacesForViewport.js';
|
|
2
|
+
import type { RawContourData } from '../contourComputationStrategies.js';
|
|
3
3
|
export declare function extractContourData(polyDataCache: PolyDataClipCacheType): RawContourData;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { utilities, Enums } from '@cornerstonejs/core';
|
|
2
|
-
import { extractContourData } from './extractContourData';
|
|
3
|
-
import { clipAndCacheSurfacesForViewport } from '../../utilities';
|
|
4
|
-
import { createAndAddContourSegmentationsFromClippedSurfaces } from './createAndAddContourSegmentationsFromClippedSurfaces';
|
|
2
|
+
import { extractContourData } from './extractContourData.js';
|
|
3
|
+
import { clipAndCacheSurfacesForViewport } from '../../utilities/index.js';
|
|
4
|
+
import { createAndAddContourSegmentationsFromClippedSurfaces } from './createAndAddContourSegmentationsFromClippedSurfaces.js';
|
|
5
5
|
const currentViewportNormal = new Map();
|
|
6
6
|
export function updateContoursOnCameraModified(surfacesInfo, viewport, segmentationRepresentationUID) {
|
|
7
7
|
async function cameraModifiedCallback(evt) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Types as ToolsTypes } from '@cornerstonejs/tools';
|
|
2
|
-
import type { PolySegConversionOptions } from '../types';
|
|
2
|
+
import type { PolySegConversionOptions } from '../types/index.js';
|
|
3
3
|
export declare function convertContourToVolumeLabelmap(contourRepresentationData: ToolsTypes.ContourSegmentationData, options?: PolySegConversionOptions): Promise<{
|
|
4
4
|
volumeId: string;
|
|
5
5
|
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Types as ToolsTypes } from '@cornerstonejs/tools';
|
|
2
|
-
import type { PolySegConversionOptions } from '../types';
|
|
2
|
+
import type { PolySegConversionOptions } from '../types/index.js';
|
|
3
3
|
export type RawLabelmapData = ToolsTypes.LabelmapSegmentationDataVolume | ToolsTypes.LabelmapSegmentationDataStack;
|
|
4
4
|
export declare function computeLabelmapData(segmentationId: string, options?: PolySegConversionOptions): Promise<RawLabelmapData>;
|
|
5
5
|
declare function computeLabelmapFromContourSegmentation(segmentationId: any, options?: PolySegConversionOptions): Promise<ToolsTypes.LabelmapSegmentationDataVolume | ToolsTypes.LabelmapSegmentationDataStack>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { volumeLoader, imageLoader, VolumeViewport } from '@cornerstonejs/core';
|
|
2
2
|
import { utilities } from '@cornerstonejs/tools';
|
|
3
3
|
import * as cornerstoneTools from '@cornerstonejs/tools';
|
|
4
|
-
import { convertContourToStackLabelmap, convertContourToVolumeLabelmap, } from './convertContourToLabelmap';
|
|
5
|
-
import { convertSurfaceToVolumeLabelmap } from './convertSurfaceToLabelmap';
|
|
4
|
+
import { convertContourToStackLabelmap, convertContourToVolumeLabelmap, } from './convertContourToLabelmap.js';
|
|
5
|
+
import { convertSurfaceToVolumeLabelmap } from './convertSurfaceToLabelmap.js';
|
|
6
6
|
const { computeStackLabelmapFromVolume, getUniqueSegmentIndices } = utilities.segmentation;
|
|
7
7
|
const { getSegmentation } = cornerstoneTools.segmentation.state;
|
|
8
8
|
export async function computeLabelmapData(segmentationId, options = {}) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { RawSurfacesData } from './surfaceComputationStrategies';
|
|
2
|
-
import type { PolySegConversionOptions } from '../types';
|
|
1
|
+
import type { RawSurfacesData } from './surfaceComputationStrategies.js';
|
|
2
|
+
import type { PolySegConversionOptions } from '../types/index.js';
|
|
3
3
|
export declare function createAndCacheSurfacesFromRaw(segmentationId: string, rawSurfacesData: RawSurfacesData, options?: PolySegConversionOptions): Promise<{
|
|
4
4
|
geometryIds: Map<number, string>;
|
|
5
5
|
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as cornerstoneTools from '@cornerstonejs/tools';
|
|
2
|
-
import { convertContourToSurface } from './convertContourToSurface';
|
|
3
|
-
import { createAndCacheSurfacesFromRaw } from './createAndCacheSurfacesFromRaw';
|
|
4
|
-
import { convertLabelmapToSurface } from './convertLabelmapToSurface';
|
|
2
|
+
import { convertContourToSurface } from './convertContourToSurface.js';
|
|
3
|
+
import { createAndCacheSurfacesFromRaw } from './createAndCacheSurfacesFromRaw.js';
|
|
4
|
+
import { convertLabelmapToSurface } from './convertLabelmapToSurface.js';
|
|
5
5
|
const { getUniqueSegmentIndices } = cornerstoneTools.utilities.segmentation;
|
|
6
6
|
const { getSegmentation } = cornerstoneTools.segmentation.state;
|
|
7
7
|
export async function computeSurfaceData(segmentationId, options = {}) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cache, getEnabledElementByViewportId } from '@cornerstonejs/core';
|
|
2
2
|
import * as cornerstoneTools from '@cornerstonejs/tools';
|
|
3
|
-
import { computeSurfaceFromLabelmapSegmentation } from './surfaceComputationStrategies';
|
|
4
|
-
import { createAndCacheSurfacesFromRaw } from './createAndCacheSurfacesFromRaw';
|
|
3
|
+
import { computeSurfaceFromLabelmapSegmentation } from './surfaceComputationStrategies.js';
|
|
4
|
+
import { createAndCacheSurfacesFromRaw } from './createAndCacheSurfacesFromRaw.js';
|
|
5
5
|
const { utilities: { segmentation: { getUniqueSegmentIndices }, }, segmentation: { state: { getViewportIdsWithSegmentation, getSegmentation, getSegmentationRepresentation, }, triggerSegmentationEvents: { triggerSegmentationModified }, }, Enums: { SegmentationRepresentations }, } = cornerstoneTools;
|
|
6
6
|
export async function updateSurfaceData(segmentationId) {
|
|
7
7
|
const surfacesObj = await computeSurfaceFromLabelmapSegmentation(segmentationId);
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { computeContourData } from './Contour/contourComputationStrategies';
|
|
2
|
-
import { computeLabelmapData } from './Labelmap/labelmapComputationStrategies';
|
|
3
|
-
import { computeSurfaceData } from './Surface/surfaceComputationStrategies';
|
|
4
|
-
import { canComputeRequestedRepresentation } from './canComputeRequestedRepresentation';
|
|
5
|
-
import { updateSurfaceData } from './Surface/updateSurfaceData';
|
|
6
|
-
import { type PolySegInitOptions } from './registerPolySegWorker';
|
|
7
|
-
import { clipAndCacheSurfacesForViewport } from './utilities/clipAndCacheSurfacesForViewport';
|
|
8
|
-
import { extractContourData } from './Contour/utils/extractContourData';
|
|
9
|
-
import { createAndAddContourSegmentationsFromClippedSurfaces } from './Contour/utils/createAndAddContourSegmentationsFromClippedSurfaces';
|
|
1
|
+
import { computeContourData } from './Contour/contourComputationStrategies.js';
|
|
2
|
+
import { computeLabelmapData } from './Labelmap/labelmapComputationStrategies.js';
|
|
3
|
+
import { computeSurfaceData } from './Surface/surfaceComputationStrategies.js';
|
|
4
|
+
import { canComputeRequestedRepresentation } from './canComputeRequestedRepresentation.js';
|
|
5
|
+
import { updateSurfaceData } from './Surface/updateSurfaceData.js';
|
|
6
|
+
import { type PolySegInitOptions } from './registerPolySegWorker.js';
|
|
7
|
+
import { clipAndCacheSurfacesForViewport } from './utilities/clipAndCacheSurfacesForViewport.js';
|
|
8
|
+
import { extractContourData } from './Contour/utils/extractContourData.js';
|
|
9
|
+
import { createAndAddContourSegmentationsFromClippedSurfaces } from './Contour/utils/createAndAddContourSegmentationsFromClippedSurfaces.js';
|
|
10
10
|
declare function init(options?: PolySegInitOptions): void;
|
|
11
11
|
export { canComputeRequestedRepresentation, computeContourData, computeLabelmapData, computeSurfaceData, updateSurfaceData, init, clipAndCacheSurfacesForViewport, extractContourData, createAndAddContourSegmentationsFromClippedSurfaces, };
|
package/dist/esm/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { computeContourData } from './Contour/contourComputationStrategies';
|
|
2
|
-
import { computeLabelmapData } from './Labelmap/labelmapComputationStrategies';
|
|
3
|
-
import { computeSurfaceData } from './Surface/surfaceComputationStrategies';
|
|
4
|
-
import { canComputeRequestedRepresentation } from './canComputeRequestedRepresentation';
|
|
5
|
-
import { updateSurfaceData } from './Surface/updateSurfaceData';
|
|
6
|
-
import { registerPolySegWorker, } from './registerPolySegWorker';
|
|
7
|
-
import { clipAndCacheSurfacesForViewport } from './utilities/clipAndCacheSurfacesForViewport';
|
|
8
|
-
import { extractContourData } from './Contour/utils/extractContourData';
|
|
9
|
-
import { createAndAddContourSegmentationsFromClippedSurfaces } from './Contour/utils/createAndAddContourSegmentationsFromClippedSurfaces';
|
|
1
|
+
import { computeContourData } from './Contour/contourComputationStrategies.js';
|
|
2
|
+
import { computeLabelmapData } from './Labelmap/labelmapComputationStrategies.js';
|
|
3
|
+
import { computeSurfaceData } from './Surface/surfaceComputationStrategies.js';
|
|
4
|
+
import { canComputeRequestedRepresentation } from './canComputeRequestedRepresentation.js';
|
|
5
|
+
import { updateSurfaceData } from './Surface/updateSurfaceData.js';
|
|
6
|
+
import { registerPolySegWorker, } from './registerPolySegWorker.js';
|
|
7
|
+
import { clipAndCacheSurfacesForViewport } from './utilities/clipAndCacheSurfacesForViewport.js';
|
|
8
|
+
import { extractContourData } from './Contour/utils/extractContourData.js';
|
|
9
|
+
import { createAndAddContourSegmentationsFromClippedSurfaces } from './Contour/utils/createAndAddContourSegmentationsFromClippedSurfaces.js';
|
|
10
10
|
function init(options) {
|
|
11
11
|
registerPolySegWorker(options);
|
|
12
12
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { PolySegConversionOptions } from './PolySegConversionOptions';
|
|
1
|
+
import type { PolySegConversionOptions } from './PolySegConversionOptions.js';
|
|
2
2
|
export type { PolySegConversionOptions };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Enums, getWebWorkerManager, eventTarget, triggerEvent, } from '@cornerstonejs/core';
|
|
2
2
|
import { Enums as ToolsEnums, utilities } from '@cornerstonejs/tools';
|
|
3
|
-
import { registerPolySegWorker } from '../registerPolySegWorker';
|
|
3
|
+
import { registerPolySegWorker } from '../registerPolySegWorker.js';
|
|
4
4
|
const workerManager = getWebWorkerManager();
|
|
5
5
|
const { WorkerTypes } = ToolsEnums;
|
|
6
6
|
const { pointToString } = utilities;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { clipAndCacheSurfacesForViewport } from './clipAndCacheSurfacesForViewport';
|
|
1
|
+
import { clipAndCacheSurfacesForViewport } from './clipAndCacheSurfacesForViewport.js';
|
|
2
2
|
export { clipAndCacheSurfacesForViewport };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { clipAndCacheSurfacesForViewport } from './clipAndCacheSurfacesForViewport';
|
|
1
|
+
import { clipAndCacheSurfacesForViewport } from './clipAndCacheSurfacesForViewport.js';
|
|
2
2
|
export { clipAndCacheSurfacesForViewport };
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "5.1
|
|
1
|
+
export declare const version = "5.2.1";
|
package/dist/esm/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '5.1
|
|
1
|
+
export const version = '5.2.1';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { expose } from 'comlink';
|
|
2
2
|
import { utilities } from '@cornerstonejs/core';
|
|
3
3
|
import { utilities as ToolsUtilities } from '@cornerstonejs/tools';
|
|
4
|
-
import vtkImageData from '@kitware/vtk.js/Common/DataModel/ImageData';
|
|
5
|
-
import vtkDataArray from '@kitware/vtk.js/Common/Core/DataArray';
|
|
6
|
-
import vtkPlane from '@kitware/vtk.js/Common/DataModel/Plane';
|
|
7
|
-
import vtkPolyData from '@kitware/vtk.js/Common/DataModel/PolyData';
|
|
8
|
-
import vtkContourLoopExtraction from '@kitware/vtk.js/Filters/General/ContourLoopExtraction';
|
|
9
|
-
import vtkCutter from '@kitware/vtk.js/Filters/Core/Cutter';
|
|
4
|
+
import vtkImageData from '@kitware/vtk.js/Common/DataModel/ImageData.js';
|
|
5
|
+
import vtkDataArray from '@kitware/vtk.js/Common/Core/DataArray.js';
|
|
6
|
+
import vtkPlane from '@kitware/vtk.js/Common/DataModel/Plane.js';
|
|
7
|
+
import vtkPolyData from '@kitware/vtk.js/Common/DataModel/PolyData.js';
|
|
8
|
+
import vtkContourLoopExtraction from '@kitware/vtk.js/Filters/General/ContourLoopExtraction.js';
|
|
9
|
+
import vtkCutter from '@kitware/vtk.js/Filters/Core/Cutter.js';
|
|
10
10
|
const { math: { polyline: { containsPoint, getAABB, projectTo2D }, }, geometricSurfaceUtils: { checkStandardBasis, rotatePoints }, boundingBox: { getBoundingBoxAroundShapeWorld }, planar: { isPlaneIntersectingAABB }, } = ToolsUtilities;
|
|
11
11
|
async function peerImport(moduleId) {
|
|
12
12
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/polymorphic-segmentation",
|
|
3
|
-
"version": "5.1
|
|
3
|
+
"version": "5.2.1",
|
|
4
4
|
"description": "Polymorphic Segmentation utility for Cornerstone3D",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -12,14 +12,16 @@
|
|
|
12
12
|
},
|
|
13
13
|
"exports": {
|
|
14
14
|
".": {
|
|
15
|
+
"types": "./dist/esm/index.d.ts",
|
|
15
16
|
"import": "./dist/esm/index.js",
|
|
16
|
-
"
|
|
17
|
+
"default": "./dist/esm/index.js"
|
|
17
18
|
},
|
|
18
19
|
"./version": {
|
|
19
|
-
"
|
|
20
|
+
"types": "./dist/esm/version.d.ts",
|
|
20
21
|
"import": "./dist/esm/version.js",
|
|
21
|
-
"
|
|
22
|
-
}
|
|
22
|
+
"default": "./dist/esm/version.js"
|
|
23
|
+
},
|
|
24
|
+
"./package.json": "./package.json"
|
|
23
25
|
},
|
|
24
26
|
"publishConfig": {
|
|
25
27
|
"access": "public"
|
|
@@ -29,8 +31,8 @@
|
|
|
29
31
|
"test": "jest --testTimeout 60000",
|
|
30
32
|
"clean": "rimraf dist",
|
|
31
33
|
"build": "pnpm run build:esm",
|
|
32
|
-
"build:esm": "pnpm run prebuild && tsc --project ./tsconfig.json",
|
|
33
|
-
"build:esm:watch": "tsc --project ./tsconfig.json --watch",
|
|
34
|
+
"build:esm": "pnpm run prebuild && tsc --project ./tsconfig.json && tsc-alias -p ./tsconfig.json --resolve-full-paths && node ../../scripts/write-dist-esm-package-json.js ./",
|
|
35
|
+
"build:esm:watch": "sh -c 'tsc-alias -p ./tsconfig.json --resolve-full-paths --watch & alias_pid=$!; node ../../scripts/write-dist-esm-package-json.js ./ --watch & writer_pid=$!; trap \"kill $alias_pid $writer_pid\" EXIT; tsc --project ./tsconfig.json --watch'",
|
|
34
36
|
"dev": "tsc --project ./tsconfig.json --watch",
|
|
35
37
|
"build:all": "pnpm run build:esm",
|
|
36
38
|
"start": "tsc --project ./tsconfig.json --watch",
|
|
@@ -53,13 +55,13 @@
|
|
|
53
55
|
"@icr/polyseg-wasm": "0.4.0"
|
|
54
56
|
},
|
|
55
57
|
"devDependencies": {
|
|
56
|
-
"@cornerstonejs/core": "5.1
|
|
57
|
-
"@cornerstonejs/tools": "5.1
|
|
58
|
+
"@cornerstonejs/core": "5.2.1",
|
|
59
|
+
"@cornerstonejs/tools": "5.2.1"
|
|
58
60
|
},
|
|
59
61
|
"peerDependencies": {
|
|
60
|
-
"@cornerstonejs/core": "5.1
|
|
61
|
-
"@cornerstonejs/tools": "5.1
|
|
62
|
+
"@cornerstonejs/core": "5.2.1",
|
|
63
|
+
"@cornerstonejs/tools": "5.2.1",
|
|
62
64
|
"@kitware/vtk.js": "35.5.3"
|
|
63
65
|
},
|
|
64
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "b4c094e9246983c6ebfdfb739d1aca758687721d"
|
|
65
67
|
}
|