Skip to content

Allow linking on sub-paths to cs3d without changing cs3d generated code - #5

Open
wayfarer3130 wants to merge 1 commit into
mainfrom
fix/link-with-cs3d-5.x-paths
Open

Allow linking on sub-paths to cs3d without changing cs3d generated code#5
wayfarer3130 wants to merge 1 commit into
mainfrom
fix/link-with-cs3d-5.x-paths

Conversation

@wayfarer3130

@wayfarer3130 wayfarer3130 commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

This PR removes the old modify paths directly in generated code, and links to CS3D 5.x branches

Summary by CodeRabbit

  • Bug Fixes

    • Improved browser-based DICOM decoding and codec loading for more reliable image rendering.
    • Added fallback handling for codec resources when installed in alternate local locations.
    • Improved compatibility with browser environments that do not provide Node.js file-system modules.
  • Refactor

    • Streamlined worker setup and codec resource configuration for more consistent application initialization.

@wayfarer3130
wayfarer3130 requested a review from jbocce August 7, 2026 15:18
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: dd602d36-dd6b-4fce-bc1d-a58f46f79d89

📥 Commits

Reviewing files that changed from the base of the PR and between bd87485 and c3107f7.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • package.json
  • scripts/bundle-dicom-worker.js
  • scripts/copy-codec-wasm.js
  • scripts/install-node-stubs.js
  • src/app/cornerstone-viewport/cornerstone-viewport.component.ts

📝 Walkthrough

Walkthrough

The change switches Cornerstone packages to local monorepo paths, updates worker bundling and browser stubs, adds codec asset configuration, and supports fallback lookup across repository and sibling monorepo dependencies.

Changes

Cornerstone local integration

Layer / File(s) Summary
Local dependency and worker resolution
package.json, scripts/bundle-dicom-worker.js
Cornerstone packages use sibling file: dependencies. Worker entry resolution falls back from built output to source TypeScript. Esbuild uses browser stubs for fs and path.
Codec runtime configuration
scripts/bundle-dicom-worker.js, src/app/cornerstone-viewport/cornerstone-viewport.component.ts
Codec URLs are resolved through peerImport. Rendering and DICOM image loader initialization receive codec paths and the base path.
Codec file and stub discovery
scripts/copy-codec-wasm.js, scripts/install-node-stubs.js
Codec WASM lookup falls back to the sibling monorepo. Stub installation processes each available node_modules target.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant setup()
  participant csRenderInit
  participant DICOM image loader
  setup()->>csRenderInit: provide peerImport codec URL resolver
  setup()->>DICOM image loader: provide codec import paths and base path
  csRenderInit->>DICOM image loader: use configured codec assets
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: enabling sub-path linking to Cornerstone3D without modifying generated code.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/link-with-cs3d-5.x-paths

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant