public
Created

  • Download Gist
convert_rename_VHF.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12
a=1
folder=$@
target_folder=YOUR_TARGET_FOLDER_TO_PLACE_TIF
mkdir $target_folder/$folder
cd ./$folder
for i in $(ls *.dcm)
do
new=$(printf "%04d.tif" ${a}) #04 pad to length of 4
convert ${i} -auto-level -depth 8 -normalize -resize 50% ${new}
mv ${new} $target_folder/$folder
let a=a+1
done

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.