DICOM DCM4CHE压缩异常2:no opencv_java in java.library.path

DCM4CHE压缩可参考:https://blog.csdn.net/m0_37460012/article/details/100110980

异常情况:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no opencv_java in java.library.path
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
	at java.lang.Runtime.loadLibrary0(Runtime.java:870)
	at java.lang.System.loadLibrary(System.java:1122)
	at org.dcm4che3.opencv.NativeJ2kImageWriter.(NativeJ2kImageWriter.java:73)
	at org.dcm4che3.opencv.NativeJ2kImageWriterSpi.createWriterInstance(NativeJ2kImageWriterSpi.java:81)
	at javax.imageio.spi.ImageWriterSpi.createWriterInstance(ImageWriterSpi.java:351)
	at javax.imageio.ImageIO$ImageWriterIterator.next(ImageIO.java:843)
	at javax.imageio.ImageIO$ImageWriterIterator.next(ImageIO.java:827)
	at org.dcm4che3.imageio.codec.ImageWriterFactory.getImageWriterFromImageIOServiceRegistry(ImageWriterFactory.java:245)
	at org.dcm4che3.imageio.codec.ImageWriterFactory.getImageWriter(ImageWriterFactory.java:237)
	at org.dcm4che3.imageio.codec.Compressor.compress(Compressor.java:139)
    ......

解决方式:导入opencv_java.dll到C:\Program Files\Java\jdk1.8.0_201\bin(java环境下)

注意:opencv_java有很多版本,这里需要和dcm4che版本相对应,这里我使用的dcm4che-5.16.1,

可以直接下载dcm4che-5.16.1,然后在lib包下找到对应操作系统,可以从里面获取

DICOM DCM4CHE压缩异常2:no opencv_java in java.library.path_第1张图片

DICOM DCM4CHE压缩异常2:no opencv_java in java.library.path_第2张图片

此外其他版本或操作系统可能会遇到不同的问题,一般来说都是缺少一些文件。比如windows x32下需要

DICOM DCM4CHE压缩异常2:no opencv_java in java.library.path_第3张图片

比如还有:https://blog.csdn.net/zssureqh/article/details/47205951

2019-08-28更新:

今天在另外一台电脑部署服务时,发现导入opencv_java.dll到java下还是报这个错误。调了很久,最后的最后。。。犯了一个低级错误:Java环境配错了。。配歪了!

DICOM DCM4CHE压缩异常2:no opencv_java in java.library.path_第4张图片

应该把JAVA_HOME配置到系统变量中。

DICOM DCM4CHE压缩异常2:no opencv_java in java.library.path_第5张图片

 

你可能感兴趣的:(DICOM)