Code Monkey home page Code Monkey logo

Comments (5)

chafey avatar chafey commented on May 25, 2024

Hi Nicolas,

I just checked and readEncapsulatedPixelData() is working fine for me in the minified version. Are all the other dicomParser functions working fine? Maybe do a console.log(dicomParser) and check to make sure the function is in there. This is very mysterious.

The use case behind the readEncapsulatedPixelData () API was to access a single image frame from a multi-frame instance and that is why you must specify the frameIndex.

readEncapsulatedPixelData() will return the frame requested by frameIndex, I am not sure if that is what you mean by "frame of interest".

dicomParser has no API to return all frames at once. You can get all frames by iterating over the # of frames yourself and call readEncapsulatedPixelData() for each frame and do whatever you want with it - thats just 3 lines of code.

For cornerstone I decided to use the DICOM P10 instance in memory and pull frames out "on demand". This seems to work well for that use case with the only caveat being that it doesn't integrate well with cornerstone's imageId based caching mechanism. Rather than splitting the DICOM P10 into separate frames, my preference is to make the caching mechanism more flexible, I just haven't had time to do that yet. If you have a MF instance with JPEG2000 frames in it, I could see a benefit to decompressing all frames and caching them in memory rather than decompressing them on use. I am not sure what you are trying to do so can't say what is the best approach for you.

from dicomparser.

NicolasRannou avatar NicolasRannou commented on May 25, 2024

Thanks for the heads up -

I will double check it but as far as I remember when I tried to do a console.log(dicomParser) , it was only showing the parseDicom function.

I am importing dicomParser via npm ("dicom-parser": "1.0.2") and using it with browserify.

I'll also try without NPM and keep you posted.

from dicomparser.

chafey avatar chafey commented on May 25, 2024

Ahh yes, someone else reported that not all code was being exported via NPM and even submitted PR #17 with a fix, but I didn't accept it because it exposed all the internals. If someone wants to submit an updated PR with just the public API I'll accept it.

from dicomparser.

chafey avatar chafey commented on May 25, 2024

This should now be fixed, try getting the latest

from dicomparser.

NicolasRannou avatar NicolasRannou commented on May 25, 2024

Perfect it works as expected now! Thanks!

from dicomparser.

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.