1gdcmimg(1)                           GDCM                           gdcmimg(1)
2
3
4

NAME

6       gdcmimg - Manipulate DICOM image file.
7

SYNOPSIS

9       gdcmimg [options] file-in file-out
10

DESCRIPTION

12       The gdcmimg command line tool can be used in two fashions:
13
14       · 1. Converting a recognized file format into its encapsulated DICOM
15         counterpart,
16       · 2. Anonymizing a rectangular portion of a DICOM file.

PARAMETERS

18       file-in   input filename
19
20       file-out  output filename

OPTIONS

22   PARAMETERS
23         -i --input     Input filename
24         -o --output    Output filename
25   OPTIONS
26            --endian %s       Endianness (LSB/MSB).
27         -d --depth %d        Depth (8/16/32).
28            --sign %s         Pixel sign (0/1).
29         -s --size %d,%d      Size.
30         -C --sop-class-uid   SOP Class UID (name or value).
31         -T --study-uid       Study UID.
32         -S --series-uid      Series UID.
33            --root-uid        Root UID.
34   fill options
35         -R --region %d,%d    Region.
36         -F --fill %d         Fill with pixel value specified.
37   general options
38         -h   --help
39                print this help text and exit
40
41         -v   --version
42                print version information and exit
43
44         -V   --verbose
45                verbose mode (warning+error).
46
47         -W   --warning
48                warning mode, print warning information
49
50         -E   --error
51                error mode, print error information
52
53         -D   --debug
54                debug mode, print debug information
55   environment variable
56         GDCM_ROOT_UID Root UID

Supported File Format (appropriate file extension)

58       gdcmimg will base it's conversion process based on the file extension.
59       Follows the list of recognized file extension. When no extension is
60       found, DICOM file is assumed.
61       input format
62         * RAW       (raw)
63         * RLE       (rle)
64         * PNM       (pgm, pnm, ppm)
65         * JPEG-LS   (jls)
66         * JPEG 2000 (jp2, j2k, j2c, jpc)
67         * JPEG      (jpg, jpeg, ljpg, ljpeg)
68         * DICOM     ()
69
70       output format:
71         * PGM       (pgm, pnm, ppm)
72         * DICOM     ()
73
74       For RAW file format, you should take special care of the --endian
75       option. For the (old) JPEG file format, both the lossy and lossless
76       format are supported, user should pay attention to the --sign option.
77       For file format such as RLE or RAW, user is expected to fill in
78       information required to find the dimension and type of input data as
79       there is no other way to find this information. For all other file
80       format, the properties are derived from the file format itself. PNM
81       file are supposed to be big endian.

Typical usage

83   Remove a rectangular part of the image
84       To fill the region [0,100]x[0,100] of a DICOM image simply do:
85       $ gdcmimg --fill 0 --region 0,100,0,100 -i input.dcm -o output_black.dcm
86       Warning: if the Pixel Data is compressed, the image is first
87       decompressed so that pixel can be set to 0, but it is not recompressed.
88   Convert RAW to DICOM
89       Recognized extension is .raw (case insensitive)
90       $ gdcmimg --size 512,512 --depth 16 -i input.raw -o output.dcm
91       the image will be a Secondary Capture
92       You can use the dd cmd line to skip any header you would like to
93       discard, for instance, if you would like to skip the first 108 bytes,
94       simply do:
95       $ dd skip=108 bs=1 if=input.raw of=output.raw
96   Convert PGM/PNM/PPM to DICOM
97       Recognized extensions are .pgm, .pnm, .ppm (case insensitive)
98       $ gdcmimg -i input.pgm -o output.dcm
99       the image will be a Secondary Capture
100   Convert RLE to DICOM
101       Recognized extension is .rle (case insensitive)
102       $ gdcmimg --size 512,512 --depth 16 -i input.rle -o output.dcm
103       the image will be a Secondary Capture
104   Convert JPEG to DICOM
105       Recognized extensions are .jpg, .jpeg, .ljpg, .ljpeg (case insensitive)
106       $ gdcmimg -i input.ljpeg -o output.dcm
107       the image will be a Secondary Capture
108   Convert J2K to DICOM
109       Recognized extensions are .j2k, .jp2, .jpc (case insensitive)
110       $ gdcmimg -i input.j2k -o output.dcm
111       the image will be a Secondary Capture
112   Specifying a SOP Class UID
113       Instead of the default Secondary Capture Image Storage, one may want to
114       specify, say VL Photographic Image Storage.
115       $ gdcmimg --sop-class-uid 1.2.840.10008.5.1.4.1.1.77.1.4 input.jpg output.dcm

Multiple Files

117       gdcmimg handle nicely a set of files (for instance jpeg):
118       $ gdcmimg 1.jpg 2.jpg 3.jpg 4.jpg output.dcm

Warning

120       There are a couple of issues with gdcmimg implementation: For JFIF file
121       and JP2 file (with header) the header is copied into the Pixel Data
122       element which is illegal for JP2. Use gdcmconv to properly re-encode a
123       JP2/JFIF file into J2K/JPG.
124       $ gdcmimg input.jp2 output_jp2.dcm
125       $ gdcmconv --j2k --force output_jp2.dcm output_j2k.dcm
126       For RLE file, no check is done for crossing the row boundary. It is
127       recommended to use gdcmconv --rle to re-encode into a proper RLE file
128       in case of doubt.
129       Of course if the compression is not ok with your setup, you can always
130       de-encapsulated the DICOM file (typically JPEG) to a non-encapsulated
131       form, using gdcmconv:
132       $ gdcmconv --raw input_jpeg.dcm output_raw.dcm

SEE ALSO

134       gdcmdump(1), gdcmdump(1), gdcmraw(1), convert(1), dd(1)
136       Copyright (c) 2006-2010 Mathieu Malaterre
137
138
139
140Version 2.0.16                  Tue Jul 26 2011                     gdcmimg(1)
Impressum