1dcmj2pnm(1)                       OFFIS DCMTK                      dcmj2pnm(1)
2
3
4

NAME

6       dcmj2pnm - Convert DICOM images to PGM/PPM, PNG, TIFF, JPEG or BMP
7

SYNOPSIS

9       dcmj2pnm [options] dcmfile-in [bitmap-out]
10

DESCRIPTION

12       The  dcmj2pnm  utility  reads  a  DICOM  image, converts the pixel data
13       according to the selected image processing options and writes  back  an
14       image in the well-known PGM/PPM (portable gray map / portable pix map),
15       PNG, TIFF, JPEG (Joint  Photographic  Experts  Group)  or  Windows  BMP
16       format.  This  utility  supports  uncompressed  as well as JPEG and RLE
17       compressed DICOM images.
18

PARAMETERS

20       dcmfile-in  DICOM input filename to be converted
21
22       bitmap-out  output filename to be written (default: stdout)
23

OPTIONS

25   general options
26         -h    --help
27                 print this help text and exit
28
29               --version
30                 print version information and exit
31
32               --arguments
33                 print expanded command line arguments
34
35         -q    --quiet
36                 quiet mode, print no warnings and errors
37
38         -v    --verbose
39                 verbose mode, print processing details
40
41         -d    --debug
42                 debug mode, print debug information
43
44         -ll   --log-level  [l]evel: string constant
45                 (fatal, error, warn, info, debug, trace)
46                 use level l for the logger
47
48         -lc   --log-config  [f]ilename: string
49                 use config file f for the logger
50
51   input options
52       input file format:
53
54         +f    --read-file
55                 read file format or data set (default)
56
57         +fo   --read-file-only
58                 read file format only
59
60         -f    --read-dataset
61                 read data set without file meta information
62
63       input transfer syntax:
64
65         -t=   --read-xfer-auto
66                 use TS recognition (default)
67
68         -td   --read-xfer-detect
69                 ignore TS specified in the file meta header
70
71         -te   --read-xfer-little
72                 read with explicit VR little endian TS
73
74         -tb   --read-xfer-big
75                 read with explicit VR big endian TS
76
77         -ti   --read-xfer-implicit
78                 read with implicit VR little endian TS
79
80   image processing options
81       frame selection:
82
83         +F    --frame  [n]umber: integer
84                 select specified frame (default: 1)
85
86         +Fr   --frame-range  [n]umber [c]ount: integer
87                 select c frames beginning with frame n
88
89         +Fa   --all-frames
90                 select all frames
91
92       rotation:
93
94         +Rl   --rotate-left
95                 rotate image left (-90 degrees)
96
97         +Rr   --rotate-right
98                 rotate image right (+90 degrees)
99
100         +Rtd  --rotate-top-down
101                 rotate image top-down (180 degrees)
102
103       flipping:
104
105         +Lh   --flip-horizontally
106                 flip image horizontally
107
108         +Lv   --flip-vertically
109                 flip image vertically
110
111         +Lhv  --flip-both-axes
112                 flip image horizontally and vertically
113
114       scaling:
115
116         +a    --recognize-aspect
117                 recognize pixel aspect ratio (default)
118
119         -a    --ignore-aspect
120                 ignore pixel aspect ratio when scaling
121
122         +i    --interpolate  [n]umber of algorithm: integer
123                 use interpolation when scaling (1..4, default: 1)
124
125         -i    --no-interpolation
126                 no interpolation when scaling
127
128         -S    --no-scaling
129                 no scaling, ignore pixel aspect ratio (default)
130
131         +Sxf  --scale-x-factor  [f]actor: float
132                 scale x axis by factor, auto-compute y axis
133
134         +Syf  --scale-y-factor  [f]actor: float
135                 scale y axis by factor, auto-compute x axis
136
137         +Sxv  --scale-x-size  [n]umber: integer
138                 scale x axis to n pixels, auto-compute y axis
139
140         +Syv  --scale-y-size  [n]umber: integer
141                 scale y axis to n pixels, auto-compute x axis
142
143       color space conversion (compressed images only):
144
145         +cp   --conv-photometric
146                 convert if YCbCr photometric interpretation (default)
147
148         +cl   --conv-lossy
149                 convert YCbCr to RGB if lossy JPEG
150
151         +cg   --conv-guess
152                 convert to RGB if YCbCr is guessed by library
153
154         +cgl  --conv-guess-lossy
155                 convert to RGB if lossy JPEG and YCbCr is
156                 guessed by the underlying JPEG library
157
158         +ca   --conv-always
159                 always convert YCbCr to RGB
160
161         +cn   --conv-never
162                 never convert color space
163
164       modality LUT transformation:
165
166         -M    --no-modality
167                 ignore stored modality LUT transformation
168
169         +M    --use-modality
170                 use modality LUT transformation (default)
171
172       VOI LUT transformation:
173
174         -W    --no-windowing
175                 no VOI windowing (default)
176
177         +Wi   --use-window  [n]umber: integer
178                 use the n-th VOI window from image file
179
180         +Wl   --use-voi-lut  [n]umber: integer
181                 use the n-th VOI look up table from image file
182
183         +Wm   --min-max-window
184                 compute VOI window using min-max algorithm
185
186         +Wn   --min-max-window-n
187                 compute VOI window using min-max algorithm,
188                 ignoring extreme values
189
190         +Wr   --roi-min-max-window  [l]eft [t]op [w]idth [h]eight: integer
191                 compute ROI window using min-max algorithm,
192                 region of interest is specified by l,t,w,h
193
194         +Wh   --histogram-window  [n]umber: integer
195                 compute VOI window using Histogram algorithm,
196                 ignoring n percent
197
198         +Ww   --set-window  [c]enter [w]idth: float
199                 compute VOI window using center c and width w
200
201         +Wfl  --linear-function
202                 set VOI LUT function to LINEAR
203
204         +Wfs  --sigmoid-function
205                 set VOI LUT function to SIGMOID
206
207       presentation LUT transformation:
208
209         +Pid  --identity-shape
210                 set presentation LUT shape to IDENTITY
211
212         +Piv  --inverse-shape
213                 set presentation LUT shape to INVERSE
214
215         +Pod  --lin-od-shape
216                 set presentation LUT shape to LIN OD
217
218       overlay:
219
220         -O    --no-overlays
221                 do not display overlays
222
223         +O    --display-overlay  [n]umber: integer
224                 display overlay n (0..16, 0=all, default: +O 0)
225
226         +Omr  --ovl-replace
227                 use overlay mode "Replace"
228                 (default for Graphic overlays)
229
230         +Omt  --ovl-threshold
231                 use overlay mode "Threshold Replace"
232
233         +Omc  --ovl-complement
234                 use overlay mode "Complement"
235
236         +Omv  --ovl-invert
237                 use overlay mode "Invert Bitmap"
238
239         +Omi  --ovl-roi
240                 use overlay mode "Region of Interest"
241                 (default for ROI overlays)
242
243         +Osf  --set-foreground  [d]ensity: float
244                 set overlay foreground density (0..1, default: 1)
245
246         +Ost  --set-threshold  [d]ensity: float
247                 set overlay threshold density (0..1, default: 0.5)
248
249       display LUT transformation:
250
251         +Dm   --monitor-file  [f]ilename: string
252                 calibrate output according to monitor characteristics
253                 defined in f
254
255         +Dp   --printer-file  [f]ilename: string
256                 calibrate output according to printer characteristics
257                 defined in f
258
259         +Da   --ambient-light  [a]mbient light: float
260                 ambient light value (cd/m^2, default: file f)
261
262         +Di   --illumination  [i]llumination: float
263                 illumination value (cd/m^2, default: file f)
264
265         +Dn   --min-density  [m]inimum optical density: float
266                 Dmin value (default: off, only with +Dp)
267
268         +Dx   --max-density  [m]aximum optical density: float
269                 Dmax value (default: off, only with +Dp)
270
271         +Dg   --gsd-function
272                 use GSDF for calibration (default for +Dm/+Dp)
273
274         +Dc   --cielab-function
275                 use CIELAB function for calibration
276
277       compatibility:
278
279         +Ma   --accept-acr-nema
280                 accept ACR-NEMA images without photometric
281                 interpretation
282
283         +Mp   --accept-palettes
284                 accept incorrect palette attribute tags
285                 (0028,111x) and (0028,121x)
286
287         +Mc   --check-lut-depth
288                 check 3rd value of the LUT descriptor, compare
289                 with expected bit depth based on LUT data
290
291         +Mm   --ignore-mlut-depth
292                 ignore 3rd value of the modality LUT descriptor,
293                 determine bits per table entry automatically
294
295         +Mv   --ignore-vlut-depth
296                 ignore 3rd value of the VOI LUT descriptor,
297                 determine bits per table entry automatically
298
299       TIFF format:
300
301         +Tl   --compr-lzw
302                 LZW compression (default)
303
304         +Tr   --compr-rle
305                 RLE compression
306
307         +Tn   --compr-none
308                 uncompressed
309
310         +Pd   --predictor-default
311                 no LZW predictor (default)
312
313         +Pn   --predictor-none
314                 LZW predictor 1 (no prediction)
315
316         +Ph   --predictor-horz
317                 LZW predictor 2 (horizontal differencing)
318
319         +Rs   --rows-per-strip  [r]ows: integer (default: 0)
320                 rows per strip, default 8K per strip
321
322       PNG format:
323
324         +il   --interlace
325                 create interlaced file (default)
326
327         -il   --nointerlace
328                 create non-interlaced file
329
330         +mf   --meta-file
331                 create PNG file meta information (default)
332
333         -mf   --meta-none
334                 no PNG file meta information
335
336       JPEG format:
337
338         +Jq   --compr-quality  [q]uality: integer (0..100, default: 90)
339                 quality value for compression (in percent)
340
341         +Js4  --sample-444
342                 4:4:4 sampling (no subsampling)
343
344         +Js2  --sample-422
345                 4:2:2 subsampling (horizontal subsampling of
346                 chroma components, default)
347
348         +Js1  --sample-411
349                 4:1:1 subsampling (horizontal and vertical
350                 subsampling of chroma components)
351
352       other transformations:
353
354         +G    --grayscale
355                 convert to grayscale if necessary
356
357         +P    --change-polarity
358                 change polarity (invert pixel output)
359
360         +C    --clip-region  [l]eft [t]op [w]idth [h]eight: integer
361                 clip image region (l, t, w, h)
362
363   output options
364       general:
365
366         -im   --image-info
367                 print image details (requires verbose mode)
368
369         -o    --no-output
370                 do not create any output (useful with -im)
371
372       image format:
373
374         +op   --write-raw-pnm
375                 write 8-bit binary PGM/PPM (default for files)
376
377         +opb  --write-8-bit-pnm
378                 write 8-bit ASCII PGM/PPM (default for stdout)
379
380         +opw  --write-16-bit-pnm
381                 write 16-bit ASCII PGM/PPM
382
383         +opn  --write-n-bit-pnm  [n]umber: integer
384                 write n-bit ASCII PGM/PPM (1..32)
385
386         +ob   --write-bmp
387                 write 8-bit (monochrome) or 24-bit (color) BMP
388
389         +obp  --write-8-bit-bmp
390                 write 8-bit palette BMP (monochrome only)
391
392         +obt  --write-24-bit-bmp
393                 write 24-bit truecolor BMP
394
395         +obr  --write-32-bit-bmp
396                 write 32-bit truecolor BMP
397
398         +ot   --write-tiff
399                 write 8-bit (monochrome) or 24-bit (color) TIFF
400
401         +on   --write-png
402                 write 8-bit (monochrome) or 24-bit (color) PNG
403
404         +oj   --write-jpeg
405                 write 8-bit lossy JPEG (baseline)
406

NOTES

408       The following preferred interpolation algorithms can be selected  using
409       the --interpolate option:
410
411       · 1 = free scaling algorithm with interpolation from pbmplus toolkit
412       · 2 = free scaling algorithm with interpolation from c't magazine
413       · 3  =  magnification algorithm with bilinear interpolation from Eduard
414         Stanescu
415       · 4 = magnification algorithm with bicubic  interpolation  from  Eduard
416         Stanescu
417       The   --write-tiff  option  is  only  available  when  DCMTK  has  been
418       configured and compiled with support  for  the  external  libtiff  TIFF
419       library.  The  availability  of the TIFF compression options depends on
420       the libtiff configuration. In particular, the  patented  LZW  algorithm
421       may not be available.
422       The --write-png option is only available when DCMTK has been configured
423       and compiled with support for the external libpng PNG  library.  Option
424       --interlace  enables progressive image view while loading the PNG file.
425       Only a few applications take care of the meta  info  (TEXT)  in  a  PNG
426       file.

TRANSFER SYNTAXES

428       dcmj2pnm  supports  the following transfer syntaxes for input (dcmfile-
429       in):
430       LittleEndianImplicitTransferSyntax             1.2.840.10008.1.2
431       LittleEndianExplicitTransferSyntax             1.2.840.10008.1.2.1
432       DeflatedExplicitVRLittleEndianTransferSyntax   1.2.840.10008.1.2.1.99 (*)
433       BigEndianExplicitTransferSyntax                1.2.840.10008.1.2.2
434       JPEGProcess1TransferSyntax                     1.2.840.10008.1.2.4.50
435       JPEGProcess2_4TransferSyntax                   1.2.840.10008.1.2.4.51
436       JPEGProcess6_8TransferSyntax                   1.2.840.10008.1.2.4.53
437       JPEGProcess10_12TransferSyntax                 1.2.840.10008.1.2.4.55
438       JPEGProcess14TransferSyntax                    1.2.840.10008.1.2.4.57
439       JPEGProcess14SV1TransferSyntax                 1.2.840.10008.1.2.4.70
440       RLELosslessTransferSyntax                      1.2.840.10008.1.2.5
441       (*) if compiled with zlib support enabled

LOGGING

443       The level of logging output of  the  various  command  line  tools  and
444       underlying  libraries  can  be  specified by the user. By default, only
445       errors and warnings are written to the  standard  error  stream.  Using
446       option  --verbose  also  informational messages like processing details
447       are reported. Option --debug can be used to get  more  details  on  the
448       internal  activity,  e.g.  for debugging purposes. Other logging levels
449       can be selected using option --log-level. In --quiet  mode  only  fatal
450       errors  are reported. In such very severe error events, the application
451       will usually terminate. For  more  details  on  the  different  logging
452       levels, see documentation of module 'oflog'.
453       In  case  the logging output should be written to file (optionally with
454       logfile rotation), to syslog (Unix) or the event log  (Windows)  option
455       --log-config  can  be  used.  This  configuration  file also allows for
456       directing only certain messages to a particular output stream  and  for
457       filtering  certain  messages  based  on the module or application where
458       they are generated.  An  example  configuration  file  is  provided  in
459       <etcdir>/logger.cfg).

COMMAND LINE

461       All  command  line  tools  use  the  following notation for parameters:
462       square brackets enclose optional  values  (0-1),  three  trailing  dots
463       indicate  that multiple values are allowed (1-n), a combination of both
464       means 0 to n values.
465       Command line options are distinguished from parameters by a leading '+'
466       or  '-' sign, respectively. Usually, order and position of command line
467       options are arbitrary (i.e. they  can  appear  anywhere).  However,  if
468       options  are  mutually exclusive the rightmost appearance is used. This
469       behaviour conforms to the standard  evaluation  rules  of  common  Unix
470       shells.
471       In  addition,  one  or more command files can be specified using an '@'
472       sign as a prefix to the filename (e.g. @command.txt).  Such  a  command
473       argument  is  replaced  by  the  content of the corresponding text file
474       (multiple whitespaces are treated as a  single  separator  unless  they
475       appear  between  two  quotation marks) prior to any further evaluation.
476       Please note that a command file cannot contain  another  command  file.
477       This   simple   but  effective  approach  allows  to  summarize  common
478       combinations of options/parameters and  avoids  longish  and  confusing
479       command lines (an example is provided in file <datadir>/dumppat.txt).

ENVIRONMENT

481       The  dcmj2pnm  utility  will  attempt  to  load DICOM data dictionaries
482       specified in the DCMDICTPATH environment variable. By default, i.e.  if
483       the   DCMDICTPATH   environment   variable   is   not   set,  the  file
484       <datadir>/dicom.dic will be loaded unless the dictionary is built  into
485       the application (default for Windows).
486       The   default   behaviour  should  be  preferred  and  the  DCMDICTPATH
487       environment variable only used when alternative data  dictionaries  are
488       required.  The  DCMDICTPATH environment variable has the same format as
489       the Unix shell PATH variable in that a colon (':')  separates  entries.
490       On  Windows systems, a semicolon (';') is used as a separator. The data
491       dictionary code will  attempt  to  load  each  file  specified  in  the
492       DCMDICTPATH  environment variable. It is an error if no data dictionary
493       can be loaded.

FILES

495       <datadir>/camera.lut - sample characteristics file of a camera
496       <datadir>/monitor.lut - sample characteristics file of a monitor
497       <datadir>/printer.lut - sample characteristics file of a printer
498       <datadir>/scanner.lut - sample characteristics file of a scanner

SEE ALSO

500       dcm2pnm(1), img2dcm(1)
502       Copyright (C) 2001-2010 by OFFIS e.V., Escherweg  2,  26121  Oldenburg,
503       Germany.
504
505
506
507Version 3.6.0                     6 Jan 2011                       dcmj2pnm(1)
Impressum