![]() |
![]()
| ![]() |
![]()
NAMEdcmicmp - Compare DICOM images and compute difference metrics SYNOPSISdcmicmp [options] dcmfile-in-1 dcmfile-in-2 DESCRIPTIONThe dcmicmp utility reads two DICOM images, an original 'reference image' and a post-processed 'test image', to which some kind of processing such as a lossy image compression, followed by decompression, has been applied. This tool requires that both images have the same resolution, the same number of frames and are either both color or monochrome. Compressed images are not supported. The dcmicmp utility then compares both images and computes and prints metrics that describe how similar or different both images are:
All metrics are computed as defined in R.C. Gonzalez and R.E. Woods, 'Digital Image Processing,' Prentice Hall 2008. PARAMETERSdcmfile-in-1 Reference DICOM image file for comparison dcmfile-in-2 Test DICOM image file for comparison ("-" for stdin) OPTIONSgeneral options
input optionsinput file format: image processing optionsmodality LUT transformation: image comparison metrics options
output options
NOTESgrayscale display pipelineMonochrome DICOM images require that a multi-stage display pipeline is executed in order to convert the raw pixel values to the so-called presentation values (p-values) that are sent to the (possibly calibrated) display. When comparing the similarity of images before and after post-processing, it can be relevant to activate some stages of this display pipeline before calculating the difference image and metrics. The image processing options allow the caller to either activate or deactivate the Modality LUT, VOI LUT and Presentation LUT transformations. In any case, the same transformation is applied to both images, although possibly with different parameters if for example the 'first VOI LUT window' stored in each image is applied. This assumes that the post-processing algorithm (e.g. compression algorithm) has adapted the values of such windows during compression such that the image display after applying the window is as close as possible to the reference. For images with more than 8 bits/sample it may be important to known which VOI LUT transformation will be applied by the user when viewing the image, because this may affect the perceived image quality. Therefore, absolute Window parameters can also be given with the --set-window option, which will then be applied to both images. suitability of images for diagnostic purposesThe user should also note that the metrics computed by this tool cannot predict or estimate the suitability of lossy compressed image for diagnostic purposes. Much more complex image processing and an understanding of the image content (e.g. body part) would be needed for this purpose. The metrics computed provide an estimation of the level of distortion caused by the post-processing - no more and no less. TRANSFER SYNTAXESdcmicmp supports the following transfer syntaxes for input: LittleEndianImplicitTransferSyntax 1.2.840.10008.1.2 LittleEndianExplicitTransferSyntax 1.2.840.10008.1.2.1 DeflatedExplicitVRLittleEndianTransferSyntax 1.2.840.10008.1.2.1.99 (*) BigEndianExplicitTransferSyntax 1.2.840.10008.1.2.2 The difference image file is always written in Little Endian Implicit Transfer Syntax. (*) if compiled with zlib support enabled LOGGINGThe level of logging output of the various command line tools and underlying libraries can be specified by the user. By default, only errors and warnings are written to the standard error stream. Using option --verbose also informational messages like processing details are reported. Option --debug can be used to get more details on the internal activity, e.g. for debugging purposes. Other logging levels can be selected using option --log-level. In --quiet mode only fatal errors are reported. In such very severe error events, the application will usually terminate. For more details on the different logging levels, see documentation of module 'oflog'. In case the logging output should be written to file (optionally with logfile rotation), to syslog (Unix) or the event log (Windows) option --log-config can be used. This configuration file also allows for directing only certain messages to a particular output stream and for filtering certain messages based on the module or application where they are generated. An example configuration file is provided in <etcdir>/logger.cfg. COMMAND LINEAll command line tools use the following notation for parameters: square brackets enclose optional values (0-1), three trailing dots indicate that multiple values are allowed (1-n), a combination of both means 0 to n values. Command line options are distinguished from parameters by a leading '+' or '-' sign, respectively. Usually, order and position of command line options are arbitrary (i.e. they can appear anywhere). However, if options are mutually exclusive the rightmost appearance is used. This behavior conforms to the standard evaluation rules of common Unix shells. In addition, one or more command files can be specified using an '@' sign as a prefix to the filename (e.g. @command.txt). Such a command argument is replaced by the content of the corresponding text file (multiple whitespaces are treated as a single separator unless they appear between two quotation marks) prior to any further evaluation. Please note that a command file cannot contain another command file. EXIT CODESThe dcmicmp utility uses the following exit codes when terminating. This enables the user to check for the reason why the application terminated. generalEXITCODE_NO_ERROR 0 EXITCODE_COMMANDLINE_SYNTAX_ERROR 1 input/output file errorsEXITCODE_INVALID_INPUT_FILE 22 EXITCODE_CANNOT_WRITE_OUTPUT_FILE 40 image processing errorsEXITCODE_INITIALIZE_DIFF_IMAGE 80 EXITCODE_DISPLAY_PIPELINE 81 EXITCODE_IMAGE_COMPARISON 82 error codes for exceeded limitsEXITCODE_LIMIT_EXCEEDED_MAX_ERROR 90 EXITCODE_LIMIT_EXCEEDED_MAE 91 EXITCODE_LIMIT_EXCEEDED_RMSE 92 EXITCODE_LIMIT_EXCEEDED_PSNR 93 EXITCODE_LIMIT_EXCEEDED_SNR 94 ENVIRONMENTThe dcmicmp utility will attempt to load DICOM data dictionaries specified in the DCMDICTPATH environment variable. By default, i.e. if the DCMDICTPATH environment variable is not set, the file <datadir>/dicom.dic will be loaded unless the dictionary is built into the application (default for Windows). The default behavior 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 Unix shell PATH variable in that a colon (':') separates entries. On Windows systems, a semicolon (';') is used as a separator. 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. SEE ALSOdcm2pnm(1) COPYRIGHTCopyright (C) 2018-2024 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
|