@cornerstonejs/core 0.36.5 → 0.37.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/cjs/RenderingEngine/VolumeViewport3D.d.ts +1 -0
- package/dist/cjs/RenderingEngine/VolumeViewport3D.js +3 -0
- package/dist/cjs/RenderingEngine/VolumeViewport3D.js.map +1 -1
- package/dist/cjs/cache/classes/Contour.d.ts +2 -0
- package/dist/cjs/cache/classes/Contour.js +1 -0
- package/dist/cjs/cache/classes/Contour.js.map +1 -1
- package/dist/cjs/cache/classes/ContourSet.d.ts +3 -0
- package/dist/cjs/cache/classes/ContourSet.js +14 -7
- package/dist/cjs/cache/classes/ContourSet.js.map +1 -1
- package/dist/cjs/loaders/geometryLoader.js +1 -0
- package/dist/cjs/loaders/geometryLoader.js.map +1 -1
- package/dist/cjs/types/ContourData.d.ts +3 -1
- package/dist/cjs/types/IContourSet.d.ts +1 -0
- package/dist/cjs/types/IGeometry.d.ts +2 -2
- package/dist/cjs/types/IStreamingVolumeProperties.d.ts +1 -0
- package/dist/esm/RenderingEngine/VolumeViewport3D.d.ts +1 -0
- package/dist/esm/RenderingEngine/VolumeViewport3D.js +3 -0
- package/dist/esm/RenderingEngine/VolumeViewport3D.js.map +1 -1
- package/dist/esm/cache/classes/Contour.d.ts +2 -0
- package/dist/esm/cache/classes/Contour.js +1 -0
- package/dist/esm/cache/classes/Contour.js.map +1 -1
- package/dist/esm/cache/classes/ContourSet.d.ts +3 -0
- package/dist/esm/cache/classes/ContourSet.js +14 -6
- package/dist/esm/cache/classes/ContourSet.js.map +1 -1
- package/dist/esm/loaders/geometryLoader.js +1 -0
- package/dist/esm/loaders/geometryLoader.js.map +1 -1
- package/dist/esm/types/ContourData.d.ts +3 -1
- package/dist/esm/types/IContourSet.d.ts +1 -0
- package/dist/esm/types/IGeometry.d.ts +2 -2
- package/dist/esm/types/IStreamingVolumeProperties.d.ts +1 -0
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/package.json +2 -2
- package/src/RenderingEngine/VolumeViewport3D.ts +4 -0
- package/src/cache/classes/Contour.ts +3 -0
- package/src/cache/classes/ContourSet.ts +18 -6
- package/src/loaders/geometryLoader.ts +1 -0
- package/src/types/ContourData.ts +3 -1
- package/src/types/IContourSet.ts +1 -0
- package/src/types/IGeometry.ts +2 -2
- package/src/types/IStreamingVolumeProperties.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/umd/index.js",
|
|
6
6
|
"types": "dist/esm/index.d.ts",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"type": "individual",
|
|
52
52
|
"url": "https://ohif.org/donate"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "1e40104275742f14a7a48b076f244610f90e8657"
|
|
55
55
|
}
|
|
@@ -41,6 +41,10 @@ class VolumeViewport3D extends BaseVolumeViewport {
|
|
|
41
41
|
public getCurrentImageIdIndex = (): number | undefined => {
|
|
42
42
|
return undefined;
|
|
43
43
|
};
|
|
44
|
+
|
|
45
|
+
public getCurrentImageId = (): string => {
|
|
46
|
+
return null;
|
|
47
|
+
};
|
|
44
48
|
}
|
|
45
49
|
|
|
46
50
|
export default VolumeViewport3D;
|
|
@@ -5,6 +5,7 @@ type ContourProps = {
|
|
|
5
5
|
id: string;
|
|
6
6
|
data: ContourData;
|
|
7
7
|
color: Point3;
|
|
8
|
+
segmentIndex: number;
|
|
8
9
|
};
|
|
9
10
|
|
|
10
11
|
/**
|
|
@@ -19,6 +20,7 @@ export class Contour implements IContour {
|
|
|
19
20
|
points: Point3[];
|
|
20
21
|
color: Point3;
|
|
21
22
|
type: ContourType;
|
|
23
|
+
segmentIndex: number;
|
|
22
24
|
|
|
23
25
|
constructor(props: ContourProps) {
|
|
24
26
|
const { points, type } = props.data;
|
|
@@ -26,6 +28,7 @@ export class Contour implements IContour {
|
|
|
26
28
|
this.points = points;
|
|
27
29
|
this.type = type;
|
|
28
30
|
this.color = props.color;
|
|
31
|
+
this.segmentIndex = props.segmentIndex;
|
|
29
32
|
|
|
30
33
|
this.sizeInBytes = this._getSizeInBytes();
|
|
31
34
|
}
|
|
@@ -5,6 +5,7 @@ type ContourSetProps = {
|
|
|
5
5
|
id: string;
|
|
6
6
|
data: ContourData[];
|
|
7
7
|
frameOfReferenceUID: string;
|
|
8
|
+
segmentIndex: number;
|
|
8
9
|
color?: Point3;
|
|
9
10
|
};
|
|
10
11
|
|
|
@@ -17,6 +18,7 @@ export class ContourSet implements IContourSet {
|
|
|
17
18
|
readonly sizeInBytes: number;
|
|
18
19
|
readonly frameOfReferenceUID: string;
|
|
19
20
|
private color: Point3 = [200, 0, 0]; // default color
|
|
21
|
+
private segmentIndex: number;
|
|
20
22
|
contours: IContour[];
|
|
21
23
|
|
|
22
24
|
constructor(props: ContourSetProps) {
|
|
@@ -24,24 +26,30 @@ export class ContourSet implements IContourSet {
|
|
|
24
26
|
this.contours = [];
|
|
25
27
|
this.color = props.color ?? this.color;
|
|
26
28
|
this.frameOfReferenceUID = props.frameOfReferenceUID;
|
|
29
|
+
this.segmentIndex = props.segmentIndex;
|
|
27
30
|
|
|
28
31
|
this._createEachContour(props.data);
|
|
29
32
|
this.sizeInBytes = this._getSizeInBytes();
|
|
30
33
|
}
|
|
31
34
|
|
|
32
35
|
_createEachContour(contourDataArray: ContourData[]): void {
|
|
33
|
-
|
|
36
|
+
contourDataArray.forEach((contourData) => {
|
|
37
|
+
const { points, type, color } = contourData;
|
|
38
|
+
|
|
34
39
|
const contour = new Contour({
|
|
35
|
-
id: `${this.id}-${
|
|
40
|
+
id: `${this.id}-segment-${this.segmentIndex}`,
|
|
36
41
|
data: {
|
|
37
|
-
points
|
|
38
|
-
type
|
|
42
|
+
points,
|
|
43
|
+
type,
|
|
44
|
+
segmentIndex: this.segmentIndex,
|
|
45
|
+
color: color ?? this.color,
|
|
39
46
|
},
|
|
40
|
-
|
|
47
|
+
segmentIndex: this.segmentIndex,
|
|
48
|
+
color: color ?? this.color,
|
|
41
49
|
});
|
|
42
50
|
|
|
43
51
|
this.contours.push(contour);
|
|
44
|
-
}
|
|
52
|
+
});
|
|
45
53
|
}
|
|
46
54
|
|
|
47
55
|
_getSizeInBytes(): number {
|
|
@@ -50,6 +58,10 @@ export class ContourSet implements IContourSet {
|
|
|
50
58
|
}, 0);
|
|
51
59
|
}
|
|
52
60
|
|
|
61
|
+
public getSegmentIndex(): number {
|
|
62
|
+
return this.segmentIndex;
|
|
63
|
+
}
|
|
64
|
+
|
|
53
65
|
public getColor(): Point3 {
|
|
54
66
|
// Currently, all contours in a contour set have the same color.
|
|
55
67
|
// This may change in the future.
|
package/src/types/ContourData.ts
CHANGED
|
@@ -8,12 +8,14 @@ type ContourSetData = {
|
|
|
8
8
|
data: ContourData[];
|
|
9
9
|
frameOfReferenceUID: string;
|
|
10
10
|
color?: Point3;
|
|
11
|
+
segmentIndex?: number;
|
|
11
12
|
};
|
|
12
13
|
|
|
13
14
|
type ContourData = {
|
|
14
15
|
points: Point3[];
|
|
15
16
|
type: ContourType;
|
|
16
|
-
color
|
|
17
|
+
color: Point3;
|
|
18
|
+
segmentIndex: number;
|
|
17
19
|
};
|
|
18
20
|
|
|
19
21
|
export type { PublicContourSetData, ContourSetData, ContourData };
|
package/src/types/IContourSet.ts
CHANGED
package/src/types/IGeometry.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ContourSet } from '../cache/classes/ContourSet';
|
|
2
1
|
import { GeometryType } from '../enums';
|
|
2
|
+
import { IContourSet } from './IContourSet';
|
|
3
3
|
|
|
4
4
|
// interface IGeometry can be array of IContourSet
|
|
5
5
|
interface IGeometry {
|
|
6
6
|
id: string;
|
|
7
7
|
type: GeometryType;
|
|
8
|
-
data:
|
|
8
|
+
data: IContourSet; // | Array<IClosedSurface> , etc
|
|
9
9
|
sizeInBytes: number;
|
|
10
10
|
}
|
|
11
11
|
|