Skip to content

Instantly share code, notes, and snippets.

@ravnoor
Last active October 3, 2015 04:53
Show Gist options
  • Save ravnoor/cbef05e16076daa5288d to your computer and use it in GitHub Desktop.
Save ravnoor/cbef05e16076daa5288d to your computer and use it in GitHub Desktop.
Convert PPM images generated by AFNI to readily usable PNG format using Imagemagick
#!/bin/sh
#requires image magick
dir=$1
target_dir=$PWD
for f in $PWD/*.ppm
do
ppm=$(basename -s .ppm $f)
echo $ppm
png=$target_dir/$ppm.png
if [ ! -f $png ]
then
convert $f $png
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment