Howto: Compare the content of two DICOM files and show the differences

The following Unix shell script compares the content (textual dump) of two DICOM files and shows the differences. This script is based on dcdiff.script from David Clunie's dicom3tools:

#!/bin/sh
 
if [ $# != 2 ]
then
  echo "usage: `basename $0` file1 file2"
  exit 1
fi
 
TMPFILE1=/tmp/`basename $0`.$$.tmp1
TMPFILE2=/tmp/`basename $0`.$$.tmp2
 
dcmdump -q -dc "$1" >"$TMPFILE1" 2>&1
dcmdump -q -dc "$2" >"$TMPFILE2" 2>&1
diff "$TMPFILE1" "$TMPFILE2" | colordiff
 
rm "$TMPFILE1" "$TMPFILE2"
 
exit 0

Note: If colordiff is not available on your system, you can simply remove the “| colordiff” from the script.

 
dcmtk/howto/comparefiles.txt · Last modified: 2012/01/25 09:50 by riesmeier
 
Except where otherwise noted, content on this wiki is licensed under the following license:Public Domain
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Run by Debian Driven by DokuWiki