Dcm2Jpeg - How to convert dcm image to jpg?

143 views
Skip to first unread message

baumgartn...@gmail.com

unread,
Sep 22, 2018, 5:23:25 PM9/22/18
to dcm4che
Can someone please point me into the right direction of how to convert dicom images to jpg with this library? I have tried with several different dicom images but only get errors.
I am downloading a dicom file from a ceph storage cluster and then want to convert it to a jpg, and I have tried like this:

StoredObject downloadFile = container.getObject(id);
downloadFile
.downloadObject(new File("tempDicomFile.dcm"));
 
Dcm2Jpg dcm2Jpg = new Dcm2Jpg();
try{
    dcm2Jpg
.convert(new File("tempDicomFile.dcm"), new File("jpgFile.jpg"));
} catch(IOException ex){
    ex
.getLocalizedMessage();
}

All I am getting is a IOException var23 when it tries to write the image:
try {
   
this.writeImage(ios, bi);
} finally {
   
try {
        ios
.close();
   
} catch (IOException var23) {
       
;
   
}


Any idea what I am doing wrong?

Reply all
Reply to author
Forward
0 new messages