Last active
October 3, 2015 04:53
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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