@cornerstonejs/core 1.11.4 → 1.12.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/cjs/RenderingEngine/BaseVolumeViewport.d.ts +1 -0
- package/dist/cjs/RenderingEngine/BaseVolumeViewport.js +12 -0
- package/dist/cjs/RenderingEngine/BaseVolumeViewport.js.map +1 -1
- package/dist/cjs/types/IVolumeViewport.d.ts +1 -0
- package/dist/esm/RenderingEngine/BaseVolumeViewport.d.ts +1 -0
- package/dist/esm/RenderingEngine/BaseVolumeViewport.js +12 -0
- package/dist/esm/RenderingEngine/BaseVolumeViewport.js.map +1 -1
- package/dist/esm/types/IVolumeViewport.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/BaseVolumeViewport.ts +25 -0
- package/src/types/IVolumeViewport.ts +4 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/umd/index.js",
|
|
6
6
|
"types": "dist/esm/index.d.ts",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"type": "individual",
|
|
47
47
|
"url": "https://ohif.org/donate"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "0da336d17de9f6f8cfb1c822618334bea2a162f5"
|
|
50
50
|
}
|
|
@@ -1082,6 +1082,31 @@ abstract class BaseVolumeViewport extends Viewport implements IVolumeViewport {
|
|
|
1082
1082
|
return volume.getScalarData()[voxelIndex];
|
|
1083
1083
|
}
|
|
1084
1084
|
|
|
1085
|
+
/**
|
|
1086
|
+
* Returns the list of image Ids for the current viewport
|
|
1087
|
+
*
|
|
1088
|
+
* @param volumeId - volumeId
|
|
1089
|
+
* @returns list of strings for image Ids
|
|
1090
|
+
*/
|
|
1091
|
+
public getImageIds = (volumeId?: string): Array<string> => {
|
|
1092
|
+
const applicableVolumeActorInfo = this._getApplicableVolumeActor(volumeId);
|
|
1093
|
+
|
|
1094
|
+
if (!applicableVolumeActorInfo) {
|
|
1095
|
+
throw new Error(`No actor found for the given volumeId: ${volumeId}`);
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
const volumeIdToUse = applicableVolumeActorInfo.volumeId;
|
|
1099
|
+
|
|
1100
|
+
const imageVolume = cache.getVolume(volumeIdToUse);
|
|
1101
|
+
if (!imageVolume) {
|
|
1102
|
+
throw new Error(
|
|
1103
|
+
`imageVolume with id: ${volumeIdToUse} does not exist in cache`
|
|
1104
|
+
);
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
return imageVolume.imageIds;
|
|
1108
|
+
};
|
|
1109
|
+
|
|
1085
1110
|
abstract getCurrentImageIdIndex(): number;
|
|
1086
1111
|
|
|
1087
1112
|
abstract getCurrentImageId(): string;
|
|
@@ -28,6 +28,10 @@ export default interface IVolumeViewport extends IViewport {
|
|
|
28
28
|
* projected onto the `Viewport`'s `canvas`.
|
|
29
29
|
*/
|
|
30
30
|
worldToCanvas: (worldPos: Point3) => Point2;
|
|
31
|
+
/**
|
|
32
|
+
* Returns the list of image Ids for the current viewport
|
|
33
|
+
*/
|
|
34
|
+
getImageIds: (volumeId?: string) => string[];
|
|
31
35
|
/**
|
|
32
36
|
* Uses viewport camera and volume actor to decide if the viewport
|
|
33
37
|
* is looking at the volume in the direction of acquisition (imageIds).
|
|
@@ -142,5 +146,4 @@ export default interface IVolumeViewport extends IViewport {
|
|
|
142
146
|
* Reset the viewport properties to the default values
|
|
143
147
|
*/
|
|
144
148
|
resetProperties(volumeId?: string): void;
|
|
145
|
-
|
|
146
149
|
}
|