NAME dcmj2pnm SYNOPSIS dcmj2pnm [options] dcmfile-in [pnmfile-out] SUMMARY The dcmj2pnm utility reads a DICOM image, converts the pixel data according to the selected image processing options and writes back an image in the well-known PPM/PGM file format (portable pix map / portable gray map), Windows BMP, TIFF or JPEG (Joint Photographic Experts Group) format. This utility supports uncompressed as well as JPEG and RLE compressed DICOM images. USAGE dcmj2pnm: Convert DICOM images to PGM, PPM, BMP, TIFF or JPEG usage: dcmj2pnm [options] dcmfile-in [pnmfile-out] parameters: dcmfile-in DICOM input filename to be converted pnmfile-out output filename to be written (default: stdout) general options: -h --help print this help text and exit --version print version information and exit -v --verbose verbose mode, print processing details -q --quiet quiet mode, print no warnings and errors -d --debug debug mode, print debug information -im --image-info info mode, print image details input options: input file format: +f --read-file read file format or data set (default) -f --read-dataset read data set without file meta information input transfer syntax (only with --read-dataset): -t= --read-xfer-auto use TS recognition (default) -te --read-xfer-little read with explicit VR little endian TS -tb --read-xfer-big read with explicit VR big endian TS -ti --read-xfer-implicit read with implicit VR little endian TS image processing options: frame selection: +F --frame [n]umber : integer select specified frame (default: 1) +Fr --frame-range [n]umber [c]ount : integer select c frames beginning with frame n +Fa --all-frames select all frames rotation: +Rl --rotate-left rotate image left (-90 degrees) +Rr --rotate-right rotate image right (+90 degrees) +Rtd --rotate-top-down rotate image top-down (180 degrees) flipping: +Lh --flip-horizontally flip image horizontally +Lv --flip-vertically flip image vertically +Lhv --flip-both-axes flip image horizontally and vertically scaling: +a --recognize-aspect recognize pixel aspect ratio (default) -a --ignore-aspect ignore pixel aspect ratio when scaling +i --interpolate [n]umber of algorithm : integer use interpolation when scaling (1..2, def: 1) -i --no-interpolation no interpolation when scaling -S --no-scaling no scaling, ignore pixel aspect ratio (default) +Sxf --scale-x-factor [f]actor : float scale x axis by factor, auto-compute y axis +Syf --scale-y-factor [f]actor : float scale y axis by factor, auto-compute x axis +Sxv --scale-x-size [n]umber : integer scale x axis to n pixels, auto-compute y axis +Syv --scale-y-size [n]umber : integer scale y axis to n pixels, auto-compute x axis VOI windowing: -W --no-windowing no VOI windowing (default) +Wi --use-window [n]umber : integer use the n-th VOI window from image file +Wl --use-voi-lut [n]umber : integer use the n-th VOI look up table from image file +Wm --min-max-window compute VOI window using min-max algorithm +Wn --min-max-window-n compute VOI window using min-max algorithm, ignoring extreme values +Wr --roi-min-max-window [l]eft [t]op [w]idth [h]eight : integer compute ROI window using min-max algorithm, region of interest is specified by l,t,w,h +Wh --histogram-window [n]umber: integer compute VOI window using Histogram algorithm, ignoring n percent +Ww --set-window [c]enter [w]idth : float compute VOI window using center c and width w presentation LUT transformation: +Pid --identity-shape presentation LUT shape IDENTITY +Piv --inverse-shape presentation LUT shape INVERSE +Pod --lin-od-shape presentation LUT shape LIN OD overlay: -O --no-overlays do not display overlays +O --display-overlay [n]umber : integer display overlay n (0..16, 0=all, default: +O 0) +Omr --ovl-replace use overlay mode "Replace" (default for Graphic overlays) +Omt --ovl-threshold use overlay mode "Threshold-Replace" +Omc --ovl-complement use overlay mode "Complement" +Omi --ovl-roi use overlay mode "Region of Interest" (default for ROI overlays) +Osf --set-foreground [d]ensity : float set overlay foreground density (0..1, def: 1) +Ost --set-threshold [d]ensity : float set overlay threshold density (0..1, def: 0.5) display LUT transformation: +Dm --monitor-file [f]ilename : string calibrate output according to monitor characteristics defined in f +Dp --printer-file [f]ilename : string calibrate output according to printer characteristics defined in f +Da --ambient-light [a]mbient light : float ambient light value (cd/m^2, default: file f) +Di --illumination [i]llumination : float illumination value (cd/m^2, default: file f) +Dg --gsd-function use GSDF for calibration (default for +Dm/+Dp) +Dc --cielab-function use CIELAB function for calibration compatibility options: +Ma --accept-acr-nema accept ACR-NEMA images without photometric interpretation +Mp --accept-palettes accept incorrect palette attribute tags (0028,111x) and (0028,121x) TIFF options: +Tl --compr-lzw LZW compression (default) +Tr --compr-rle RLE compression +Tn --compr-none uncompressed +Pd --predictor-default no LZW predictor (default) +Pn --predictor-none LZW predictor 1 (no prediction) +Ph --predictor-horz LZW predictor 2 (horizontal differencing) +Rs --rows-per-strip [r]ows : integer (default: 0) rows per strip, default 8K per strip JPEG options: +Jq --compr-quality [q]uality : integer (0..100, default: 90) quality value for compression (in percent) +Js4 --sample-444 4:4:4 sampling (no subsampling) +Js2 --sample-422 4:2:2 subsampling (horizontal subsampling of chroma components, default) +Js1 --sample-411 4:1:1 subsampling (horizontal and vertical subsampling of chroma components) other transformations: +G --grayscale convert to grayscale if necessary +P --change-polarity change polarity (invert pixel output) +C --clip-region [l]eft [t]op [w]idth [h]eight : integer clip image region (l, t, w, h) output options: -o --no-output do not create any output (useful with -im) +op --write-raw-pnm write 8-bit binary PGM/PPM (default for files) +opb --write-8-bit-pnm write 8-bit ASCII PGM/PPM (default for stdout) +opw --write-16-bit-pnm write 16-bit ASCII PGM/PPM +opn --write-n-bit-pnm [n]umber : integer write n-bit ASCII PGM/PPM (1..32) +ob --write-bmp write 8-bit (monochrome) or 24-bit (color) BMP +obp --write-8-bit-bmp write 8-bit palette BMP (monochrome only) +obt --write-24-bit-bmp write 24-bit truecolor BMP +ot --write-tiff write 8-bit (monochrome) or 24-bit (color) TIFF +oj --write-jpeg write 8-bit lossy JPEG (baseline) NOTES The --write-tiff option is only available when DCMTK has been configured and compiled with support for the external "libtiff" TIFF library. The availability of the TIFF compression options depends on the libtiff configuration. In particular, the patented LZW algorithm may not be available. Sample monitor and printer characteristics files are available in the folder dcmimgle/tests. ENVIRONMENT The dcmj2pnm utility will attempt to load DICOM data dictionaries specified in the DCMDICTPATH environment variable. By default, if the DCMDICTPATH environment variable is not set, the file /usr/local/dicom/lib/dicom.dic will be loaded. The default behaviour should be preferred and the DCMDICTPATH environment variable only used when alternative data dictionaries are required. The DCMDICTPATH environment variable has the same format as the shell PATH variable in that a colon (":") separates entries. The data dictionary code will attempt to load each file specified in the DCMDICTPATH environment variable. It is an error if no data dictionary can be loaded.