|
From: Mathieu M. <mat...@gm...> - 2015-03-11 15:55:19
|
On Wed, Mar 11, 2015 at 4:35 PM, Mohica Jasha <moh...@gm...> wrote: [...] > However it doesn't work on that CT1_JLSL.dcm > > I wonder if there is any way to make it work against CT1_JLSL.dcm. How > can I convert signed representation to unsigned if this is what makes > it failed Yes, see below: > [root@localhost ~]# gdcminfo CT1_JLSL_raw.dcm [...] > PixelRepresentation:1 [...] > Thank you very much in advance So indeed the dataset is signed, and thus it is illegal to store the data stream as PGM. Since your request is very far from being descriptive, you can always do something as dumb as: gdcmraw CT1_JLSL.dcm tmp.jls gdcmimg tmp.jls tmp.jls.dcm gdcmconv --raw tmp.jls.dcm tmp.raw.dcm gdcmimg tmp.raw.dcm tmp.raw.pgm -> There you go, you have a valid 16bits PGM file which represent your initial image. You can even do a round-trip to check GDCM is not corrupting the Pixel Data: gdcmimg --sign 1 tmp.raw.pgm tmp.raw.pgm.dcm gdcmviewer tmp.raw.pgm.dcm (or use any other valid DICOM viewer to check), or simply: `gdcminfo --md5sum tmp.raw.pgm.dcm` if you are keen on command line tools. HTH |