Re: [Gdcm-hackers] want to use gdcm to find pixel data offsets in file
Cross-platform DICOM implementation
Brought to you by:
malat
|
From: Mark R. <mm...@gm...> - 2011-05-25 18:29:16
|
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 > |