Skip to content

Commit

Permalink
dcm2img now determines output format automatically.
Browse files Browse the repository at this point in the history
The output image format is now by default determined from the
file name extension of the given output filename.
Furthermore, refactored the code that handles the (many)
image processing options into functions in order to decrease
the size of the main() routine.
  • Loading branch information
Marco Eichelberg committed Aug 5, 2024
1 parent 6118a39 commit 8fe94d8
Show file tree
Hide file tree
Showing 2 changed files with 691 additions and 412 deletions.
17 changes: 12 additions & 5 deletions dcmapps/docs/dcm2img.man
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ dcm2img [options] dcmfile-in [bitmap-out]
\section dcm2img_description DESCRIPTION

The \b dcm2img 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 PGM/PPM (portable gray map / portable pix map), PNG, TIFF, JPEG
(Joint Photographic Experts Group) or Windows BMP format. This utility
supports uncompressed as well as JPEG, JPEG-LS and RLE compressed DICOM images.
to the selected image processing options and writes back an image in one the
following general purpose image formats: BMP, PGM/PPM, PNG, TIFF, JPEG, or JPEG-LS.
This utility supports uncompressed as well as JPEG, JPEG-LS and RLE compressed DICOM images.

\section dcm2img_parameters PARAMETERS

Expand Down Expand Up @@ -438,8 +437,16 @@ filename generation (only with --frame-range or --all-frames):

image format:

+oa --write-auto
determine file format from filename extension
(default for files)

# if the output filename contains no extension or an
# unknown/unsupported one, a warning is printed an a
# BMP file is written (see --write-bmp).

+op --write-raw-pnm
write 8-bit binary PGM/PPM (default for files)
write 8-bit binary PGM/PPM

+opb --write-8-bit-pnm
write 8-bit ASCII PGM/PPM (default for stdout)
Expand Down
Loading

0 comments on commit 8fe94d8

Please sign in to comment.