1dcm2pnm(1) OFFIS DCMTK dcm2pnm(1)
2
3
4
6 dcm2pnm - Convert DICOM images to PGM/PPM, PNG, TIFF or BMP
7
8
10 dcm2pnm [options] dcmfile-in [bitmap-out]
11
13 The dcm2pnm utility reads a DICOM image, converts the pixel data
14 according to the selected image processing options and writes back an
15 image in the well-known PGM/PPM (portable gray map / portable pix map),
16 PNG, TIFF or Windows BMP format. This utility only supports
17 uncompressed and RLE compressed DICOM images. The command line tool
18 dcmj2pnm also supports a number of JPEG compression schemes.
19
21 dcmfile-in DICOM input filename to be converted
22
23 bitmap-out output filename to be written (default: stdout)
24
26 general options
27 -h --help
28 print this help text and exit
29
30 --version
31 print version information and exit
32
33 --arguments
34 print expanded command line arguments
35
36 -q --quiet
37 quiet mode, print no warnings and errors
38
39 -v --verbose
40 verbose mode, print processing details
41
42 -d --debug
43 debug mode, print debug information
44
45 -ll --log-level [l]evel: string constant
46 (fatal, error, warn, info, debug, trace)
47 use level l for the logger
48
49 -lc --log-config [f]ilename: string
50 use config file f for the logger
51
52 input options
53 input file format:
54
55 +f --read-file
56 read file format or data set (default)
57
58 +fo --read-file-only
59 read file format only
60
61 -f --read-dataset
62 read data set without file meta information
63
64 input transfer syntax:
65
66 -t= --read-xfer-auto
67 use TS recognition (default)
68
69 -td --read-xfer-detect
70 ignore TS specified in the file meta header
71
72 -te --read-xfer-little
73 read with explicit VR little endian TS
74
75 -tb --read-xfer-big
76 read with explicit VR big endian TS
77
78 -ti --read-xfer-implicit
79 read with implicit VR little endian TS
80
81 image processing options
82 frame selection:
83
84 +F --frame [n]umber: integer
85 select specified frame (default: 1)
86
87 +Fr --frame-range [n]umber [c]ount: integer
88 select c frames beginning with frame n
89
90 +Fa --all-frames
91 select all frames
92
93 rotation:
94
95 +Rl --rotate-left
96 rotate image left (-90 degrees)
97
98 +Rr --rotate-right
99 rotate image right (+90 degrees)
100
101 +Rtd --rotate-top-down
102 rotate image top-down (180 degrees)
103
104 flipping:
105
106 +Lh --flip-horizontally
107 flip image horizontally
108
109 +Lv --flip-vertically
110 flip image vertically
111
112 +Lhv --flip-both-axes
113 flip image horizontally and vertically
114
115 scaling:
116
117 +a --recognize-aspect
118 recognize pixel aspect ratio when scaling (default)
119
120 -a --ignore-aspect
121 ignore pixel aspect ratio when scaling
122
123 +i --interpolate [n]umber of algorithm: integer
124 use interpolation when scaling (1..4, default: 1)
125
126 -i --no-interpolation
127 no interpolation when scaling
128
129 -S --no-scaling
130 no scaling, ignore pixel aspect ratio (default)
131
132 +Sxf --scale-x-factor [f]actor: float
133 scale x axis by factor, auto-compute y axis
134
135 +Syf --scale-y-factor [f]actor: float
136 scale y axis by factor, auto-compute x axis
137
138 +Sxv --scale-x-size [n]umber: integer
139 scale x axis to n pixels, auto-compute y axis
140
141 +Syv --scale-y-size [n]umber: integer
142 scale y axis to n pixels, auto-compute x axis
143
144 modality LUT transformation:
145
146 -M --no-modality
147 ignore stored modality LUT transformation
148
149 +M --use-modality
150 use modality LUT transformation (default)
151
152 VOI LUT transformation:
153
154 -W --no-windowing
155 no VOI windowing (default)
156
157 +Wi --use-window [n]umber: integer
158 use the n-th VOI window from image file
159
160 +Wl --use-voi-lut [n]umber: integer
161 use the n-th VOI look up table from image file
162
163 +Wm --min-max-window
164 compute VOI window using min-max algorithm
165
166 +Wn --min-max-window-n
167 compute VOI window using min-max algorithm,
168 ignoring extreme values
169
170 +Wr --roi-min-max-window [l]eft [t]op [w]idth [h]eight: integer
171 compute ROI window using min-max algorithm,
172 region of interest is specified by l,t,w,h
173
174 +Wh --histogram-window [n]umber: integer
175 compute VOI window using Histogram algorithm,
176 ignoring n percent
177
178 +Ww --set-window [c]enter [w]idth: float
179 compute VOI window using center c and width w
180
181 +Wfl --linear-function
182 set VOI LUT function to LINEAR
183
184 +Wfs --sigmoid-function
185 set VOI LUT function to SIGMOID
186
187 presentation LUT transformation:
188
189 +Pid --identity-shape
190 set presentation LUT shape to IDENTITY
191
192 +Piv --inverse-shape
193 set presentation LUT shape to INVERSE
194
195 +Pod --lin-od-shape
196 set presentation LUT shape to LIN OD
197
198 overlay:
199
200 -O --no-overlays
201 do not display overlays
202
203 +O --display-overlay [n]umber: integer
204 display overlay n (0..16, 0=all, default: +O 0)
205
206 +Omr --ovl-replace
207 use overlay mode "Replace"
208 (default for Graphic overlays)
209
210 +Omt --ovl-threshold
211 use overlay mode "Threshold Replace"
212
213 +Omc --ovl-complement
214 use overlay mode "Complement"
215
216 +Omv --ovl-invert
217 use overlay mode "Invert Bitmap"
218
219 +Omi --ovl-roi
220 use overlay mode "Region of Interest"
221 (default for ROI overlays)
222
223 +Osf --set-foreground [d]ensity: float
224 set overlay foreground density (0..1, default: 1)
225
226 +Ost --set-threshold [d]ensity: float
227 set overlay threshold density (0..1, default: 0.5)
228
229 display LUT transformation:
230
231 +Dm --monitor-file [f]ilename: string
232 calibrate output according to monitor characteristics
233 defined in f
234
235 +Dp --printer-file [f]ilename: string
236 calibrate output according to printer characteristics
237 defined in f
238
239 +Da --ambient-light [a]mbient light: float
240 ambient light value (cd/m^2, default: file f)
241
242 +Di --illumination [i]llumination: float
243 illumination value (cd/m^2, default: file f)
244
245 +Dn --min-density [m]inimum optical density: float
246 Dmin value (default: off, only with +Dp)
247
248 +Dx --max-density [m]aximum optical density: float
249 Dmax value (default: off, only with +Dp)
250
251 +Dg --gsd-function
252 use GSDF for calibration (default for +Dm/+Dp)
253
254 +Dc --cielab-function
255 use CIELAB function for calibration
256
257 compatibility:
258
259 +Ma --accept-acr-nema
260 accept ACR-NEMA images without photometric
261 interpretation
262
263 +Mp --accept-palettes
264 accept incorrect palette attribute tags
265 (0028,111x) and (0028,121x)
266
267 +Mc --check-lut-depth
268 check 3rd value of the LUT descriptor, compare
269 with expected bit depth based on LUT data
270
271 +Mm --ignore-mlut-depth
272 ignore 3rd value of the modality LUT descriptor,
273 determine bits per table entry automatically
274
275 +Mv --ignore-vlut-depth
276 ignore 3rd value of the VOI LUT descriptor,
277 determine bits per table entry automatically
278
279 TIFF format:
280
281 +Tl --compr-lzw
282 LZW compression (default)
283
284 +Tr --compr-rle
285 RLE compression
286
287 +Tn --compr-none
288 uncompressed
289
290 +Pd --predictor-default
291 no LZW predictor (default)
292
293 +Pn --predictor-none
294 LZW predictor 1 (no prediction)
295
296 +Ph --predictor-horz
297 LZW predictor 2 (horizontal differencing)
298
299 +Rs --rows-per-strip [r]ows: integer (default: 0)
300 rows per strip, default 8K per strip
301
302 PNG format:
303
304 +il --interlace
305 create interlaced file (default)
306
307 -il --nointerlace
308 create non-interlaced file
309
310 +mf --meta-file
311 create PNG file meta information (default)
312
313 -mf --meta-none
314 no PNG file meta information
315
316 other transformations:
317
318 +G --grayscale
319 convert color image to grayscale (monochrome)
320
321 +P --change-polarity
322 change polarity (invert pixel output)
323
324 +C --clip-region [l]eft [t]op [w]idth [h]eight: integer
325 clip image region (l, t, w, h)
326
327 output options
328 general:
329
330 -im --image-info
331 print image details (requires verbose mode)
332
333 -o --no-output
334 do not create any output (useful with -im)
335
336 filename generation (only with --frame-range or --all-frames):
337
338 +Fc --use-frame-counter
339 use 0-based counter for filenames (default)
340
341 +Fn --use-frame-number
342 use absolute frame number for filenames
343
344 image format:
345
346 +op --write-raw-pnm
347 write 8-bit binary PGM/PPM (default for files)
348
349 +opb --write-8-bit-pnm
350 write 8-bit ASCII PGM/PPM (default for stdout)
351
352 +opw --write-16-bit-pnm
353 write 16-bit ASCII PGM/PPM
354
355 +opn --write-n-bit-pnm [n]umber: integer
356 write n-bit ASCII PGM/PPM (1..32)
357
358 +ob --write-bmp
359 write 8-bit (monochrome) or 24-bit (color) BMP
360
361 +obp --write-8-bit-bmp
362 write 8-bit palette BMP (monochrome only)
363
364 +obt --write-24-bit-bmp
365 write 24-bit truecolor BMP
366
367 +obr --write-32-bit-bmp
368 write 32-bit truecolor BMP
369
370 +ot --write-tiff
371 write 8-bit (monochrome) or 24-bit (color) TIFF
372
373 +on --write-png
374 write 8-bit (monochrome) or 24-bit (color) PNG
375
376 +on2 --write-16-bit-png
377 write 16-bit (monochrome) or 48-bit (color) PNG
378
380 The following preferred interpolation algorithms can be selected using
381 the --interpolate option:
382
383 • 1 = free scaling algorithm with interpolation from pbmplus toolkit
384 • 2 = free scaling algorithm with interpolation from c't magazine
385 • 3 = magnification algorithm with bilinear interpolation from Eduard
386 Stanescu
387 • 4 = magnification algorithm with bicubic interpolation from Eduard
388 Stanescu
389 The --write-tiff option is only available when DCMTK has been
390 configured and compiled with support for the external libtiff TIFF
391 library. The availability of the TIFF compression options depends on
392 the libtiff configuration.
393 The --write-png option is only available when DCMTK has been configured
394 and compiled with support for the external libpng PNG library. Option
395 --interlace enables progressive image view while loading the PNG file.
396 Only a few applications take care of the meta info (TEXT) in a PNG
397 file.
399 dcm2pnm supports the following transfer syntaxes for input (dcmfile-
400 in):
401 LittleEndianImplicitTransferSyntax 1.2.840.10008.1.2
402 LittleEndianExplicitTransferSyntax 1.2.840.10008.1.2.1
403 DeflatedExplicitVRLittleEndianTransferSyntax 1.2.840.10008.1.2.1.99 (*)
404 BigEndianExplicitTransferSyntax 1.2.840.10008.1.2.2
405 RLELosslessTransferSyntax 1.2.840.10008.1.2.5
406 (*) if compiled with zlib support enabled
408 The level of logging output of the various command line tools and
409 underlying libraries can be specified by the user. By default, only
410 errors and warnings are written to the standard error stream. Using
411 option --verbose also informational messages like processing details
412 are reported. Option --debug can be used to get more details on the
413 internal activity, e.g. for debugging purposes. Other logging levels
414 can be selected using option --log-level. In --quiet mode only fatal
415 errors are reported. In such very severe error events, the application
416 will usually terminate. For more details on the different logging
417 levels, see documentation of module 'oflog'.
418 In case the logging output should be written to file (optionally with
419 logfile rotation), to syslog (Unix) or the event log (Windows) option
420 --log-config can be used. This configuration file also allows for
421 directing only certain messages to a particular output stream and for
422 filtering certain messages based on the module or application where
423 they are generated. An example configuration file is provided in
424 <etcdir>/logger.cfg.
426 All command line tools use the following notation for parameters:
427 square brackets enclose optional values (0-1), three trailing dots
428 indicate that multiple values are allowed (1-n), a combination of both
429 means 0 to n values.
430 Command line options are distinguished from parameters by a leading '+'
431 or '-' sign, respectively. Usually, order and position of command line
432 options are arbitrary (i.e. they can appear anywhere). However, if
433 options are mutually exclusive the rightmost appearance is used. This
434 behavior conforms to the standard evaluation rules of common Unix
435 shells.
436 In addition, one or more command files can be specified using an '@'
437 sign as a prefix to the filename (e.g. @command.txt). Such a command
438 argument is replaced by the content of the corresponding text file
439 (multiple whitespaces are treated as a single separator unless they
440 appear between two quotation marks) prior to any further evaluation.
441 Please note that a command file cannot contain another command file.
442 This simple but effective approach allows one to summarize common
443 combinations of options/parameters and avoids longish and confusing
444 command lines (an example is provided in file <datadir>/dumppat.txt).
446 The dcm2pnm utility will attempt to load DICOM data dictionaries
447 specified in the DCMDICTPATH environment variable. By default, i.e. if
448 the DCMDICTPATH environment variable is not set, the file
449 <datadir>/dicom.dic will be loaded unless the dictionary is built into
450 the application (default for Windows).
451 The default behavior should be preferred and the DCMDICTPATH
452 environment variable only used when alternative data dictionaries are
453 required. The DCMDICTPATH environment variable has the same format as
454 the Unix shell PATH variable in that a colon (':') separates entries.
455 On Windows systems, a semicolon (';') is used as a separator. The data
456 dictionary code will attempt to load each file specified in the
457 DCMDICTPATH environment variable. It is an error if no data dictionary
458 can be loaded.
460 <datadir>/camera.lut - sample characteristics file of a camera
461 <datadir>/monitor.lut - sample characteristics file of a monitor
462 <datadir>/printer.lut - sample characteristics file of a printer
463 <datadir>/scanner.lut - sample characteristics file of a scanner
465 dcmj2pnm(1), img2dcm(1)
467 Copyright (C) 1998-2022 by OFFIS e.V., Escherweg 2, 26121 Oldenburg,
468 Germany.
469
470
471
472Version 3.6.7 Fri Apr 22 2022 dcm2pnm(1)