|
From: Mathieu M. <mat...@gm...> - 2015-03-11 13:50:08
|
Mohica, On Tue, Mar 10, 2015 at 3:13 PM, Mohica Jasha <moh...@gm...> wrote: > I wonder if it is possible to use the gdcm command line tools to > convert dicom object to jpg or png files. > > > I tried to convert JLSL/CT1_JLSL download from from > ftp://medical.nema.org/medical/dicom/DataSets/WG04/compsamples_jpegls.tar > to jpg/png but gdcmimg fails: > > ~/gdcm/gdcm-build/bin/gdcmimg -i ~/nema-images/IMAGES/JLSL/CT1_JLSL -o test.pnm > Problem writing PNM file > > the transfer syntax of the dicom file is [1.2.840.10008.1.2.4.80] > (JPEG-LS Lossless Image Compression) The GDCM command line tools may be too low level for you. Anyway if you really want to extract the image portion of a DICOM Instance, you can do that in two steps: $ gdcmconv --raw CT1_JLSL CT1_JLSL_raw.dcm $ gdcmimg CT1_JLSL_raw.dcm CT1_JLSL_raw.dcm.pgm gdcmimg can only un-encapsulate raw input. If you want to de-encapsulated compressed dicom stream, you need to use gdcmraw: http://gdcm.sourceforge.net/2.4/html/gdcmraw.html DCMTK tool will be able to apply the windows-level LUT if this what you are looking for. Within gdcm you can use gdcm2vtk to render a DICOM instance into PNG. |