dcm4che encountered Unsupported JPEG process: SOF type 0xc3 when converting JPG images

environment

OS: win10 64 bit JDK version: 1.8 64 bit

code

import java.io.File;
import java.io.IOException;
public class Dcm2JpgTest {
    public static void main(String[] args) throws IOException {
    try{
            File src = new File("d:\\Test.dcm");
            File dest = new File("d:\\Test.jpg");           
            Dcm2Jpeg dcm2jpg= new Dcm2Jpeg();           
            dcm2jpg.convert(src, dest);         
            System.out.println("Completed");
        } catch(IOException e){ 
            e.printStackTrace();

        } catch(Exception e){
            e.printStackTrace();
        }
    }
}

jar package reference

The following jar package is not in the maven library, the latest maven is 5, but that seems to have a problem

  1. dcm4che-tool-dcm2jpg-2.0.23.jar
  2. dcm4che-core-2.0.23.jar
  3. dcm4che-image-2.0.23.jar
  4. dcm4che-imageio-2.0.23.jar
  5. dcm4che-imageio-rle-2.0.23.jar
  6. slf4j-log4j12-1.5.0.jar
  7. slf4j-api-1.5.0.jar
  8. log4j-1.2.13.jar
  9. commons-cli-1.2.jar

Error solution

The core key is to install the jai_imageio library:

  1. Install 32-bit JDK
  2. Install jai_imageio-1_0_01-lib-windows-i586-jdk to 32-bit JDK
  3. Switch the java runtime environment to 32-bit JDK

Remarks: According to the official installation instructions of dcm4chee, dcm4chee and dcm4che2-tools can successfully complete dcm compression and decompression in Linux32bits, Linux64bits, and Windows32bits, but the Windows64bits environment cannot be used, and the 32-bit environment is the problem.

refer to

The article of the csdn blogger zssure

How to convert dicom file to jpg conversion

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324376935&siteId=291194637