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?
Decompressing large files
Moderator: Moderator Team
-
- DCMTK Developer
- Posts: 2512
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: Decompressing large files
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.
-
- Posts: 83
- Joined: Thu, 2009-03-19, 04:19
Re: Decompressing large files
I want to save several frames of the large file into another file with the same transfer syntax as the original file.J. Riesmeier wrote:which does exactly what you want
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.
Who is online
Users browsing this forum: Ahrefs [Bot] and 1 guest