Decompressing large files

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
liuxinming
Posts: 83
Joined: Thu, 2009-03-19, 04:19

Decompressing large files

#1 Post by liuxinming »

In order to get some special frames of a large file, I used DcmDataset::chooseRepresentation, then DcmPixelData::getUncompressedFrame. But I didn' t want to decompress the whole file.
By the way, when decompressing large files, DcmDataset::chooseRepresentation sometimes failed, such as "Virtual Memory exhausted".
What shall I do then?

J. Riesmeier
DCMTK Developer
Posts: 2501
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Decompressing large files

#2 Post by J. Riesmeier »

Calling chooseRepresentation() with e.g. EXS_LittleEndianExplicit decompresses the entire pixel data of the dataset, so you should call getUncompressedFrame() only, which does exactly what you want.

liuxinming
Posts: 83
Joined: Thu, 2009-03-19, 04:19

Re: Decompressing large files

#3 Post by liuxinming »

J. Riesmeier wrote:which does exactly what you want
I want to save several frames of the large file into another file with the same transfer syntax as the original file.

So what i' ve done were:
1. Using the getUncompressedFrame to get the frames one by one.
2. Putting the frame datas into a buffer which was dynamically allocated before.
3. Using the putAndInsertUint8Array in order to put the frame datas into the dataset.
4. Calling the saveFile to impletement the last procedure.

But the file which was generated was abnormal(Its background was green!).The transfer syntax of the original file was EXS_JPEGProcess1.
I' m not good at image compressing. :)

Post Reply

Who is online

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