Open ArnaudAgixis opened 3 months ago
I'm using angular 17 like you and i can import this library like this. and add cornerstone config in services file without any error
it is odd, search in the cornerstone github, there are some discussions for related issues in vite
I have tried your solution and still have the problem
try copying the cornerstoneDICOMImageLoader.bundle.min.js found in node_modules/@cornerstonejs/dicom-image-loader/dist , to the path src/assets, then including it in the project's index.html
I'm working on cornerstone3D 2.x and have made progress in removing circular dependencies and publishing the types for the DICOM image loader. I'm trying to make it work with Vite, but there are numerous issues with Vite in dev
mode, which are not directly related to Cornerstone. Multiple mentions of Vite problems with import.meta.url
, web workers, and WebAssembly can be found on the Vite GitHub repository:
https://github.com/vitejs/vite/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+import.meta.url
I have started a template project for Vite, React, and cornerstone3D beta 2.x here. I appreciate your help in making it work.
Describe the Bug
When I try to reproduce an example that use dicom-image-loader like this one : DICOM P10 from local file system, the package is not found. I try to install it with npm and yarn. I install the lastest versions.
"@cornerstonejs/core": "^1.66.6", "@cornerstonejs/dicom-image-loader": "^1.66.6", "@cornerstonejs/streaming-image-volume-loader": "^1.66.6", "@cornerstonejs/tools": "^1.66.6",
All the packages are correctly installed inside the node_modules, or seems to be.Steps to Reproduce
The current behavior
Could not find a declaration file for module '@cornerstonejs/dicom-image-loader'. 'c:/Users/user/testAppCornerstone3D/node_modules/@cornerstonejs/dicom-image-loader/dist/cornerstoneDICOMImageLoader.bundle.min.js' implicitly has an 'any' type. Try
npm i --save-dev @types/cornerstonejs__dicom-image-loader
if it exists or add a new declaration (.d.ts) file containingdeclare module '@cornerstonejs/dicom-image-loader';
ts(7016)The expected behavior
to be able to import @cornerstonejs/dicom-image-loader
OS
Windows 10
Node version
v20.11.1
Browser
Firefox 123.0.1