Create a gist now

Instantly share code, notes, and snippets.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment