4 \page dcml2pnm Convert DICOM images to PGM/PPM, PNG, TIFF or BMP
6 \page dcml2pnm dcml2pnm: Convert DICOM images to PGM/PPM, PNG, TIFF or BMP
9 \section synopsis SYNOPSIS
12 dcml2pnm [options] dcmfile-in [bitmap-out]
15 \section description DESCRIPTION
17 The \b dcml2pnm utility reads a DICOM image, converts the pixel data according
18 to the selected image processing options and writes back an image in the
19 well-known PGM/PPM (portable gray map / portable pix map), PNG, TIFF or
20 Windows BMP format. This utility supports uncompressed as well as JPEG-LS
21 and RLE compressed DICOM images.
23 \section parameters PARAMETERS
26 dcmfile-in DICOM input filename to be converted
28 bitmap-out output filename to be written (default: stdout)
31 \section options OPTIONS
33 \subsection general_options general options
36 print this help text and exit
39 print version information and exit
42 print expanded command line arguments
45 quiet mode, print no warnings and errors
48 verbose mode, print processing details
51 debug mode, print debug information
53 -ll --log-level [l]evel: string constant
54 (fatal, error, warn, info, debug, trace)
55 use level l for the logger
57 -lc --log-config [f]ilename: string
58 use config file f for the logger
61 \subsection input_options input options
66 read file format or data set (default)
72 read data set without file meta information
74 input transfer syntax:
77 use TS recognition (default)
79 -td --read-xfer-detect
80 ignore TS specified in the file meta header
82 -te --read-xfer-little
83 read with explicit VR little endian TS
86 read with explicit VR big endian TS
88 -ti --read-xfer-implicit
89 read with implicit VR little endian TS
92 \subsection image_processing_options image processing options
96 +F --frame [n]umber: integer
97 select specified frame (default: 1)
99 +Fr --frame-range [n]umber [c]ount: integer
100 select c frames beginning with frame n
108 rotate image left (-90 degrees)
111 rotate image right (+90 degrees)
113 +Rtd --rotate-top-down
114 rotate image top-down (180 degrees)
118 +Lh --flip-horizontally
119 flip image horizontally
121 +Lv --flip-vertically
122 flip image vertically
124 +Lhv --flip-both-axes
125 flip image horizontally and vertically
129 +a --recognize-aspect
130 recognize pixel aspect ratio (default)
133 ignore pixel aspect ratio when scaling
135 +i --interpolate [n]umber of algorithm: integer
136 use interpolation when scaling (1..4, default: 1)
138 -i --no-interpolation
139 no interpolation when scaling
142 no scaling, ignore pixel aspect ratio (default)
144 +Sxf --scale-x-factor [f]actor: float
145 scale x axis by factor, auto-compute y axis
147 +Syf --scale-y-factor [f]actor: float
148 scale y axis by factor, auto-compute x axis
150 +Sxv --scale-x-size [n]umber: integer
151 scale x axis to n pixels, auto-compute y axis
153 +Syv --scale-y-size [n]umber: integer
154 scale y axis to n pixels, auto-compute x axis
156 modality LUT transformation:
159 ignore stored modality LUT transformation
162 use modality LUT transformation (default)
164 VOI LUT transformation:
167 no VOI windowing (default)
169 +Wi --use-window [n]umber: integer
170 use the n-th VOI window from image file
172 +Wl --use-voi-lut [n]umber: integer
173 use the n-th VOI look up table from image file
176 compute VOI window using min-max algorithm
178 +Wn --min-max-window-n
179 compute VOI window using min-max algorithm,
180 ignoring extreme values
182 +Wr --roi-min-max-window [l]eft [t]op [w]idth [h]eight: integer
183 compute ROI window using min-max algorithm,
184 region of interest is specified by l,t,w,h
186 +Wh --histogram-window [n]umber: integer
187 compute VOI window using Histogram algorithm,
190 +Ww --set-window [c]enter [w]idth: float
191 compute VOI window using center c and width w
193 +Wfl --linear-function
194 set VOI LUT function to LINEAR
196 +Wfs --sigmoid-function
197 set VOI LUT function to SIGMOID
199 presentation LUT transformation:
201 +Pid --identity-shape
202 set presentation LUT shape to IDENTITY
205 set presentation LUT shape to INVERSE
208 set presentation LUT shape to LIN OD
213 do not display overlays
215 +O --display-overlay [n]umber: integer
216 display overlay n (0..16, 0=all, default: +O 0)
219 use overlay mode "Replace"
220 (default for Graphic overlays)
223 use overlay mode "Threshold Replace"
225 +Omc --ovl-complement
226 use overlay mode "Complement"
229 use overlay mode "Invert Bitmap"
232 use overlay mode "Region of Interest"
233 (default for ROI overlays)
235 +Osf --set-foreground [d]ensity: float
236 set overlay foreground density (0..1, default: 1)
238 +Ost --set-threshold [d]ensity: float
239 set overlay threshold density (0..1, default: 0.5)
241 display LUT transformation:
243 +Dm --monitor-file [f]ilename: string
244 calibrate output according to monitor characteristics
247 +Dp --printer-file [f]ilename: string
248 calibrate output according to printer characteristics
251 +Da --ambient-light [a]mbient light: float
252 ambient light value (cd/m^2, default: file f)
254 +Di --illumination [i]llumination: float
255 illumination value (cd/m^2, default: file f)
257 +Dn --min-density [m]inimum optical density: float
258 Dmin value (default: off, only with +Dp)
260 +Dx --max-density [m]aximum optical density: float
261 Dmax value (default: off, only with +Dp)
264 use GSDF for calibration (default for +Dm/+Dp)
266 +Dc --cielab-function
267 use CIELAB function for calibration
271 +Ma --accept-acr-nema
272 accept ACR-NEMA images without photometric
275 +Mp --accept-palettes
276 accept incorrect palette attribute tags
277 (0028,111x) and (0028,121x)
279 +Mc --check-lut-depth
280 check 3rd value of the LUT descriptor, compare
281 with expected bit depth based on LUT data
283 +Mm --ignore-mlut-depth
284 ignore 3rd value of the modality LUT descriptor,
285 determine bits per table entry automatically
287 +Mv --ignore-vlut-depth
288 ignore 3rd value of the VOI LUT descriptor,
289 determine bits per table entry automatically
294 LZW compression (default)
302 +Pd --predictor-default
303 no LZW predictor (default)
306 LZW predictor 1 (no prediction)
309 LZW predictor 2 (horizontal differencing)
311 +Rs --rows-per-strip [r]ows: integer (default: 0)
312 rows per strip, default 8K per strip
317 create interlaced file (default)
320 create non-interlaced file
323 create PNG file meta information (default)
326 no PNG file meta information
328 other transformations:
331 convert to grayscale if necessary
334 change polarity (invert pixel output)
336 +C --clip-region [l]eft [t]op [w]idth [h]eight: integer
337 clip image region (l, t, w, h)
340 \subsection output_options output options
345 print image details (requires verbose mode)
348 do not create any output (useful with -im)
353 write 8-bit binary PGM/PPM (default for files)
355 +opb --write-8-bit-pnm
356 write 8-bit ASCII PGM/PPM (default for stdout)
358 +opw --write-16-bit-pnm
359 write 16-bit ASCII PGM/PPM
361 +opn --write-n-bit-pnm [n]umber: integer
362 write n-bit ASCII PGM/PPM (1..32)
365 write 8-bit (monochrome) or 24-bit (color) BMP
367 +obp --write-8-bit-bmp
368 write 8-bit palette BMP (monochrome only)
370 +obt --write-24-bit-bmp
371 write 24-bit truecolor BMP
373 +obr --write-32-bit-bmp
374 write 32-bit truecolor BMP
377 write 8-bit (monochrome) or 24-bit (color) TIFF
380 write 8-bit (monochrome) or 24-bit (color) PNG
385 The following preferred interpolation algorithms can be selected using the
386 \e --interpolate option:
388 \li 1 = free scaling algorithm with interpolation from pbmplus toolkit
389 \li 2 = free scaling algorithm with interpolation from c't magazine
390 \li 3 = magnification algorithm with bilinear interpolation from Eduard Stanescu
391 \li 4 = magnification algorithm with bicubic interpolation from Eduard Stanescu
393 The \e --write-tiff option is only available when DCMTK has been configured
394 and compiled with support for the external \b libtiff TIFF library. The
395 availability of the TIFF compression options depends on the \b libtiff
396 configuration. In particular, the patented LZW algorithm may not be
399 The \e --write-png option is only available when DCMTK has been configured
400 and compiled with support for the external \b libpng PNG library. Option
401 \e --interlace enables progressive image view while loading the PNG file.
402 Only a few applications take care of the meta info (TEXT) in a PNG file.
404 \section transfer_syntaxes TRANSFER SYNTAXES
406 \b dcml2pnm supports the following transfer syntaxes for input (\e dcmfile-in):
409 LittleEndianImplicitTransferSyntax 1.2.840.10008.1.2
410 LittleEndianExplicitTransferSyntax 1.2.840.10008.1.2.1
411 DeflatedExplicitVRLittleEndianTransferSyntax 1.2.840.10008.1.2.1.99 (*)
412 BigEndianExplicitTransferSyntax 1.2.840.10008.1.2.2
413 JPEGLSLosslessTransferSyntax 1.2.840.10008.1.2.4.80
414 JPEGLSLossyTransferSyntax 1.2.840.10008.1.2.4.81
415 RLELosslessTransferSyntax 1.2.840.10008.1.2.5
418 (*) if compiled with zlib support enabled
420 \section logging LOGGING
422 The level of logging output of the various command line tools and underlying
423 libraries can be specified by the user. By default, only errors and warnings
424 are written to the standard error stream. Using option \e --verbose also
425 informational messages like processing details are reported. Option
426 \e --debug can be used to get more details on the internal activity, e.g. for
427 debugging purposes. Other logging levels can be selected using option
428 \e --log-level. In \e --quiet mode only fatal errors are reported. In such
429 very severe error events, the application will usually terminate. For more
430 details on the different logging levels, see documentation of module "oflog".
432 In case the logging output should be written to file (optionally with logfile
433 rotation), to syslog (Unix) or the event log (Windows) option \e --log-config
434 can be used. This configuration file also allows for directing only certain
435 messages to a particular output stream and for filtering certain messages
436 based on the module or application where they are generated. An example
437 configuration file is provided in <em><etcdir>/logger.cfg</em>).
439 \section command_line COMMAND LINE
441 All command line tools use the following notation for parameters: square
442 brackets enclose optional values (0-1), three trailing dots indicate that
443 multiple values are allowed (1-n), a combination of both means 0 to n values.
445 Command line options are distinguished from parameters by a leading '+' or '-'
446 sign, respectively. Usually, order and position of command line options are
447 arbitrary (i.e. they can appear anywhere). However, if options are mutually
448 exclusive the rightmost appearance is used. This behaviour conforms to the
449 standard evaluation rules of common Unix shells.
451 In addition, one or more command files can be specified using an '@' sign as a
452 prefix to the filename (e.g. <em>\@command.txt</em>). Such a command argument
453 is replaced by the content of the corresponding text file (multiple
454 whitespaces are treated as a single separator unless they appear between two
455 quotation marks) prior to any further evaluation. Please note that a command
456 file cannot contain another command file. This simple but effective approach
457 allows to summarize common combinations of options/parameters and avoids
458 longish and confusing command lines (an example is provided in file
459 <em><datadir>/dumppat.txt</em>).
461 \section environment ENVIRONMENT
463 The \b dcml2pnm utility will attempt to load DICOM data dictionaries specified
464 in the \e DCMDICTPATH environment variable. By default, i.e. if the
465 \e DCMDICTPATH environment variable is not set, the file
466 <em><datadir>/dicom.dic</em> will be loaded unless the dictionary is built
467 into the application (default for Windows).
469 The default behaviour should be preferred and the \e DCMDICTPATH environment
470 variable only used when alternative data dictionaries are required. The
471 \e DCMDICTPATH environment variable has the same format as the Unix shell
472 \e PATH variable in that a colon (":") separates entries. On Windows systems,
473 a semicolon (";") is used as a separator. The data dictionary code will
474 attempt to load each file specified in the \e DCMDICTPATH environment variable.
475 It is an error if no data dictionary can be loaded.
479 <em><datadir>/camera.lut</em> - sample characteristics file of a camera
480 \n<em><datadir>/monitor.lut</em> - sample characteristics file of a monitor
481 \n<em><datadir>/printer.lut</em> - sample characteristics file of a printer
482 \n<em><datadir>/scanner.lut</em> - sample characteristics file of a scanner
484 \section see_also SEE ALSO
486 <b>dcm2pnm</b>(1), <b>img2dcm</b>(1)
488 \section copyright COPYRIGHT
490 Copyright (C) 2001-2010 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.