http://www.vanelburg.net/neuronforum/Movie23.gif
http://www.vanelburg.net/neuronforum/VmMovie23.gif
Thanks Ted!
I combined elements of your second suggestion with elements of Destexhe's solution.
So first I created a function for plotting to eps:
Code: Select all
stillno=0
objref mySpacePlot
func printspaceplot(){
sprint(epsfilename,"SpaceplotsEPS/still_%08d.eps",stillno)
stillno=stillno+1
mySpacePlot.printfile(epsfilename)
return 1
}
where mySpacePlot is an object reference to a plot stored in a session file, where at the appropriate positrion I added
.
Now by overwriting it change the standard run system step procedure to:
Code: Select all
start_recording=0
stop_recording=tstop
proc step() {local i
if (using_cvode_) {
advance()
}else for i=1,nstep_steprun {
advance()
}
Plot()
// Added code is below
if(t >= start_recording && t < stop_recording){
printspaceplot()
}
}
Then under cygwin I used two bash scripts to convert the whole stack of eps files, first to a stack of gif files and then to a single gif-movie.
Code: Select all
#!/bin/bash
OLDPATH=$PATH
echo $OLDPATH
PATH=$PATH:"/cygdrive/c/Program\ Files/ImageMagick-6.3.3-Q16":"C:\cygwin\bin"
# Convert all eps files in the directory to gif files
cd SpaceplotsEPS
../convertall.sh eps gif
cd ..
# Convert still*.gif files in the directory to a single gif movie
convert -delay 2 SpaceplotsEPS/still*.gif -loop 0 Movie/Movie01.gif
#For short movies you can print all individual pictures combined in a single picture
# montage Movie/Movie01.gif -coalesce Movie/coalesce_Movie01.gif
PATH=$OLDPATH
exit 0
Code: Select all
#!/bin/bash
# convertall.sh: convert file format
#
# convertall old_extension new_extension
#
# Example:
# To convert all *.gif files in working directory to *.jpg,
# convertall gif jpg
E_BADARGS=65
case $# in
0|1) # The vertical bar means "or" in this context.
echo "Usage: `basename $0` old_file_suffix new_file_suffix"
exit $E_BADARGS # If 0 or 1 arg, then bail out.
;;
esac
for filename in *.$1
# Traverse list of files ending with 1st argument.
do
echo convert: $filename ${filename%$1}$2
convert $filename ${filename%$1}$2
done
exit 0
To make all of this work ImageMagick should be installed (I used the Q16 windows dll version) and ImageMagick needs ghostscript for conversion of eps to gif (Under XP AFPL ghostscript worked fine for me), but see Ted's second link. Also all the eps files should be numbered padded with zeros at the beginning to get them in the movie in the right order (i.e. still001.eps and still010.eps as opposed to still1.eps and still10.eps).
Depending on your configuration you might need to set the PATH variable in the bash shell script.