DEMO TO CREATE ANIMATED GIFS FROM NEURON Alain Destexhe Department of Physiology, Laval University, Quebec G1K 7P4, Canada Present address: CNRS, UNIC (Bat-33), Avenue de la Terrasse, 91198 Gif-sur-Yvette, France Destexhe@iaf.cnrs-gif.fr http://cns.iaf.cnrs-gif.fr This package is running with the NEURON simulation program written by Michael Hines and available on internet at: http://www.neuro.duke.edu/neuron/home.html The package illustrates how to create animated gif movies from NEURON. The example taken generates an animation of the somato-dendritic profile of membrane potential in a model of thalamic reticular neuron, relative to the paper: Destexhe A, Contreras D, Steriade M, Sejnowski TJ and Huguenard JR. In vivo, in vitro and computational analysis of dendritic calcium currents in thalamic reticular neurons. Journal of Neuroscience 16: 169-185, 1996. (see http://cns.iaf.cnrs-gif.fr in "publications") SYSTEM REQUIREMENTS =================== Animated gifs can be played using the browser Netscape. To generate animated gifs from NEURON, additional packages must be installed besides those already present in NEURON: 1. ghostscript Ghostscript is a public-domain postscript interpreter available at many sites deserving gnu licenses. See for example: http://www.cs.wisc.edu/~ghost ftp://prep.ai.mit.edu/pub/gnu/ 2. pstopnm and ppmtogif The scripts pstopnm and ppmtogif are part of the PBMplus and Netpbm packages (freely available). pstopnm uses ghostscript to transform postscript files into ppm format. The transformation to gif is then made using ppmtogif. For more details see: http://www-bioeng.ucsd.edu/~fvetter/misc/postscript-faq.txt http://www.cs.ucsb.edu/Facilities/Software/netpbm.html http://toons.cs.ucsb.edu:4080/man?pstopnm http://toons.cs.ucsb.edu:4080/man?ppmtogif The Netpbm package can be obtained at: ftp://ftp.cs.ubc.ca/ftp/archive/netpbm/ A copy of the pstopnm script can also be downloaded at: http://cns.iaf.cnrs-gif.fr/files/pstopnm 2. whirlgif Whirlgif is a publically-available program that combines gif frames into an animated gif file. The source code of this program is available at: http://www.msg.net/utility/whirlgif http://eigen.ee.ualberta.ca/ftp/hpux/Networking/WWW/whirlgif-2.01/whirlgif-2.01-ss-10.20.tar.gz PROCEDURE ========= Creating an animated gif movie from NEURON simulations can be done in the following steps: (a) save NEURON plots as postscript; (b) convert postscript images into gif; (c) encode the gif files into an animated gif. Steps (a) and (b) can be done in NEURON if the commands "pstopnm" and "ppmtogif" are available. This is what shows the demo called "re80gif.oc". The demo creates a series of successive gif frames from a NEURON simulation and name them: 0000.gif, 0001.gif, 0002.gif, ... To run this demo, do the following: - enter the command "special re80gif.oc -" - set "Shape Style" to "Show Diam" in the shapeplot (the "v" can be moved outside the plot using "move text" if needed) - set the shapeplot in "Shape Plot" mode - click on "run" The program will create a bunch of frames in a directory called "frames". Generating the animated gif movie from the frames (step c) can be done using the "whirlgif" program; enter the command: whirlgif frames/* > dendritRE.gif The program will create an animated gif file called "dendritRE.gif" of the NEURON simulation. This movie file can be viewed at: http://cns.iaf.cnrs-gif.fr/files/dendritRE.gif (see documentation of whirlgif for details on how to change the parameters of the movie) At the end, destroy the gif frames which are not needed anymore MOVIES USING THE WINDOW MANAGER =============================== More sophisticate animations can be done using the print-window-manager (PWM). In this case, uncomment the appropriate commands in the oc file (replace the "g[sh].printfile..." by "print_session..." command). Then start the program and select/arrange windows as desired on the paper icon of the PWM. Then run the program as above, the difference is that each frame will contain the complete set of windows as arranged by the user. (this allows for instance to generate movies where both shape plot and time plots appear - see examples in http://cns.iaf.cnrs-gif.fr) CONDITIONS AND TROUBLESHOOTING ============================== This demo is provided "as is" and is of free access - if you experience problems installing ghostscript, pstopnm, ppmtogif or whirlgif, please refer directly to the authors of these programs. If these commands are properly installed, the demo should work straight. If you notice platform-specific problems, please send me a note, so that I can maintain a list of installation instructions if needed. Alain Destexhe CNRS, UNIC (Bat-33), Avenue de la Terrasse, 91198 Gif-sur-Yvette, France email: Destexhe@iaf.cnrs-gif.fr http://cns.iaf.cnrs-gif.fr Thanks to John Huguenard (Stanford University) who created a preliminary version of this program.