how to save dicom file to a buffer

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
7554753
Posts: 11
Joined: Tue, 2008-07-15, 05:38

how to save dicom file to a buffer

#1 Post by 7554753 »

in the storescp source code, i look into the storeSCPCallback function, it use cbdata->dcmff->saveFile(fileName.c_str(), xfer, EET_ExplicitLength, EGL_recalcGL, EPD_withoutPadding, OFstatic_cast(Uint32, 0), OFstatic_cast(Uint32, 0), false) to save the data into a file, so then how to save the data into a buffer?
i tried below
unsigned char *streambuffer = new Byte[streamsize];
DcmOutputBufferStream * outputStream = new DcmOutputBufferStream(streambuffer, streamsize);
cbdata->dcmff->write(*outputStream, xfer, EET_ExplicitLength, EGL_recalcGL, EPD_withoutPadding, OFstatic_cast(Uint32, 0), OFstatic_cast(Uint32, 0), OFstatic_cast(Uint32, 0));
but how to know the streamsize?

Post Reply

Who is online

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