DICOM Multiframe to png or avi

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Locked
JulianLE
Posts: 3
Joined: 2011-01-04T06:32:44-07:00
Authentication code: 8675308

DICOM Multiframe to png or avi

Post by JulianLE »

I'm trying to extract single frames from a DICOM Multiframe-Image, but I get only the first frame. I tried:

convert 1.dcm 1.png
convert 1.dcm[0-10] 1.png
convert 1.dcm[1-10] *.png

Even if i try
convert 1.dcm[10] 1.png
I get only the first frame, never another one.

Is there another syntax, do I need anything else or is it not possible to extract this kind of images with imagemagick? The version is 6.3.2-Q16

Is it possible to convert it directly into avi or mpg?

Thank you very much
Julian

User avatar
magick
Site Admin
Posts: 11254
Joined: 2003-05-31T11:32:55-07:00

Re: DICOM Multiframe to png or avi

Post by magick »

Can you post a URL to your multi-frame DICOM image? We need to reproduce the problem before we can offer any help.

JulianLE
Posts: 3
Joined: 2011-01-04T06:32:44-07:00
Authentication code: 8675308

Re: DICOM Multiframe to png or avi

Post by JulianLE »

I uploaded to example-files to
http://www.sonoline-archiv.de/Files/1.dcm
http://www.sonoline-archiv.de/Files/2.dcm
Another hint: If I change the syntax from
convert 1.dcm 1.png
to
convert 1.dcm[1-10] 1.png
I get just frame 1, but in thumbnail-size.

Thank you for your assistance :-)

User avatar
magick
Site Admin
Posts: 11254
Joined: 2003-05-31T11:32:55-07:00

Re: DICOM Multiframe to png or avi

Post by magick »

Can you verify that 1.dcm is not corrupted? 1.dcm claims to contain 630 600x800 JPEG frames all within 9441132 bytes. We did not have any problems converting 2.dcm:
  • convert 2.dcm frame-%d.png
produced 263 1024x768 frames as expected. We're using ImageMagick version 6.6.6-10.

Jason S
Posts: 103
Joined: 2010-12-14T19:42:12-07:00
Authentication code: 8675308

Re: DICOM Multiframe to png or avi

Post by Jason S »

The 1.dcm file seems to have been truncated around the 230th frame.

With a recent version of ImageMagick, I wasn't able to read any images from it. I tried an older version (6.5.4), and it converted 229 images before reporting the error.

JulianLE
Posts: 3
Joined: 2011-01-04T06:32:44-07:00
Authentication code: 8675308

Re: DICOM Multiframe to png or avi

Post by JulianLE »

Thanks until here, the version 6.6.6-10 works with 2.dcm, the older 6.3.2-9 does'nt, this was the first reason...
The file 1.dcm is obviously corrupted. Interesting is jasons comment, that he could extract images from it with the older version 6.5.4, I tried it, but could'nt reproduce it (immediate app-crash, Vista 64). Some DICOM-readers are able to open this file. If it were possible to make convert more tolerant, so that it works with corrupted files as as long as possible like jason described, this would probably the best.
Nevertheless, thank you all for immediate help, I never found a forum with such quick and individual support!
Jul

Locked