Code Monkey home page Code Monkey logo

Comments (9)

cancan101 avatar cancan101 commented on May 24, 2024

According to the DICOM spec:

Decoders of encapsulated pixel data, whether Single Frame or Multi-Frame, need to accept both an empty Basic Offset Table (zero length) and a Basic Offset Table filled with 32 bit offset values.

and also:

If the object allows multi-frame images in the pixel data field, then each frame shall be encoded separately. Each fragment shall contain encoded data from a single-frame image.

from dicomparser.

cancan101 avatar cancan101 commented on May 24, 2024

Here is a POC fix: https://gist.github.com/cancan101/b888ed5d1163ec954966432c5aa505ae/revisions

from dicomparser.

chafey avatar chafey commented on May 24, 2024

Can you check 1.5.1 to see if this is now fixed? Thanks

from dicomparser.

chafey avatar chafey commented on May 24, 2024

After thinking about this further, I decided to deprecate the readEncapsulatedPixelData() because it does not work properly for multi-frame instances with empty basic offset table. I have added two new functions readEncapsulatedPixelDataFromFragments() and readEncapsulatedImageFrame() which should be used instead. The logic to deal with empty basic offset table instances is now the responsibility of the user of the library. I will be updating cornerstoneWADOImageLoader to use these new APIs and support your use case of empty basic offset table mutli-frame ultrasound. Feedback welcome!

from dicomparser.

cancan101 avatar cancan101 commented on May 24, 2024

Right now I am using:

const image = await cornerstone.loadAndCacheImage(
  `${this.imageId}?frame=${this.frameIndex}`
);
this.stack[this.frameIndex] = image;
cornerstone.displayImage(this.node, this.stack[this.frameIndex]);

and I am using the cornerstoneWADOImageLoader, so I guess it will just work for me?

from dicomparser.

chafey avatar chafey commented on May 24, 2024

Not until I update cornerstoneWADOImageLoader to use the new functions(). If you want to try it out, change decodeJPEGBaseline8bit.js line 38 to:
var encodedPixelData = dicomParser.readEncapsulatedPixelDataFromFragments(dataSet, dataSet.elements.x7fe00010, frame);

from dicomparser.

chafey avatar chafey commented on May 24, 2024

OK get latest dicomParser and cornerstoneWADOImageLoader and let me know how it goes

from dicomparser.

chafey avatar chafey commented on May 24, 2024

cancacn101 - did this resolve your issue?

from dicomparser.

cancan101 avatar cancan101 commented on May 24, 2024

Yes.

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.