Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading JPEG2000Loseless data #264

Open
syedkibrahim opened this issue Jan 8, 2024 · 1 comment
Open

Reading JPEG2000Loseless data #264

syedkibrahim opened this issue Jan 8, 2024 · 1 comment

Comments

@syedkibrahim
Copy link

We are trying to read a 16-bit JPEG2000Loseless type (Transfer Syntax ID - 1.2.840.10008.1.2.4.90).

Using DicomParser we saw that this file is having encapsulatedPixelData: true.
294477784-ecc4e4eb-1156-4e43-aa08-ba498ef68a89

Is there any way we can determine if the arrayBuffer contains compressed data or decompressed data ?
And if it is compressed data then is there a method to decompress it before proceeding further ?

Any inputs or help will be really appreciated, thanks.

@yagni
Copy link
Collaborator

yagni commented Jan 8, 2024

It's compressed since it has the transfer syntax UID you listed (otherwise it would have one of the more traditional transfer syntaxes, like explicit VR little endian).

As far as decompressing goes, you'll need to find another library to do JPEG2000 decompression for you. Each fragment in your dicomParser dataset has a position and a length; you can pass the range of bytes defined by those numbers to the JPEG2000 library to decompress (here's a StackOverflow that might help). If you have multiple fragments, you'll need to recombine them after decompressing each one individually.

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

No branches or pull requests

2 participants