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

error while trying to decompress multiframe rgb file (w and h must be > 0) #1407

Open
SaluRamos opened this issue Mar 19, 2024 · 0 comments
Open

Comments

@SaluRamos
Copy link

SaluRamos commented Mar 19, 2024

Describe the bug
error:

java.lang.IllegalArgumentException: w and h must be > 0
	at java.desktop/java.awt.image.Raster.createInterleavedRaster(Raster.java:214)
	at java.desktop/java.awt.image.ComponentColorModel.createCompatibleWritableRaster(ComponentColorModel.java:2827)
	at weasis.core.img@4.8.1/org.weasis.opencv.op.ImageConversion.toBufferedImage(ImageConversion.java:76)
	at weasis.core.img@4.8.1/org.weasis.opencv.op.ImageConversion.toBufferedImage(ImageConversion.java:120)
	at dcm4che.imageio.opencv@5.31.2/org.dcm4che3.opencv.NativeImageReader.read(NativeImageReader.java:252)
	at dcm4che.imageio@5.31.2/org.dcm4che3.imageio.plugins.dcm.DicomImageReader.readRaster(DicomImageReader.java:375)

To Reproduce

String filepath = "path to file";
try (DicomInputStream dis = new DicomInputStream(new File(filepath))) {
        try (ImageInputStream iis = ImageIO.createImageInputStream(dis)) {
            this.reader.setInput(iis, true);
            ImageReadParam param = this.reader.getDefaultReadParam();
            Raster raster = this.reader.readRaster(0, param); //error here
            int[] pixels = raster.getPixels(0, 0, raster.getWidth(), raster.getHeight(), (int[]) null);
            int pixelIndex = 0;
                for (int x = 0; x < this.frameSetVolume.width; x++) {
                    for (int y = 0; y < this.frameSetVolume.height; y++) {
                        //does something with pixeldata
                        pixelIndex += 3;
                    }
                }
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}

Expected behavior
read compressed pixelData

i was unable to link file here:
https://wetransfer.com/downloads/9ab5f66922b7b18acbefc437b6eb4be720240319202957/69f1f4e7dceccd8c4f85b5f8d7cf20ad20240319203032/129f57?trk=TRN_TDL_01&utm_campaign=TRN_TDL_01&utm_medium=email&utm_source=sendgrid

or

https://drive.google.com/file/d/14Kb-9p6ZxcDCkIpBVrx95b0-DbMogN1K/view?usp=drive_link

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