@cornerstonejs/labelmap-interpolation 3.0.0-beta.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.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +60 -0
  3. package/package.json +55 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Open Health Imaging Foundation
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,60 @@
1
+ # Cornerstone Segmentation Labelmap Interpolation
2
+
3
+ This package provides a utility for interpolating labelmaps in 3D medical imaging. It leverages the power of `itk-wasm` and `@itk-wasm/morphological-contour-interpolation` to perform morphological contour interpolation between segmented slices.
4
+
5
+ ## Overview
6
+
7
+ When creating segmentations in 3D medical imaging, it's often time-consuming to manually segment every slice. This package allows you to segment only a subset of slices and then automatically interpolate the segmentation between those slices, significantly reducing the time required for complete 3D segmentation.
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ npm install @cornerstonejs/labelmap-interpolation
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ ### Basic Usage
18
+
19
+ ```typescript
20
+ import { interpolate } from '@cornerstonejs/labelmap-interpolation';
21
+
22
+ // Run interpolation on a specific segment
23
+ interpolate({
24
+ segmentationId: 'MY_SEGMENTATION_ID',
25
+ segmentIndex: 1, // The segment index to interpolate
26
+ });
27
+ ```
28
+
29
+ ### With Configuration Options
30
+
31
+ ```typescript
32
+ import { interpolate } from '@cornerstonejs/labelmap-interpolation';
33
+
34
+ // Run interpolation with custom configuration
35
+ interpolate({
36
+ segmentationId: 'MY_SEGMENTATION_ID',
37
+ segmentIndex: 1,
38
+ configuration: {
39
+ axis: 2, // Axis along which to perform interpolation (0=X, 1=Y, 2=Z)
40
+ noHeuristicAlignment: false, // Whether to disable heuristic alignment
41
+ noUseDistanceTransform: false, // Whether to disable distance transform
42
+ useCustomSlicePositions: false, // Whether to use custom slice positions
43
+ preview: false // Whether to preview the interpolation result
44
+ }
45
+ });
46
+ ```
47
+
48
+ ## How It Works
49
+
50
+ The interpolation process works by:
51
+
52
+ 1. Taking a segmentation volume with segments on non-adjacent slices
53
+ 2. Using morphological contour interpolation to fill in the missing slices
54
+ 3. Updating the segmentation volume with the interpolated data
55
+
56
+ The package uses web workers to perform the interpolation in a background thread, preventing UI freezes during computation.
57
+
58
+ ## License
59
+
60
+ MIT
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@cornerstonejs/labelmap-interpolation",
3
+ "version": "3.0.0-beta.3",
4
+ "description": "Labelmap Interpolation utility for Cornerstone3D",
5
+ "files": [
6
+ "dist"
7
+ ],
8
+ "module": "./dist/esm/index.js",
9
+ "types": "./dist/esm/index.d.ts",
10
+ "directories": {
11
+ "build": "dist"
12
+ },
13
+ "exports": {
14
+ ".": {
15
+ "import": "./dist/esm/index.js",
16
+ "types": "./dist/esm/index.d.ts"
17
+ }
18
+ },
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "scripts": {
23
+ "test": "jest --testTimeout 60000",
24
+ "clean": "rimraf dist",
25
+ "build": "yarn run build:esm",
26
+ "build:esm": "tsc --project ./tsconfig.json",
27
+ "build:esm:watch": "tsc --project ./tsconfig.json --watch",
28
+ "dev": "tsc --project ./tsconfig.json --watch",
29
+ "build:all": "yarn run build:esm",
30
+ "build:update-api": "yarn run build:esm && api-extractor run --local",
31
+ "start": "tsc --project ./tsconfig.json --watch",
32
+ "format": "prettier --write 'src/**/*.js' 'test/**/*.js'",
33
+ "lint": "eslint --fix ."
34
+ },
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "git+https://github.com/cornerstonejs/cornerstone3D.git"
38
+ },
39
+ "author": "@cornerstonejs",
40
+ "license": "MIT",
41
+ "bugs": {
42
+ "url": "https://github.com/cornerstonejs/cornerstone3D/issues"
43
+ },
44
+ "homepage": "https://github.com/cornerstonejs/cornerstone3D/blob/main/packages/labelmap-interpolation/README.md",
45
+ "dependencies": {
46
+ "@itk-wasm/morphological-contour-interpolation": "1.1.0",
47
+ "itk-wasm": "1.0.0-b.165"
48
+ },
49
+ "peerDependencies": {
50
+ "@cornerstonejs/core": "^3.0.0-beta.3",
51
+ "@cornerstonejs/tools": "^3.0.0-beta.3",
52
+ "@kitware/vtk.js": "^32.9.0"
53
+ },
54
+ "gitHead": "d2b29db96b3ecf98c9e9f0591978423dc9f6cb3f"
55
+ }