[Insight-users] convert unsign int pixel type dicom file into MetaImage with gdcm

Mathieu Malaterre mathieu.malaterre at gmail.com
Wed Apr 29 04:58:29 EDT 2009


Hsiang-Chi,

On Tue, Apr 28, 2009 at 6:39 PM, Hsiang-Chi Kuo <kuoxgx at gmail.com> wrote:
> Hi Luis and Mathieu,
> Sorry to trouble you, but I have been spending a whole month and trying to
> convert a Dicom RT file (unsign int pixel type) to mhd file with very little
> progress.

Sorry to hear that :(

> The Dicom file is a muti fram format with "Grid Frame Offset Vector tag:
> (3004,000C)". I used gdcm (1.2) to read the size, spacing, and origin, and
> pixel data.

I am guessing you are trying to load a RT Dose Storage object, right ?
In which case I have added a minimalist support in CVS ITK:

$ cvs ci -m"ENH: Add minimalist support for z-spacing (derived from
Grid Frame Offset Vector) on RT Dose Storage DICOM object."
src/gdcmFile.cxx
/cvsroot/Insight/Insight/Utilities/gdcm/src/gdcmFile.cxx,v  <--
src/gdcmFile.cxx
new revision: 1.27; previous revision: 1.26


> Then convert the pixel format into MetaImage.
> The line of "  unsigned int *imageData = fh->GetImageDataRaw(); "  output
> the error message: 'initializing' : cannot convert from 'uint8_t *' to
> 'unsigned short *'.

I do not understand this error message.
Anyway the idea behing GDCM 1.x is to load all type of DICOM files
with 7fe0,0010 Pixel Data Element (it does not even inspect the media
storage type -sigh-). So you do not need to do that on your side, why
were you doing that in the first pace anyway  (just out of curiosity)
?

2cts
-- 
Mathieu


More information about the Insight-users mailing list