tags:

views:

85

answers:

2

I am trying to use the DCMJ2PNM binary from the DCMTK toolkit to convert a DICOM file to a set of BMPs. I am using the following command:

  dcmj2pnm +Fa +ob test.dcm .\frames\test_

I keep getting the error "cannot change to unencapsulated representation for pixel data". Does anyone know what I can do to process this image?

A: 

The error is implying that your test.dcm file is a compressed DICOM file. Looking at the manual page for the tool here, it implies the tool supports decompressing JPEG and RLE images. Do you know what format/transfer syntax your file is encoded as? It sounds like it may be encoded in a transfer syntax other than JPEG or RLE. You can use the dcmdmp utility to list the contents of the file and see the transfer syntax.

Steve Wranovsky
I ran DCMDUMP on that file it tells me that the transfer syntax is "JPEGBaseline" (0002,0010) UI =JPEGBaseline
kartikq
From the documentation of the tool, it appears this should work. Another option would be to first decompress the image using the dcmdjpeg tool. Could you try that?
Steve Wranovsky
A: 

You can also use GDCM. Simply run:

gdcmconv --raw test.dcm test-raw.dcm

GDCM handles decompressing from JPEG, JPEG-LS, JPEG 2000 and RLE. This is transparent to the user, you don't even need to know the encapsulation mechanism used.

HTH

ref: http://gdcm.sourceforge.net/html/gdcmconv.html

malat