Re: [Gdcm-hackers] want to use gdcm to find pixel data offsets in file
Cross-platform DICOM implementation
Brought to you by:
malat
|
From: Aaron B. <bo...@gm...> - 2011-05-25 22:54:43
|
Thanks, Mark. I would be happy to send you some sample images. We are using Pegasus Pict tools to do the compression. The reason why I don't want to read the files is because I am writing a streaming server. I want to simply send the raw pixel data over a socket, using sendfile to avoid any copying into user space. Thanks again for your help. Aaron On Wed, May 25, 2011 at 5:25 PM, Mark Roden <mm...@gm...> wrote: > Ah, well, it doesn't work with j2k compression because we couldn't get > any files that were j2k compressed and also were compressed via > subregions. All the examples we got compressed the entire image in > one go, which meant that getting just one region would require > decompressing the entire image anyway, so it wouldn't have been > useful. > > Would it be possible to submit your image so we could extend the > functionality of the reader to include this type in the future? > > And out of curiousity, why wouldn't you want the reader to do the > reading? It's what readers do... > > On Wed, May 25, 2011 at 12:01 PM, Aaron Boxer <bo...@gm...> wrote: >> Thanks very much, Mark! This is perfect. >> So, it looks like I could just modify the read method to return the >> offset and size rather than actually >> do the reading. >> >> One complication: the file is going to be streamed in from a NAS, in >> 1 K chunks (chunk size is configurable). >> Also, the files are all JPEG2K compressed. >> >> >> >> On Wed, May 25, 2011 at 2:29 PM, Mark Roden <mm...@gm...> wrote: >>> Hi Aaron, >>> >>> Actually, you can use the gdcmStreamImageReader to read portions of >>> the image at a time. I'm not sure how the frames are stored in your >>> particular image (are they different planes in Z, for instance?). >>> >>> Once you have the header information, you can then use the >>> DefinePixelExtent method to indicate which portion of the image you >>> want. You can take any xyz extent, so x from 0-37, y from 10-23, and >>> z from 4 - 7, for instance. >>> >>> Once that's done, call DetermineProperBufferLength to get the size of >>> the buffer that you will need to create to store the data. This >>> function will take into account number of bytes per pixel and so >>> forth, so if you have an rgb image, with each pixel having 16 bits, >>> then this buffer length will return (x extent*y extent * z extent * >>> 6). >>> >>> Then just call read with the buffer you've made in the previous step, >>> and that subregion will be read in. >>> >>> HTH, >>> Mark >>> >>> On Wed, May 25, 2011 at 11:15 AM, Aaron Boxer <bo...@gm...> wrote: >>>> Hello! >>>> >>>> I want to create a method that will parse a dicom file up until the >>>> pixel data, and then >>>> return the pixel data size and offset in the file. ( I don't want to >>>> read in the pixel data). >>>> If the data is compressed, I just want the offset to the compressed >>>> data. Also, if it is a multi-frame image, I would like a list of all >>>> of the frames, with offset and size. >>>> >>>> Mathieu has kindly pointed me to the gdcmStreamImageReader class. From >>>> a quick look, >>>> it seems that this class will do part of the job. It parses up until >>>> the pixel data, and then >>>> reads the rest of the file in all at once. Can anyone suggest any >>>> existing classes that can >>>> help me to parse a multi-frame object, and get the frame offsets? >>>> >>>> Thanks!! >>>> Aaron >>>> >>>> ------------------------------------------------------------------------------ >>>> vRanger cuts backup time in half-while increasing security. >>>> With the market-leading solution for virtual backup and recovery, >>>> you get blazing-fast, flexible, and affordable data protection. >>>> Download your free trial now. >>>> http://p.sf.net/sfu/quest-d2dcopy1 >>>> _______________________________________________ >>>> Gdcm-hackers mailing list >>>> Gdc...@li... >>>> https://lists.sourceforge.net/lists/listinfo/gdcm-hackers >>>> >>> >> > |