@cornerstonejs/adapters 1.7.2 → 1.8.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/{@cornerstonejs/adapters.es.js → adapters.es.js} +1344 -698
- package/dist/adapters.es.js.map +1 -0
- package/dist/{@cornerstonejs/dts → types}/adapters/Cornerstone/index.d.ts +5 -3
- package/dist/{@cornerstonejs/dts → types}/adapters/Cornerstone3D/Angle.d.ts +1 -1
- package/dist/{@cornerstonejs/dts → types}/adapters/Cornerstone3D/Bidirectional.d.ts +1 -1
- package/dist/{@cornerstonejs/dts → types}/adapters/Cornerstone3D/CircleROI.d.ts +1 -1
- package/dist/{@cornerstonejs/dts → types}/adapters/Cornerstone3D/CobbAngle.d.ts +1 -1
- package/dist/{@cornerstonejs/dts → types}/adapters/Cornerstone3D/EllipticalROI.d.ts +1 -1
- package/dist/{@cornerstonejs/dts → types}/adapters/Cornerstone3D/MeasurementReport.d.ts +1 -1
- package/dist/{@cornerstonejs/dts → types}/adapters/Cornerstone3D/PlanarFreehandROI.d.ts +1 -1
- package/dist/{@cornerstonejs/dts → types}/adapters/Cornerstone3D/RectangleROI.d.ts +1 -1
- package/dist/types/adapters/Cornerstone3D/Segmentation/generateLabelMaps2DFrom3D.d.ts +18 -0
- package/dist/types/adapters/Cornerstone3D/Segmentation/generateSegmentation.d.ts +8 -0
- package/dist/types/adapters/Cornerstone3D/Segmentation/generateToolState.d.ts +16 -0
- package/dist/types/adapters/Cornerstone3D/Segmentation/index.d.ts +4 -0
- package/dist/{@cornerstonejs/dts → types}/adapters/Cornerstone3D/index.d.ts +6 -2
- package/dist/types/adapters/VTKjs/index.d.ts +4 -0
- package/dist/types/adapters/enums/Events.d.ts +10 -0
- package/dist/types/adapters/enums/index.d.ts +2 -0
- package/dist/types/adapters/helpers/codeMeaningEquals.d.ts +9 -0
- package/dist/types/adapters/helpers/graphicTypeEquals.d.ts +7 -0
- package/dist/types/adapters/helpers/index.d.ts +4 -0
- package/dist/types/adapters/helpers/toArray.d.ts +2 -0
- package/dist/{@cornerstonejs/dts → types}/adapters/index.d.ts +21 -3
- package/dist/types/index.d.ts +2 -0
- package/package.json +15 -8
- package/dist/@cornerstonejs/adapters.es.js.map +0 -1
- package/dist/@cornerstonejs/dts/adapters/VTKjs/index.d.ts +0 -4
- package/dist/@cornerstonejs/dts/index.d.ts +0 -3
- /package/dist/{@cornerstonejs/dts → types}/adapters/Cornerstone3D/isValidCornerstoneTrackingIdentifier.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
declare const CornerstoneSR: {
|
|
2
2
|
Length: any;
|
|
3
3
|
FreehandRoi: any;
|
|
4
4
|
Bidirectional: any;
|
|
@@ -6,9 +6,11 @@ declare const Cornerstone: {
|
|
|
6
6
|
CircleRoi: any;
|
|
7
7
|
ArrowAnnotate: any;
|
|
8
8
|
MeasurementReport: any;
|
|
9
|
-
Segmentation: any;
|
|
10
9
|
CobbAngle: any;
|
|
11
10
|
Angle: any;
|
|
12
11
|
RectangleRoi: any;
|
|
13
12
|
};
|
|
14
|
-
|
|
13
|
+
declare const CornerstoneSEG: {
|
|
14
|
+
Segmentation: any;
|
|
15
|
+
};
|
|
16
|
+
export { CornerstoneSR, CornerstoneSEG };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates 2D label maps from a 3D label map.
|
|
3
|
+
* @param labelmap3D - The 3D label map object to generate 2D label maps from. It is derived
|
|
4
|
+
* from the volume labelmap.
|
|
5
|
+
* @returns The label map object containing the 2D label maps and segments on label maps.
|
|
6
|
+
*/
|
|
7
|
+
declare function generateLabelMaps2DFrom3D(labelmap3D: any): {
|
|
8
|
+
scalarData: number[];
|
|
9
|
+
dimensions: number[];
|
|
10
|
+
segmentsOnLabelmap: number[];
|
|
11
|
+
labelmaps2D: {
|
|
12
|
+
segmentsOnLabelmap: number[];
|
|
13
|
+
pixelData: number[];
|
|
14
|
+
rows: number;
|
|
15
|
+
columns: number;
|
|
16
|
+
}[];
|
|
17
|
+
};
|
|
18
|
+
export { generateLabelMaps2DFrom3D };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* generateSegmentation - Generates a DICOM Segmentation object given cornerstoneTools data.
|
|
3
|
+
*
|
|
4
|
+
* @param images - An array of the cornerstone image objects, which includes imageId and metadata
|
|
5
|
+
* @param labelmaps - An array of the 3D Volumes that contain the segmentation data.
|
|
6
|
+
*/
|
|
7
|
+
declare function generateSegmentation(images: any, labelmaps: any, metadata: any, options: any): any;
|
|
8
|
+
export { generateSegmentation };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* generateToolState - Given a set of cornerstoneTools imageIds and a Segmentation buffer,
|
|
3
|
+
* derive cornerstoneTools toolState and brush metadata.
|
|
4
|
+
*
|
|
5
|
+
* @param imageIds - An array of the imageIds.
|
|
6
|
+
* @param arrayBuffer - The SEG arrayBuffer.
|
|
7
|
+
* @param skipOverlapping - skip checks for overlapping segs, default value false.
|
|
8
|
+
* @param tolerance - default value 1.e-3.
|
|
9
|
+
*
|
|
10
|
+
* @returns a list of array buffer for each labelMap
|
|
11
|
+
* an object from which the segment metadata can be derived
|
|
12
|
+
* list containing the track of segments per frame
|
|
13
|
+
* list containing the track of segments per frame for each labelMap (available only for the overlapping case).
|
|
14
|
+
*/
|
|
15
|
+
declare function generateToolState(imageIds: any, arrayBuffer: any, metadataProvider: any, skipOverlapping?: boolean, tolerance?: number): any;
|
|
16
|
+
export { generateToolState };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { generateSegmentation } from "./generateSegmentation";
|
|
2
|
+
import { generateLabelMaps2DFrom3D } from "./generateLabelMaps2DFrom3D";
|
|
3
|
+
import { generateToolState } from "./generateToolState";
|
|
4
|
+
export { generateLabelMaps2DFrom3D, generateSegmentation, generateToolState };
|
|
@@ -6,7 +6,8 @@ import CircleROI from "./CircleROI";
|
|
|
6
6
|
import EllipticalROI from "./EllipticalROI";
|
|
7
7
|
import RectangleROI from "./RectangleROI";
|
|
8
8
|
import PlanarFreehandROI from "./PlanarFreehandROI";
|
|
9
|
-
|
|
9
|
+
import * as Segmentation from "./Segmentation";
|
|
10
|
+
declare const Cornerstone3DSR: {
|
|
10
11
|
Bidirectional: typeof Bidirectional;
|
|
11
12
|
CobbAngle: typeof CobbAngle;
|
|
12
13
|
Angle: typeof Angle;
|
|
@@ -21,4 +22,7 @@ declare const Cornerstone3D: {
|
|
|
21
22
|
CodeScheme: any;
|
|
22
23
|
CORNERSTONE_3D_TAG: any;
|
|
23
24
|
};
|
|
24
|
-
|
|
25
|
+
declare const Cornerstone3DSEG: {
|
|
26
|
+
Segmentation: typeof Segmentation;
|
|
27
|
+
};
|
|
28
|
+
export { Cornerstone3DSR, Cornerstone3DSEG };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a function that checks if a given content item's ConceptNameCodeSequence.CodeMeaning
|
|
3
|
+
* matches the provided codeMeaningName.
|
|
4
|
+
* @param codeMeaningName - The CodeMeaning to match against.
|
|
5
|
+
* @returns A function that takes a content item and returns a boolean indicating whether the
|
|
6
|
+
* content item's CodeMeaning matches the provided codeMeaningName.
|
|
7
|
+
*/
|
|
8
|
+
declare const codeMeaningEquals: (codeMeaningName: string) => (contentItem: any) => boolean;
|
|
9
|
+
export { codeMeaningEquals };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if a given content item's GraphicType property matches a specified value.
|
|
3
|
+
* @param {string} graphicType - The value to compare the content item's GraphicType property to.
|
|
4
|
+
* @returns {function} A function that takes a content item and returns a boolean indicating whether its GraphicType property matches the specified value.
|
|
5
|
+
*/
|
|
6
|
+
declare const graphicTypeEquals: (graphicType: any) => (contentItem: any) => boolean;
|
|
7
|
+
export { graphicTypeEquals };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import * as Enums from "./enums";
|
|
2
|
+
import * as helpers from "./helpers";
|
|
3
|
+
declare const adaptersSR: {
|
|
2
4
|
Cornerstone: {
|
|
3
5
|
Length: any;
|
|
4
6
|
FreehandRoi: any;
|
|
@@ -7,7 +9,6 @@ declare const adapters: {
|
|
|
7
9
|
CircleRoi: any;
|
|
8
10
|
ArrowAnnotate: any;
|
|
9
11
|
MeasurementReport: any;
|
|
10
|
-
Segmentation: any;
|
|
11
12
|
CobbAngle: any;
|
|
12
13
|
Angle: any;
|
|
13
14
|
RectangleRoi: any;
|
|
@@ -27,8 +28,25 @@ declare const adapters: {
|
|
|
27
28
|
CodeScheme: any;
|
|
28
29
|
CORNERSTONE_3D_TAG: any;
|
|
29
30
|
};
|
|
31
|
+
};
|
|
32
|
+
declare const adaptersSEG: {
|
|
33
|
+
Cornerstone: {
|
|
34
|
+
Length: any;
|
|
35
|
+
FreehandRoi: any;
|
|
36
|
+
Bidirectional: any;
|
|
37
|
+
EllipticalRoi: any;
|
|
38
|
+
CircleRoi: any;
|
|
39
|
+
ArrowAnnotate: any;
|
|
40
|
+
MeasurementReport: any;
|
|
41
|
+
CobbAngle: any;
|
|
42
|
+
Angle: any;
|
|
43
|
+
RectangleRoi: any;
|
|
44
|
+
};
|
|
45
|
+
Cornerstone3D: {
|
|
46
|
+
Segmentation: typeof import("./Cornerstone3D/Segmentation");
|
|
47
|
+
};
|
|
30
48
|
VTKjs: {
|
|
31
49
|
Segmentation: any;
|
|
32
50
|
};
|
|
33
51
|
};
|
|
34
|
-
export
|
|
52
|
+
export { adaptersSR, adaptersSEG, Enums, helpers };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/adapters",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "Adapters for Cornerstone3D to/from formats including DICOM SR and others",
|
|
5
5
|
"src": "src/index.ts",
|
|
6
6
|
"main": "./dist/@cornerstonejs/adapters.es.js",
|
|
@@ -9,23 +9,24 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"directories": {
|
|
12
|
-
"example": "examples",
|
|
13
12
|
"build": "dist"
|
|
14
13
|
},
|
|
15
14
|
"exports": {
|
|
16
|
-
"
|
|
15
|
+
"import": "./dist/adapters.es.js"
|
|
17
16
|
},
|
|
18
|
-
"types": "./dist
|
|
17
|
+
"types": "./dist/types/index.d.ts",
|
|
19
18
|
"publishConfig": {
|
|
20
19
|
"access": "public"
|
|
21
20
|
},
|
|
22
21
|
"scripts": {
|
|
23
22
|
"test": "jest --testTimeout 60000",
|
|
24
23
|
"build": "rollup -c rollup.config.mjs",
|
|
24
|
+
"build:esm": "rollup -c rollup.config.mjs",
|
|
25
|
+
"build:esm:watch": "rollup --watch -c rollup.config.mjs",
|
|
26
|
+
"dev": "rollup --watch -c rollup.config.mjs",
|
|
25
27
|
"build:all": "yarn build",
|
|
26
|
-
"build:examples": "npm run build && npx cpx 'dist/**/*.{js,map}' examples/js",
|
|
27
28
|
"build:update-api": "yarn run build && api-extractor run --local",
|
|
28
|
-
"start": "rollup -c
|
|
29
|
+
"start": "rollup --watch -c rollup.config.mjs",
|
|
29
30
|
"format": "prettier --write 'src/**/*.js' 'test/**/*.js'",
|
|
30
31
|
"lint": "eslint --fix ."
|
|
31
32
|
},
|
|
@@ -41,10 +42,16 @@
|
|
|
41
42
|
"homepage": "https://github.com/cornerstonejs/cornerstone3D/blob/main/packages/adapters/README.md",
|
|
42
43
|
"dependencies": {
|
|
43
44
|
"@babel/runtime-corejs2": "^7.17.8",
|
|
44
|
-
"
|
|
45
|
+
"buffer": "^6.0.3",
|
|
46
|
+
"dcmjs": "^0.29.8",
|
|
45
47
|
"gl-matrix": "^3.4.3",
|
|
46
48
|
"lodash.clonedeep": "^4.5.0",
|
|
47
49
|
"ndarray": "^1.0.19"
|
|
48
50
|
},
|
|
49
|
-
"
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@cornerstonejs/core": "^1.8.0",
|
|
53
|
+
"@cornerstonejs/streaming-image-volume-loader": "^1.8.0",
|
|
54
|
+
"@cornerstonejs/tools": "^1.8.0"
|
|
55
|
+
},
|
|
56
|
+
"gitHead": "adb02393675fbdb364b9b7d9a9f6d5113b15d8be"
|
|
50
57
|
}
|