Git Product home page Git Product logo

Comments (11)

heyflynn avatar heyflynn commented on July 18, 2024 2

fantastic!

I missed the part about dynamic-imports from cornerstoneWadoImageLoader for upgrading to 4.0. Adding the alias for dynamic imports and adding CopyWebpackPlugin to copy to the build folder solved my last issue.

My examples are working using streaming-wadors now.

Thanks for your help.

from cornerstone3d.

sedghi avatar sedghi commented on July 18, 2024

Hmmm, so was it working with the VOLUME as type you are saying? As the error says you need to pass in the cornerstone to the cornerstoneWADOImageLoader, similar to what we do here

from cornerstone3d.

heyflynn avatar heyflynn commented on July 18, 2024

what I mean is that the examples don't ever use streaming-image-volume-loader.

in the all the volume examples, the function createImageIdsAndCacheMetaData is called with an upper case string 'VOLUME'

in the examples createImageIdsAndCacheMetaData is called with type parameter as 'VOLUME' (upper case string ) that is evaluated against the constant VOLUME which is 'volume' (lower case).

const prefix = type === VOLUME ? 'streaming-wadors:' : 'wadors:';

will always be set to 'wadors:'

if I set the createImageIdsAndCacheMetaData to 'volume' then it tries to load images using streaming-wadors.

that's when streaming-image-volume-loader fails with the exception provided above.

I do have cornerstone external initialized properly as you pointed out.

from cornerstone3d.

sedghi avatar sedghi commented on July 18, 2024

I see, yeah this is a bug, but changing the it to volume doesn't give me error.

Basically the difference between wadors and streaming-wadors image loaders is that wadors creates the image object, but in the streaming-wadors which uses SharedArrayBufferImageLoader, it basically goes through the same process just don't create the image object (optimization for speed, since images are inserted into the volume and we don't need the image object basically).

So this subtle bug was creating the image objects but the pixeldata was also inserted into the volume.

How do you run the example that you get the error? Maybe check this out https://www.cornerstonejs.org/docs/tutorials/examples

image

from cornerstone3d.

heyflynn avatar heyflynn commented on July 18, 2024

thanks for looking into it, the problem is with my code then.

I'm using Create React App and I don't think webpack is linking the same cornerstone-wado-image-loader module.

example: sharedArrayBufferImageLoader uses this dynamic import instead of the alias.

https://github.com/cornerstonejs/cornerstone3D-beta/blob/105bd9d97e0df6e67a61c5e13b3393a106ff69d5/packages/streaming-image-volume-loader/src/sharedArrayBufferImageLoader.ts#L7
'cornerstone-wado-image-loader/dist/dynamic-import/cornerstoneWADOImageLoader.min.js';

I tried making an alias for this module but that fails with a different error.

from cornerstone3d.

sedghi avatar sedghi commented on July 18, 2024

Thanks for reporting this bug, now our examples are much faster haha

I expect that the error don't happen if you don't link anything, right? Look into the OHIF webpack (which is basically ejected version of CRA), to see how we are setting the aliases etc.

from cornerstone3d.

selimcanglr avatar selimcanglr commented on July 18, 2024

I currently have the same issue. I've also created my React app with 'create-react-app' and get the same error message. Do you mind sharing how did you add the alias and the CopyWebpackPlugin?

from cornerstone3d.

yanqzsu avatar yanqzsu commented on July 18, 2024

You can refer to here

I currently have the same issue. I've also created my React app with 'create-react-app' and get the same error message. Do you mind sharing how did you add the alias and the CopyWebpackPlugin?

from cornerstone3d.

selimcanglr avatar selimcanglr commented on July 18, 2024

You can refer to here

I currently have the same issue. I've also created my React app with 'create-react-app' and get the same error message. Do you mind sharing how did you add the alias and the CopyWebpackPlugin?

I have already solved the problem on my side. However, CopyWebpackPlugin part in the upgrade guide is outdated and not working anymore as it is. I have created a pull request to fix it.

from cornerstone3d.

heyflynn avatar heyflynn commented on July 18, 2024

You can refer to here

I currently have the same issue. I've also created my React app with 'create-react-app' and get the same error message. Do you mind sharing how did you add the alias and the CopyWebpackPlugin?

I have already solved the problem on my side. However, CopyWebpackPlugin part in the upgrade guide is outdated and not working anymore as it is. I have created a pull request to fix it.

Are you still having a problem with this?

if so, I can create a bootstrap for Create React App and Cornerstone 3D.

from cornerstone3d.

ShitalPP avatar ShitalPP commented on July 18, 2024

I was also getting same error while loading Volume with 'streaming-wadors:' .
As suggested I have added below config in my webpack , so now I am not getting error 'cornerstoneWADOImageLoader requires a copy of Cornerstone to work properly'

resolve: {
alias: {
'cornerstone-wado-image-loader':
'cornerstone-wado-image-loader/dist/dynamic-import/cornerstoneWADOImageLoader.min.js',
},

But Volume not getting loaded properly and getting error , please see attached pic

image4

Thanks

from cornerstone3d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.