FAQ #20: Error "cannot change to unencapsulated representation for pixel data"

Frequently Asked Questions regarding DCMTK

Moderator: FAQ Team

Post Reply
Message
Author
Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

FAQ #20: Error "cannot change to unencapsulated representation for pixel data"

#1 Post by Jörg Riesmeier »

:?: Using the "DicomImage" class to handle DICOM images I get the following error message when accesing the pixel data:
ERROR: cannot change to unencapsulated representation for pixel data

:!: It seems that the image is compressed. If it uses a JPEG compression scheme you need to register the JPEG decompressor code:
  • add '#include "djdecode.h"' to your source file
  • call 'DJDecoderRegistration::registerCodecs();' at program init
  • call 'DJDecoderRegistration::cleanup();' before program exit
That should be all you need to do. See Doxygen documentation for details.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest