Freeing pixel data memory

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
youngn
Posts: 8
Joined: Thu, 2005-01-27, 19:33

Freeing pixel data memory

#1 Post by youngn »

Hi,

I'm using DcmDataset::Load (with default parameters) to load an image file, then using DcmDataset::FindAndGetUint16Array to get the pixel data. When I'm done with the pixel data, I'd like to free the memory associated with it without destroying the DcmDataset object or removing the pixel data element (I might need it again later--I just don't want it to unnecessarily take up memory in the meantime). Is it possible to do this with only the dcmdata library?

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1446
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

#2 Post by Marco Eichelberg »

It is possible to remove the contents of the pixel data element, e.g. by locating the element with DcmItem::search and then calling DcmElement::putUint16Array(NULL, 0). Directly calling DcmItem::putAndInsertUint16Array might also work, although I am not sure if the special case of pixel data is correctly handled in this case. It is not currently possible to release the memory occupied by the pixel data in a way that the next access would automatically reload it from file. In this case you need to delete the dataset and load the complete dataset from file again.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 1 guest