Discussion Forum for OFFIS DICOM Tools - For registration, send email with desired user name to the OFFIS DICOM team
It is currently Sun, 2018-06-24, 19:35

All times are UTC + 1 hour

Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Wed, 2017-09-13, 04:03 

Joined: Fri, 2010-06-18, 06:14
Posts: 12
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);
   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]*/

Thank you
Abhishek Gupta.

PostPosted: Thu, 2017-09-14, 10:35 
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1939
Location: Oldenburg, Germany
Regarding your first question, the following method (from DcmDataset or DcmFileFormat) might provide what you want:

    /** 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.

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

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