6 if [ "$verbose" = "1" ]; then
7 echo "Compressing $f..."
10 local msg=`clitkImageConvert -i $f -o $f -c`
11 if [ -z "$msg" ]; then
12 raw=`echo $f | sed 's/\.mhd/\.raw/'`
23 files=$(find $input -name "*.mhd" | sort)
25 if ! grep -iq 'LIST' $f; then
26 # process all except 4D files
29 # process only 4D files (just update pointers to new zraw files)
30 # assumes each .RAW in the list has a corresponding .MHD, which
31 # must be compressed separately
32 sed -i 's/\.raw/\.zraw/g' $f
33 if grep -q "CompressedData" $f; then
34 sed -i 's/CompressedData.*/CompressedData = True/' $f
37 echo "CompressedData = True" > $tmp
47 if [ $# -lt 1 -o $# -gt 2 ]; then
48 echo "Invalid params. `basename $0` [-h | --help] for help" 1>&2
52 if [ -n "`echo $@ | grep '\-h\|--help'`" ]; then
53 echo "Usage: `basename $0` {FILE | DIRECTORY | -h | --help | -v}"
57 if [ -n "`echo $@ | grep '\-v'`" ]; then
58 echo Verbose mode : ON
63 if test -d $input; then
64 compress_directory $input
65 elif test -f $input; then
68 echo "Unknow input file type." 1>&2