Hello Group members, I am working in loading compressed DICOM file as received from from a remote server using below code.
I want to do two things here:
1. Free/release compressed pixel data after decompression.
2. Is there a way of creating DcmFileformat OR DcmDataset without compressed pixel data allocation.
/* Load compressed DICOM data from network's char* data stream */
DcmInputBufferStream DibStream;
DibStream.setBuffer(buffer, bufferLen);
DibStream.setEos();
OFCondition loadStatus = this->file_format.read(DibStream);
/* Uncompress using DicomImage class*/
DicomImage * dicomImage = new DicomImage(&file_format, file_format.getDataset()->getOriginalXfer() , CIF_UsePartialAccessToPixelData | CIF_DecompressCompletePixelData, 0, 0);
/* store uncompressed pixel data in local variable and delete DicomImage reference */
/* some more code here ... */
delete dicomImage
/* [b]Note: DcmFileformat::file_format is allocated on stack and is cleared on this class's destructor.[/b]*/
/** removes all but the current representation and sets the original
* representation to current
*/
void removeAllButCurrentRepresentations();
Regarding your second question, what do you mean by that? Could you please describe in more detail what the background of your question is.
By the way, why do you use the DicomImage class for decompressing the pixel data? This class is intended to be used for rendering images, i.e. for visualization purposes.