OpenCV J2KR compression

174 views
Skip to first unread message

Lutrero

unread,
Jan 15, 2019, 8:07:25 AM1/15/19
to dcm4che
Hello

I am trying to change the codecs on dcm4che to use opencv writer for JPEG2000 but I always get this error: java.lang.IllegalArgumentException: org.dcm4che3.opencv.J2kImageWriteParam.setWriteCodeStreamOnly(boolean)
Am I doing something wrong? With the reader works perfectly.

Thank's for your patience. Best regards. Luis





Nicolas Roduit

unread,
Jan 16, 2019, 1:49:51 PM1/16/19
to dcm4che
It will help to answer if you start by explaining how you try to use it. 

Currently, only the JPEG-LS encoder with OpenCV is activated by default.

The other encoders still need to be validated, here is the configuration of ImageWriterFactory.properties:

1.2.840.10008.1.2.4.50:jpeg-cv:org.dcm4che3.opencv.NativeJPEGImageWriter::mode=0;quality=90
1.2.840.10008.1.2.4.51:jpeg-cv:org.dcm4che3.opencv.NativeJPEGImageWriter::mode=1;quality=90
1.2.840.10008.1.2.4.53:jpeg-cv:org.dcm4che3.opencv.NativeJPEGImageWriter::mode=2;quality=90
1.2.840.10008.1.2.4.55:jpeg-cv:org.dcm4che3.opencv.NativeJPEGImageWriter::mode=3;quality=90
1.2.840.10008.1.2.4.57:jpeg-cv:org.dcm4che3.opencv.NativeJPEGImageWriter::mode=4;prediction=6;pointTransform=0
1.2.840.10008.1.2.4.70:jpeg-cv:org.dcm4che3.opencv.NativeJPEGImageWriter::mode=4;prediction=1;pointTransform=0
1.2.840.10008.1.2.4.80:jpeg-ls-cv:org.dcm4che3.opencv.NativeJLSImageWriter::
1.2.840.10008.1.2.4.81:jpeg-ls-cv:org.dcm4che3.opencv.NativeJLSImageWriter::nearLossless=2
1.2.840.10008.1.2.4.90:jpeg2000-cv:org.dcm4che3.opencv.NativeJ2kImageWriterSpi::lossless=true
1.2.840.10008.1.2.4.91:jpeg2000-cv:org.dcm4che3.opencv.NativeJ2kImageWriterSpi::lossless=false;quality=90

You can customize with a new file: -Dorg.dcm4che3.imageio.codec.ImageWriterFactory=file:///path//ImageWriterFactory.properties
Reply all
Reply to author
Forward
0 new messages