Bug #845
closedcompression followed by decompression can lead to inconsistent datasets
100%
Description
Class DcmPixelData in dcmdata can store multiple "versions" of the pixel data element, one for each combination of transfer syntax and representation parameter.
Unfortunately in some cases, a modification of the DICOM header and a modification of the raw pixel data is required when compressing an image (e.g. extraction of embedded overlays prior to lossy compression). When such an image is first compressed and then decompressed by the same application (using DcmDataset::chooseRepresentation()), the decoder is not called at all, the header remains unmodified and the original pixel data as it was before compression is re-activated. This may lead to inconsistent objects when changes were applied to the PixelData content prior to compression, because these changes will be lost.
We need a new API call in class DcmPixelData that can be called by the various compression encoders in order to "invalidate" all representations of the pixel data other than the current (compressed) one. This will force dcmdata to use the decoder when access to uncompressed pixel data is requested, thus leading to a consistent dataset.