dcm2dcm : No Reader for format: jpeg-cv registered

1,302 views
Skip to first unread message

harithacha...@gmail.com

unread,
Apr 26, 2021, 9:47:14 AM4/26/21
to dcm4che
I am trying to decompress DICOM image. 
It is working fine in eclipse ,

when i package it as jar , it is throwing this error :

No Reader for format: jpeg-cv registered

i have also added opencv.dll to the library path, despite that it is throwing error.

Can anyone please help solve this issue.

Thanks,
Haritha C Mouli

Tatsunidas

unread,
Apr 30, 2021, 6:04:24 PM4/30/21
to dcm...@googlegroups.com
Did you add the option "-Djava.library.path="path/to/opencv_java.dll dir" when you executed jar?
Example, if you use win10 64bit, and dcm4che libs with your jar in the same folder, -Djava.library.path="./dcm4che-5.23.2/lib/windows-x86-64").
dcm4che Decompressor/Compressor automatically loads opencv native libraries at that dir.

I hope this helps.

tatsuaki

2021年4月26日(月) 22:47 harithacha...@gmail.com <harithacha...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "dcm4che" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dcm4che+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dcm4che/4b63e3cd-f2b0-46c8-8326-60c9fe478096n%40googlegroups.com.


--
==========================================
Tatsuaki KOBAYASHI
TEL:080-1274-6433
Good Luck
==========================================

davidm...@gmail.com

unread,
May 3, 2021, 10:02:19 AM5/3/21
to dcm4che
Hi Haritha,
What environment are you running in?

I am having a similar problem in the context of a web application.  All the docs say set the java.library.path system variable to a directory and put your shared-lib files there, as tatsuaki says.  I have been unable to get this to work with a webapp on Ubuntu 20, openjdk8, and tomcat9. I am taking code from dcm2dm 5.23.2 and putting it in a web application. The library is just not found there. At least in my environment, the default value in java.library.path includes '/usr/lib'.  I have had some success if I do not override java.library.path and put the native lib in '/usr/lib'.  This is suboptimal because installing the software now includes mucking in global system filespace.  I would love to hear if anyone has any insight into what is going on.

Best regards,
Dave

Krzysztof Polak

unread,
Jun 1, 2021, 7:02:19 AM6/1/21
to dcm4che
I was having the same problem. My app worked fine when running in intelij but after i compressed it to jar with dependencies i got No Reader for format: jpeg-cv registered error. In my project i use dcm4che-imageio-rle and dcm4che-imageio-opencv modules. Both of them introduces new javax.imageio.spi.ImageReaderSpi extensions and its locations can be found in META_INF\services\javax.imageio.spi.ImageReaderSpi file. During jar creation those files are copied aswell  and one of them is getting overridden. Solution is to merge those files.

org.dcm4che3.opencv.NativeJLSImageReaderSpi
org.dcm4che3.opencv.NativeJPEGImageReaderSpi
org.dcm4che3.opencv.NativeJ2kImageReaderSpi

Adding these lines to META_INF\services\javax.imageio.spi.ImageReaderSpi  inside my jar fixed problem.

Reply all
Reply to author
Forward
0 new messages