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?