How to use dcm4che with ImageIO

372 views
Skip to first unread message

Kevin Casey

unread,
Mar 14, 2016, 5:26:03 PM3/14/16
to dcm4che
Hi all, I am new to dcm4che and indeed Java as well.

I have a Java BufferedImage object which I need to save to the local file system as a dicom image. I was trying to use dcm4che 2 but ran into issues getting JAI to work on my system. I switched to dcm4che 3 because the JAI jar is included in the distribution. However, now when I output:

ImageIO.getWriterFormatNames()

I don't have any "dicom" or "dcm" options listed. This was working using dcm4che 2. I have the dcm4che-imageio-3.x.x.jar in my class path, and I added the included dll files to my Windows PATH. This a 64-bit Windows installation, if that makes any difference.

If someone could suggest a simple way to save a BufferedImage as a dicom file, I would be very grateful.

Hermann Czedik-Eysenberg

unread,
Mar 15, 2016, 12:11:39 PM3/15/16
to dcm4che
Hi Kevin,

JAI will not work on Windows 64-bit, unless you use a 32-bit JVM. See http://stackoverflow.com/questions/5207145/jai-and-imageio-for-64-bit-windows

But if you want to save your BufferedImage as an uncompressed DICOM file there should be no reason to use JAI.

Hermann

Dimitri Pianeta

unread,
Mar 15, 2016, 1:52:56 PM3/15/16
to dcm4che
I understand why jpeg 2000 does not work on 64 bit Windows. 
There are on solution for 64 bits else put JVM in 32 bits for Java 8.

Kevin Casey

unread,
Mar 15, 2016, 4:41:56 PM3/15/16
to dcm4che
Hi Hermann,

Can you elaborate on your second statement? As I said, I am new to dcm4che and Java, and having difficulties. Should I forget ImageIO altogether and try to use DicomOutputStream?

thanks
Reply all
Reply to author
Forward
0 new messages