@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.
Files changed (30) hide show
  1. package/dist/{@cornerstonejs/adapters.es.js → adapters.es.js} +1344 -698
  2. package/dist/adapters.es.js.map +1 -0
  3. package/dist/{@cornerstonejs/dts → types}/adapters/Cornerstone/index.d.ts +5 -3
  4. package/dist/{@cornerstonejs/dts → types}/adapters/Cornerstone3D/Angle.d.ts +1 -1
  5. package/dist/{@cornerstonejs/dts → types}/adapters/Cornerstone3D/Bidirectional.d.ts +1 -1
  6. package/dist/{@cornerstonejs/dts → types}/adapters/Cornerstone3D/CircleROI.d.ts +1 -1
  7. package/dist/{@cornerstonejs/dts → types}/adapters/Cornerstone3D/CobbAngle.d.ts +1 -1
  8. package/dist/{@cornerstonejs/dts → types}/adapters/Cornerstone3D/EllipticalROI.d.ts +1 -1
  9. package/dist/{@cornerstonejs/dts → types}/adapters/Cornerstone3D/MeasurementReport.d.ts +1 -1
  10. package/dist/{@cornerstonejs/dts → types}/adapters/Cornerstone3D/PlanarFreehandROI.d.ts +1 -1
  11. package/dist/{@cornerstonejs/dts → types}/adapters/Cornerstone3D/RectangleROI.d.ts +1 -1
  12. package/dist/types/adapters/Cornerstone3D/Segmentation/generateLabelMaps2DFrom3D.d.ts +18 -0
  13. package/dist/types/adapters/Cornerstone3D/Segmentation/generateSegmentation.d.ts +8 -0
  14. package/dist/types/adapters/Cornerstone3D/Segmentation/generateToolState.d.ts +16 -0
  15. package/dist/types/adapters/Cornerstone3D/Segmentation/index.d.ts +4 -0
  16. package/dist/{@cornerstonejs/dts → types}/adapters/Cornerstone3D/index.d.ts +6 -2
  17. package/dist/types/adapters/VTKjs/index.d.ts +4 -0
  18. package/dist/types/adapters/enums/Events.d.ts +10 -0
  19. package/dist/types/adapters/enums/index.d.ts +2 -0
  20. package/dist/types/adapters/helpers/codeMeaningEquals.d.ts +9 -0
  21. package/dist/types/adapters/helpers/graphicTypeEquals.d.ts +7 -0
  22. package/dist/types/adapters/helpers/index.d.ts +4 -0
  23. package/dist/types/adapters/helpers/toArray.d.ts +2 -0
  24. package/dist/{@cornerstonejs/dts → types}/adapters/index.d.ts +21 -3
  25. package/dist/types/index.d.ts +2 -0
  26. package/package.json +15 -8
  27. package/dist/@cornerstonejs/adapters.es.js.map +0 -1
  28. package/dist/@cornerstonejs/dts/adapters/VTKjs/index.d.ts +0 -4
  29. package/dist/@cornerstonejs/dts/index.d.ts +0 -3
  30. /package/dist/{@cornerstonejs/dts → types}/adapters/Cornerstone3D/isValidCornerstoneTrackingIdentifier.d.ts +0 -0
@@ -1,4 +1,4 @@
1
- declare const Cornerstone: {
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
- export default Cornerstone;
13
+ declare const CornerstoneSEG: {
14
+ Segmentation: any;
15
+ };
16
+ export { CornerstoneSR, CornerstoneSEG };
@@ -17,7 +17,7 @@ declare class Angle {
17
17
  data: any;
18
18
  };
19
19
  finding: any;
20
- findingSites: any;
20
+ findingSites: any[];
21
21
  };
22
22
  static getTID300RepresentationArguments(tool: any, worldToImageCoords: any): {
23
23
  point1: {
@@ -17,7 +17,7 @@ declare class Bidirectional {
17
17
  data: any;
18
18
  };
19
19
  finding: any;
20
- findingSites: any;
20
+ findingSites: any[];
21
21
  };
22
22
  static getTID300RepresentationArguments(tool: any, worldToImageCoords: any): {
23
23
  longAxis: {
@@ -20,7 +20,7 @@ declare class CircleROI {
20
20
  data: any;
21
21
  };
22
22
  finding: any;
23
- findingSites: any;
23
+ findingSites: any[];
24
24
  };
25
25
  /**
26
26
  * Gets the TID 300 representation of a circle, given the cornerstone representation.
@@ -17,7 +17,7 @@ declare class CobbAngle {
17
17
  data: any;
18
18
  };
19
19
  finding: any;
20
- findingSites: any;
20
+ findingSites: any[];
21
21
  };
22
22
  static getTID300RepresentationArguments(tool: any, worldToImageCoords: any): {
23
23
  point1: {
@@ -19,7 +19,7 @@ declare class EllipticalROI {
19
19
  data: any;
20
20
  };
21
21
  finding: any;
22
- findingSites: any;
22
+ findingSites: any[];
23
23
  };
24
24
  static getTID300RepresentationArguments(tool: any, worldToImageCoords: any): {
25
25
  area: any;
@@ -38,7 +38,7 @@ export default class MeasurementReport {
38
38
  data: any;
39
39
  };
40
40
  finding: any;
41
- findingSites: any;
41
+ findingSites: any[];
42
42
  };
43
43
  NUMGroup: any;
44
44
  SCOORDGroup: any;
@@ -17,7 +17,7 @@ declare class PlanarFreehandROI {
17
17
  data: any;
18
18
  };
19
19
  finding: any;
20
- findingSites: any;
20
+ findingSites: any[];
21
21
  };
22
22
  static getTID300RepresentationArguments(tool: any, worldToImageCoords: any): {
23
23
  points: any;
@@ -17,7 +17,7 @@ declare class RectangleROI {
17
17
  data: any;
18
18
  };
19
19
  finding: any;
20
- findingSites: any;
20
+ findingSites: any[];
21
21
  };
22
22
  static getTID300RepresentationArguments(tool: any, worldToImageCoords: any): {
23
23
  points: any[];
@@ -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
- declare const Cornerstone3D: {
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
- export default Cornerstone3D;
25
+ declare const Cornerstone3DSEG: {
26
+ Segmentation: typeof Segmentation;
27
+ };
28
+ export { Cornerstone3DSR, Cornerstone3DSEG };
@@ -0,0 +1,4 @@
1
+ declare const VTKjsSEG: {
2
+ Segmentation: any;
3
+ };
4
+ export { VTKjsSEG };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Cornerstone adapters events
3
+ */
4
+ declare enum Events {
5
+ /**
6
+ * Cornerstone segmentation load progress event
7
+ */
8
+ SEGMENTATION_LOAD_PROGRESS = "CORNERSTONE_ADAPTER_SEGMENTATION_LOAD_PROGRESS"
9
+ }
10
+ export default Events;
@@ -0,0 +1,2 @@
1
+ import Events from "./Events";
2
+ export { Events };
@@ -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 };
@@ -0,0 +1,4 @@
1
+ import { toArray } from "./toArray";
2
+ import { codeMeaningEquals } from "./codeMeaningEquals";
3
+ import { graphicTypeEquals } from "./graphicTypeEquals";
4
+ export { toArray, codeMeaningEquals, graphicTypeEquals };
@@ -0,0 +1,2 @@
1
+ declare const toArray: (x: any) => any[];
2
+ export { toArray };
@@ -1,4 +1,6 @@
1
- declare const adapters: {
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 default adapters;
52
+ export { adaptersSR, adaptersSEG, Enums, helpers };
@@ -0,0 +1,2 @@
1
+ import { adaptersSR, adaptersSEG, Enums, helpers } from "./adapters";
2
+ export { adaptersSR, adaptersSEG, Enums, helpers };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/adapters",
3
- "version": "1.7.2",
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
- ".": "./dist/@cornerstonejs/adapters.es.js"
15
+ "import": "./dist/adapters.es.js"
17
16
  },
18
- "types": "./dist/@cornerstonejs/dts/index.d.ts",
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 -w",
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
- "dcmjs": "^0.29.5",
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
- "gitHead": "8d996239bf6e2ce265a4d0bd6a5a6d8fe5e7122f"
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
  }