diff --git a/packages/ai/examples/segmentAnthingClientSide/index.ts b/packages/ai/examples/SAMClientSide/index.ts similarity index 100% rename from packages/ai/examples/segmentAnthingClientSide/index.ts rename to packages/ai/examples/SAMClientSide/index.ts diff --git a/packages/core/src/RenderingEngine/StackViewport.ts b/packages/core/src/RenderingEngine/StackViewport.ts index a05e1c56a7..e0e6afd2ef 100644 --- a/packages/core/src/RenderingEngine/StackViewport.ts +++ b/packages/core/src/RenderingEngine/StackViewport.ts @@ -478,6 +478,10 @@ class StackViewport extends Viewport { private getImageDataCPU(): CPUIImageData | undefined { const { metadata } = this._cpuFallbackEnabledElement; + if (!metadata) { + return; + } + const spacing = metadata.spacing; const csImage = this.csImage; return { @@ -942,6 +946,11 @@ class StackViewport extends Viewport { private getCameraCPU(): Partial { const { metadata, viewport } = this._cpuFallbackEnabledElement; + + if (!metadata) { + return {}; + } + const { direction } = metadata; // focalPoint and position of CPU camera is just a placeholder since diff --git a/utils/ExampleRunner/example-info.json b/utils/ExampleRunner/example-info.json index bfd5bd2152..ec66250ec0 100644 --- a/utils/ExampleRunner/example-info.json +++ b/utils/ExampleRunner/example-info.json @@ -408,9 +408,9 @@ "name": "sculptorTool Tool", "description": "Demonstrates how to have similar brush tool effects on the contour" }, - "segmentationAI": { + "SAMClientSide": { "name": "Segmentation AI Assistance", - "description": "Demonstrates how to use AI/ML assistance tools for segmentation creation" + "description": "Demonstrates how to use AI assistance tools for segmentation creation using onnx runtime on the client side" } }, "tools-advanced": {