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

NAME

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

SYNOPSIS

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

DESCRIPTION

13       The  dcmj2pnm  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, JPEG (Joint  Photographic  Experts  Group)  or  Windows  BMP
17       format.  This  utility  supports  uncompressed  as well as JPEG and RLE
18       compressed DICOM images.
19

PARAMETERS

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

OPTIONS

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 (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       color space conversion (compressed images only):
145
146         +cp   --conv-photometric
147                 convert if YCbCr photometric interpretation (default)
148
149         +cl   --conv-lossy
150                 convert YCbCr to RGB if lossy JPEG
151
152         +cg   --conv-guess
153                 convert to RGB if YCbCr is guessed by library
154
155         +cgl  --conv-guess-lossy
156                 convert to RGB if lossy JPEG and YCbCr is
157                 guessed by the underlying JPEG library
158
159         +ca   --conv-always
160                 always convert YCbCr to RGB
161
162         +cn   --conv-never
163                 never convert color space
164
165       modality LUT transformation:
166
167         -M    --no-modality
168                 ignore stored modality LUT transformation
169
170         +M    --use-modality
171                 use modality LUT transformation (default)
172
173       VOI LUT transformation:
174
175         -W    --no-windowing
176                 no VOI windowing (default)
177
178         +Wi   --use-window  [n]umber: integer
179                 use the n-th VOI window from image file
180
181         +Wl   --use-voi-lut  [n]umber: integer
182                 use the n-th VOI look up table from image file
183
184         +Wm   --min-max-window
185                 compute VOI window using min-max algorithm
186
187         +Wn   --min-max-window-n
188                 compute VOI window using min-max algorithm,
189                 ignoring extreme values
190
191         +Wr   --roi-min-max-window  [l]eft [t]op [w]idth [h]eight: integer
192                 compute ROI window using min-max algorithm,
193                 region of interest is specified by l,t,w,h
194
195         +Wh   --histogram-window  [n]umber: integer
196                 compute VOI window using Histogram algorithm,
197                 ignoring n percent
198
199         +Ww   --set-window  [c]enter [w]idth: float
200                 compute VOI window using center c and width w
201
202         +Wfl  --linear-function
203                 set VOI LUT function to LINEAR
204
205         +Wfs  --sigmoid-function
206                 set VOI LUT function to SIGMOID
207
208       presentation LUT transformation:
209
210         +Pid  --identity-shape
211                 set presentation LUT shape to IDENTITY
212
213         +Piv  --inverse-shape
214                 set presentation LUT shape to INVERSE
215
216         +Pod  --lin-od-shape
217                 set presentation LUT shape to LIN OD
218
219       overlay:
220
221         -O    --no-overlays
222                 do not display overlays
223
224         +O    --display-overlay  [n]umber: integer
225                 display overlay n (0..16, 0=all, default: +O 0)
226
227         +Omr  --ovl-replace
228                 use overlay mode "Replace"
229                 (default for Graphic overlays)
230
231         +Omt  --ovl-threshold
232                 use overlay mode "Threshold Replace"
233
234         +Omc  --ovl-complement
235                 use overlay mode "Complement"
236
237         +Omv  --ovl-invert
238                 use overlay mode "Invert Bitmap"
239
240         +Omi  --ovl-roi
241                 use overlay mode "Region of Interest"
242                 (default for ROI overlays)
243
244         +Osf  --set-foreground  [d]ensity: float
245                 set overlay foreground density (0..1, default: 1)
246
247         +Ost  --set-threshold  [d]ensity: float
248                 set overlay threshold density (0..1, default: 0.5)
249
250       display LUT transformation:
251
252         +Dm   --monitor-file  [f]ilename: string
253                 calibrate output according to monitor characteristics
254                 defined in f
255
256         +Dp   --printer-file  [f]ilename: string
257                 calibrate output according to printer characteristics
258                 defined in f
259
260         +Da   --ambient-light  [a]mbient light: float
261                 ambient light value (cd/m^2, default: file f)
262
263         +Di   --illumination  [i]llumination: float
264                 illumination value (cd/m^2, default: file f)
265
266         +Dn   --min-density  [m]inimum optical density: float
267                 Dmin value (default: off, only with +Dp)
268
269         +Dx   --max-density  [m]aximum optical density: float
270                 Dmax value (default: off, only with +Dp)
271
272         +Dg   --gsd-function
273                 use GSDF for calibration (default for +Dm/+Dp)
274
275         +Dc   --cielab-function
276                 use CIELAB function for calibration
277
278       compatibility:
279
280         +Ma   --accept-acr-nema
281                 accept ACR-NEMA images without photometric
282                 interpretation
283
284         +Mp   --accept-palettes
285                 accept incorrect palette attribute tags
286                 (0028,111x) and (0028,121x)
287
288         +Mc   --check-lut-depth
289                 check 3rd value of the LUT descriptor, compare
290                 with expected bit depth based on LUT data
291
292         +Mm   --ignore-mlut-depth
293                 ignore 3rd value of the modality LUT descriptor,
294                 determine bits per table entry automatically
295
296         +Mv   --ignore-vlut-depth
297                 ignore 3rd value of the VOI LUT descriptor,
298                 determine bits per table entry automatically
299
300       TIFF format:
301
302         +Tl   --compr-lzw
303                 LZW compression (default)
304
305         +Tr   --compr-rle
306                 RLE compression
307
308         +Tn   --compr-none
309                 uncompressed
310
311         +Pd   --predictor-default
312                 no LZW predictor (default)
313
314         +Pn   --predictor-none
315                 LZW predictor 1 (no prediction)
316
317         +Ph   --predictor-horz
318                 LZW predictor 2 (horizontal differencing)
319
320         +Rs   --rows-per-strip  [r]ows: integer (default: 0)
321                 rows per strip, default 8K per strip
322
323       PNG format:
324
325         +il   --interlace
326                 create interlaced file (default)
327
328         -il   --nointerlace
329                 create non-interlaced file
330
331         +mf   --meta-file
332                 create PNG file meta information (default)
333
334         -mf   --meta-none
335                 no PNG file meta information
336
337       JPEG format:
338
339         +Jq   --compr-quality  [q]uality: integer (0..100, default: 90)
340                 quality value for compression (in percent)
341
342         +Js4  --sample-444
343                 4:4:4 sampling (no subsampling)
344
345         +Js2  --sample-422
346                 4:2:2 subsampling (horizontal subsampling of
347                 chroma components, default)
348
349         +Js1  --sample-411
350                 4:1:1 subsampling (horizontal and vertical
351                 subsampling of chroma components)
352
353       other transformations:
354
355         +G    --grayscale
356                 convert to grayscale if necessary
357
358         +P    --change-polarity
359                 change polarity (invert pixel output)
360
361         +C    --clip-region  [l]eft [t]op [w]idth [h]eight: integer
362                 clip image region (l, t, w, h)
363
364   output options
365       general:
366
367         -im   --image-info
368                 print image details (requires verbose mode)
369
370         -o    --no-output
371                 do not create any output (useful with -im)
372
373       filename generation (only with --frame-range or --all-frames):
374
375         +Fc   --use-frame-counter
376                 use 0-based counter for filenames (default)
377
378         +Fn   --use-frame-number
379                 use absolute frame number for filenames
380
381       image format:
382
383         +op   --write-raw-pnm
384                 write 8-bit binary PGM/PPM (default for files)
385
386         +opb  --write-8-bit-pnm
387                 write 8-bit ASCII PGM/PPM (default for stdout)
388
389         +opw  --write-16-bit-pnm
390                 write 16-bit ASCII PGM/PPM
391
392         +opn  --write-n-bit-pnm  [n]umber: integer
393                 write n-bit ASCII PGM/PPM (1..32)
394
395         +ob   --write-bmp
396                 write 8-bit (monochrome) or 24-bit (color) BMP
397
398         +obp  --write-8-bit-bmp
399                 write 8-bit palette BMP (monochrome only)
400
401         +obt  --write-24-bit-bmp
402                 write 24-bit truecolor BMP
403
404         +obr  --write-32-bit-bmp
405                 write 32-bit truecolor BMP
406
407         +ot   --write-tiff
408                 write 8-bit (monochrome) or 24-bit (color) TIFF
409
410         +on   --write-png
411                 write 8-bit (monochrome) or 24-bit (color) PNG
412
413         +on2  --write-16-bit-png
414                 write 16-bit (monochrome) or 48-bit (color) PNG
415
416         +oj   --write-jpeg
417                 write 8-bit lossy JPEG (baseline)
418

NOTES

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

TRANSFER SYNTAXES

440       dcmj2pnm  supports  the following transfer syntaxes for input (dcmfile-
441       in):
442       LittleEndianImplicitTransferSyntax             1.2.840.10008.1.2
443       LittleEndianExplicitTransferSyntax             1.2.840.10008.1.2.1
444       DeflatedExplicitVRLittleEndianTransferSyntax   1.2.840.10008.1.2.1.99 (*)
445       BigEndianExplicitTransferSyntax                1.2.840.10008.1.2.2
446       JPEGProcess1TransferSyntax                     1.2.840.10008.1.2.4.50
447       JPEGProcess2_4TransferSyntax                   1.2.840.10008.1.2.4.51
448       JPEGProcess6_8TransferSyntax                   1.2.840.10008.1.2.4.53
449       JPEGProcess10_12TransferSyntax                 1.2.840.10008.1.2.4.55
450       JPEGProcess14TransferSyntax                    1.2.840.10008.1.2.4.57
451       JPEGProcess14SV1TransferSyntax                 1.2.840.10008.1.2.4.70
452       RLELosslessTransferSyntax                      1.2.840.10008.1.2.5
453       (*) if compiled with zlib support enabled

LOGGING

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

COMMAND LINE

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

ENVIRONMENT

493       The  dcmj2pnm  utility  will  attempt  to  load DICOM data dictionaries
494       specified in the DCMDICTPATH environment variable. By default, i.e.  if
495       the   DCMDICTPATH   environment   variable   is   not   set,  the  file
496       <datadir>/dicom.dic will be loaded unless the dictionary is built  into
497       the application (default for Windows).
498       The   default   behavior   should  be  preferred  and  the  DCMDICTPATH
499       environment variable only used when alternative data  dictionaries  are
500       required.  The  DCMDICTPATH environment variable has the same format as
501       the Unix shell PATH variable in that a colon (':')  separates  entries.
502       On  Windows systems, a semicolon (';') is used as a separator. The data
503       dictionary code will  attempt  to  load  each  file  specified  in  the
504       DCMDICTPATH  environment variable. It is an error if no data dictionary
505       can be loaded.

FILES

507       <datadir>/camera.lut - sample characteristics file of a camera
508       <datadir>/monitor.lut - sample characteristics file of a monitor
509       <datadir>/printer.lut - sample characteristics file of a printer
510       <datadir>/scanner.lut - sample characteristics file of a scanner

SEE ALSO

512       dcm2pnm(1), img2dcm(1)
514       Copyright (C) 2001-2014 by OFFIS e.V., Escherweg  2,  26121  Oldenburg,
515       Germany.
516
517
518
519Version 3.6.2                   Fri Jul 14 2017                    dcmj2pnm(1)
Impressum