Discussion Forum for OFFIS DICOM Tools - For registration, send email with desired user name to the OFFIS DICOM team
It is currently Tue, 2018-09-25, 00:59

All times are UTC + 1 hour

Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Fri, 2014-09-12, 11:25 

Joined: Fri, 2014-09-12, 08:21
Posts: 1
Using DCMTK 3.6.0 with JP2K extension.

We use Icon Image Sequence tag to store a thumbnail of the image stored in Pixeldata tag. If the Image is an RGB the Icon image Sequence contains RGB Palette Color Image. If the image is MONOCHROME the Icon Image Sequence contains a MONOCHROME image.

This we have done for many years using DeflatedLitteEndian as TransferSyntax.

But, now whe are implementing JPEG and JP2K and get an error "Pixel representation cannot be changed" when doing chooseRepresentation using EXS_JPEG2000LosslessOnly,EXS_JPEGProcess14SV1TransferSyntax or EXS_JPEG2000 AND the Icon Image Sequence tag contains an RGB Palette color image.

It works if we convert the Icon Image Sequence image to MONOCHROME.

We insert the Palette Color image in Icon Image Sequence like this: (scaled contains the scaled version of PixelData image)
res = DcmQuant::createPaletteColorImage(*scaled, *ditem, OFFalse, OFFalse, OFFalse, 256, description );

And the monochrome like this:
DicomImage *mono = scaled->createMonochromeImage();
worked = mono->writeImageToDataset(*ditem);

I found the following commenct in dcpixel.cc:
/* determine if the pixel data is captured in native (uncompressed) or encapsulated
* (compressed) format. We only derive this information from the length field
* which is set to undefined length for encapsulated data because even in
* compressed transfer syntaxes the Icon Image Sequence may contain an
* uncompressed image.

I know that all the DcmPixelData Tags in a DcmDataset has to be the same transfer syntax, but isn├Ąt that the meaning with chochooseRepresentation to do that?

Any workaround?

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group