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

DicomImageReader for large (>3Gb) US (UltrasoundMultiFrameImageStorage) can not extract all the images (for frames above ~1500 is not working) #1431

Open
czibula-istvan opened this issue May 8, 2024 · 0 comments

Comments

@czibula-istvan
Copy link

Hi,
I have a large (>3Gb) UltrasoundMultiFrameImageStorage dicom file, containing over 2000 image frames.
When i try to retrieve the BufferedImages for the first ~1000 frames it's working fine but for larger frame numbers an exception is thrown:
java.lang.IndexOutOfBoundsException: pos < flushedPos!
at java.desktop/javax.imageio.stream.FileImageInputStream.seek(FileImageInputStream.java:143)
at org.dcm4che3.imageio.plugins.dcm.DicomImageReader.readRaster(DicomImageReader.java:395)
at org.dcm4che3.imageio.plugins.dcm.DicomImageReader.read(DicomImageReader.java:465)

I think the problematic line in this case is in DicomImageReader class the method readRaster:
iis.seek(pixelData.offset() + frameIndex * frameLength);

In my case:
frameIndex = 1492
frameLength = 1440000
The multiply will cause an integer owerflow add the position will be negative.

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

1 participant