Can't convert some DCM files anymore

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
schtorch
Posts: 12
Joined: 2013-05-16T11:21:04-07:00
Authentication code: 6789

Can't convert some DCM files anymore

Post by schtorch »

Hi,

I have updated to ImageMagick-6.8.8-2 from 6.8.7-10 and I have problems converting from some DCM images. It is working with the same file with the previous version. Maybe an openjpeg problem, because DCM supports some JPEG-2000 version and the delegate result changed from jp2 to openjp2.

Code: Select all

convert test.dcm test.jpg
convert: no decode delegate for this image format `/tmp/magick-8831hGUD43ObSqqV' @ error/constitute.c/ReadImage/555.
convert: no images defined `test.jpg' @ error/convert.c/ConvertImageCommand/3147.

Code: Select all

./configure --enable-hdri --disable-shared --without-magick-plus-plus  --with-wmf --with-webp
from version that is not working:

Code: Select all

DELEGATES       = bzlib mpeg fontconfig freetype jng jpeg lcms lzma openexr openjp2 pango png ps tiff webp wmf x xml zlib
from working version:

Code: Select all

DELEGATES       = bzlib mpeg fontconfig freetype jng jp2 jpeg lcms lzma openexr pango png ps tiff webp wmf x xml zlib
from both versions:

Code: Select all

# convert -list format | grep DCM
      DCM* r--   Digital Imaging and Communications in Medicine image
It would be great if you could give me an idea what the problem is.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Can't convert some DCM files anymore

Post by magick »

Post a URL so we can download your image and try to reproduce the problem. Once we can reproduce the problem, we'll post here with a solution.
schtorch
Posts: 12
Joined: 2013-05-16T11:21:04-07:00
Authentication code: 6789

Re: Can't convert some DCM files anymore

Post by schtorch »

Can't post that file due to privacy (DCM files are used in the medicine a lot), but I found a file in the Internet that shows the same (technical) symptoms.

The file I checked with is called:
comp90_v3.dcm

https://drive.google.com/folderview?id= ... sp=sharing
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Can't convert some DCM files anymore

Post by dlemstra »

We can reproduce the problem you posted and have a patch in ImageMagick 6.8.8-4 Beta, available by sometime tomorrow. Thanks.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
schtorch
Posts: 12
Joined: 2013-05-16T11:21:04-07:00
Authentication code: 6789

Re: Can't convert some DCM files anymore

Post by schtorch »

This is incredible fast! Thanks a bunch!
schtorch
Posts: 12
Joined: 2013-05-16T11:21:04-07:00
Authentication code: 6789

Re: Can't convert some DCM files anymore

Post by schtorch »

I just checked with the released version 6.8.8-4 and unfortunately it is still not working for me and I get the same error.

It seems to me it was an JPEG-2000 problem.

When doing a configure (same lines as in original post), I get the following output, leaving JPEG-2000 empty instead of "no" or "yes"

Code: Select all

JBIG              --with-jbig=yes               no
JPEG v1           --with-jpeg=yes               yes
JPEG-2000         --with-jp2=yes
LCMS v1           --with-lcms=yes               yes
LCMS v2           --with-lcms2=yes              no
It seems I can't convert (some) JPEG-2000 images with the new version. Example taken from:
http://www.microimages.com/gallery/jp2/

The following is working on 6.8.7-10 but not on 6.8.8-4

Code: Select all

ImageMagick-6.8.8-4 # convert CB_TM432.jp2 test.jpg
convert: no decode delegate for this image format `CB_TM432.jp2' @ error/constitute.c/ReadImage/555.
convert: no images defined `test.jpg' @ error/convert.c/ConvertImageCommand/3147.
The following is working on the same machine:

Code: Select all

# opj_decompress -i CB_TM432.jp2 -o image.pgm

[INFO] Start to read j2k main header (85).
[INFO] Main header has been correctly decoded.
[INFO] No decoded area parameters, set the decoded area to the whole image
[INFO] Header of tile 0 / 0 has been read.
[INFO] Tile 1/1 has been decoded.
[INFO] Image data has been updated with tile 1.

[INFO] Stream reached its end !
WARNING -> [PGM file] Only the first component
           is written to the file
Generated Outfile image.pgm
Would you mind to take a look again? Is it my installation and I'm missing some libs or did the fix not fix the problem?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Can't convert some DCM files anymore

Post by fmw42 »

JPEG-2000 --with-jp2=yes
That was for jasper, I believe. Look and see if you have an entry for OpenJpeg or OpenJP2.
schtorch
Posts: 12
Joined: 2013-05-16T11:21:04-07:00
Authentication code: 6789

Re: Can't convert some DCM files anymore

Post by schtorch »

Ah, yes, I have it, but it does not work...

Code: Select all

OpenEXR           --with-openexr=yes            yes
OpenJP2           --with-openjp2=yes            yes
PANGO             --with-pango=yes              yes
PERL              --with-perl=no                no

Code: Select all

CXX             = g++
  CXXFLAGS        = -g -O2 -pthread
  FEATURES        = DPC OpenMP
  DELEGATES       = bzlib mpeg fontconfig freetype jng jpeg lcms lzma openexr openjp2 pango png ps tiff webp x xml zlib
But the following lines do not give any result:

Code: Select all

ImageMagick-6.8.8-4 # convert -list format | grep jp2
ImageMagick-6.8.8-4 # convert -list delegate | grep openjp2
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Can't convert some DCM files anymore

Post by magick »

Try
  • convert -list format | grep JP2
    J2K* JP2 rw- JPEG-2000 Code Stream Syntax (2.0.0)
    JP2* JP2 rw- JPEG-2000 File Format Syntax (2.0.0)
    JPC* JP2 rw- JPEG-2000 Code Stream Syntax (2.0.0)
    JPT* JP2 rw- JPEG-2000 File Format Syntax (2.0.0)
schtorch
Posts: 12
Joined: 2013-05-16T11:21:04-07:00
Authentication code: 6789

Re: Can't convert some DCM files anymore

Post by schtorch »

This is empty as well. Should be somewhere here I guess:

Code: Select all

JNG* rw-   JPEG Network Graphics
           See http://www.libpng.org/pub/mng/ for details about the JNG
           format.
      JNX* r--   Garmin tile format
     JPEG* rw-   Joint Photographic Experts Group JFIF format (62)
      JPG* rw-   Joint Photographic Experts Group JFIF format (62)
     JSON  -w+   The image format and characteristics
Post Reply