A DICOM file rename utility: dcmmv

dcmmv is a command line utility for renaming DICOM files according to their DICOM attribute values. This makes it possible to rename files that have unrecognizable filenames (like DICOM data exchange DVDs). dcmmv also supports moving files to a new folder structure, so it's easy to rearrange complete filesets by using for example study, series and patient attributes.

 

This is a listing of all supported command line arguments:

dcmmv: Move DICOM file using tag values in path
usage: dcmmv [options] dcmfile-in...
parameters:
  dcmfile-in                    DICOM input file or directory to be moved
general options:
  -h     --help                 print this help text and exit
         --version              print version information and exit
         --arguments            print expanded command line arguments
  -q     --quiet                quiet mode, print no warnings and errors
  -v     --verbose              verbose mode, print processing details
  -d     --debug                debug mode, print debug information
  -ll    --log-level            [l]evel: string constant
                                (fatal, error, warn, info, debug, trace)
                                use level l for the logger
  -lc    --log-config           [f]ilename: string
                                use config file f for the logger
input options:
  loading:
    +M   --load-all             load very long tag values
    -M   --load-short           do not load very long values (default)
    +R   --max-read-length      [b]ytes: integer (1..2147483647, default: 128)
                                set threshold for long values to b bytes
  input file format:
    +f   --read-file            read file format or data set (default)
    +fo  --read-file-only       read file format only
    -f   --read-dataset         read data set without file meta information
  input transfer syntax:
    -t=  --read-xfer-auto       use TS recognition (default)
    -td  --read-xfer-detect     ignore TS specified in the file meta header
    -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
  input files:
    +fl  --from-file-list       read filenames from simple file (dcmfile-in)
    +ff  --from-file            read filenames from filemangler file (dcmfile-in)
    +sd  --scan-directories     scan directories for input files (dcmfile-in)
    +sp  --scan-pattern         [p]attern: string (only with --scan-directories)
                                pattern for filename matching (wildcards)
    -r   --no-recurse           do not recurse within directories (default)
    +r   --recurse              recurse within specified directories
  parsing of file meta information:
    +ml  --use-meta-length      use file meta information group length (default)
    -ml  --ignore-meta-length   ignore file meta information group length
  parsing of odd-length attributes:
    +ao  --accept-odd-length    accept odd length attributes (default)
    +ae  --assume-even-length   assume real length is one byte larger
  handling of non-standard VR:
    +vr  --treat-as-unknown     treat non-standard VR as unknown (default)
    -vr  --assume-implicit      try to read with implicit VR little endian TS
  handling of undefined length UN elements:
    +ui  --enable-cp246         read undefined len UN as implicit VR (default)
    -ui  --disable-cp246        read undefined len UN as explicit VR
  handling of defined length UN elements:
    -uc  --retain-un            retain elements as UN (default)
    +uc  --convert-un           convert to real VR if known
  handling of private max-length elements (implicit VR):
    -sq  --maxlength-dict       read as defined in dictionary (default)
    +sq  --maxlength-seq        read as sequence with undefined length
  general handling of parser errors:
    +Ep  --ignore-parse-errors  try to recover from parse errors
    -Ep  --handle-parse-errors  handle parse errors and stop parsing (default)
  other parsing options:
    +st  --stop-after-elem      [t]ag: "gggg,eeee" or dictionary name
                                stop parsing after element specified by t
  automatic data correction:
    +dc  --enable-correction    enable automatic data correction (default)
    -dc  --disable-correction   disable automatic data correction
  bitstream format of deflated input:
    +bd  --bitstream-deflated   expect deflated bitstream (default)
    +bz  --bitstream-zlib       expect deflated zlib bitstream
output options:
  filesystem options:
    -dr  --dry-run              test run; don't move files or create directories
    -oe  --overwrite-existing   overwrite existing file
    -m   --move-to              [p]ath string
                                move and rename file to [p]; <symbols> allowed
    -md  --move-duplicates-to   [p]ath string; <symbols> allowed
                                move conflicting files to alternative directory [p] if --move-to is not unique
  output path substitution options:
    -sc  --substitution-char    single [c]haracter
                                replace invalid characters in output path with [c] (default '_')
    -sa  --substitute-any       character [s]tring
                                replace all characters [s] in output path with the substitution character
    -sw  --substitute-with      character [s]tring
                                replace all --substitute-any characters in output path with corresponding character in [s]
  text dump options:
    -dp  --dump-path            [p]ath string (default stdout)
                                save text dump to file [p]
    -ds  --dump-spec            [d]ump format string: <symbols> allowed
                                line format specification of text dump
    -dh  --dump-header          [d]ump string: header line
                                optional header line for text dump
    -df  --dump-footer          [d]ump string: footer line
                                optional footer line for text dump
  error handling:
    -E   --stop-on-error        stop after an error (default)
    +E   --ignore-errors        continue with next file after an error

For more information you can contact Paul Groot.

This application uses the dcmtk library offered by Offis.