Control of the volume viewer from the command line
Hello all, I am trying to make a movie showing an evolution of an electron density map during an iterative optimization. For each optimization step I have one density map as volume data in xplor format. I depict the maps using the volume viewer, where I can set the number and level of the isosurface thresholds as well as their color. However, each newly opened map opens with default threshold setting, which is not suitable for my purposes. I make the movie using a command file of the type: open density1.xplor movie record wait 10 movie stop close 0 open density2.xplor movie record wait 10 movie stop ... I would need to be able to control the properties of the isosurfaces of the newly opened map from the command line or from the script file, or find a way to preserve the properties set for the first map in all subsequently opened maps. The search in Chimera manual did not lead me anywhere. Could anyone give me a hint how to proceed? With best regards Lukas Lukas Palatinus Laboratoire de Cristallographie EPFL Lausanne Tel.: +41 (0)21 693 0639 mailto: palat@fzu.cz
Hi Lukas, There is no Chimera command to set the volume contour surface threshold or color. We plan on adding this command. For now, I have four suggestions. You can use "Volume Series" tool available on the Chimera Experimental Features web page: http://www.cgl.ucsf.edu/chimera/experimental/experimental.html This page contains plugins that are not yet distributed with Chimera. You download a zip file and put the new directory in with your existing Chimera to use it. The Volume Series tool lets you play a series of volume data sets perserving thershold level and color settings just as you want: http://www.cgl.ucsf.edu/chimera/experimental/volume_series/volume_series.htm... There is no Chimera command for this tool either so to make a movie you would start Movie recorder (menu entry Tools / Utilities / Movie Recorder or use Chimera movie command) then press the Play button on the volume series dialog. A second approach is to use the EMANimator animation tool http://www.cgl.ucsf.edu/chimera/related/emanimator/emanimator.html It is a Chimera extension included with the EMAN single particle reconstruction package. It provides a time-line user interface for composing animations and has a specific capability for playing a sequence of volume data sets just as you want. A third approach is to use some Python code in Chimera to script your movie. This is a bit more complicated than using just Chimera commands. But you can easily use all Chimera commands in a Python script and you additionally can control all of the volume settings. I include an example at the bottom of this email. You simply open the Python file to run the script. A fourth approach is to get the Animation Commands package http://www.cgl.ucsf.edu/chimera/experimental/transition/transition.html from the Chimera experimental features page. It includes a command to change the contour level of a volume map from one value to another over a set number of frames. You could use it to set the contour level. But there is not a command in this package to set the volume color. Tom ------------ Example seriesmovie.py Python script follows. Tested in Chimera 1.2309. directory = '/usr/local/src/chimera-demos/volume/dna_blur' # Volume file location files = ['1enn_00.mrc', '1enn_05.nc', '1enn_10.nc', '1enn_15.nc', '1enn_20.nc', '1enn_25.nc', '1enn_30.nc', '1enn_35.nc', '1enn_40.nc', '1enn_45.nc', '1enn_50.nc'] movie_path = '/usr/local/src/staff/goddard/1enn.mov' threshold = 0.12 color = (.5, .7, 0) # red, green, blue delay = 10 # movie frames per volume def set_volume_threshold_and_color(threshold, rgb): import VolumeViewer d = VolumeViewer.volume_dialog() r = d.focus_region r.set_parameters(surface_levels = [threshold], # Set threshold level. surface_colors = [color]) # Set color rgb or rgba. d.show_region(r, 'surface') from chimera import runCommand runCommand('cd %s' % directory) runCommand('movie record') for filename in files: runCommand('open %s' % filename) set_volume_threshold_and_color(threshold, color) runCommand('wait %d' % delay) runCommand('close #0') runCommand('movie stop') runCommand('movie encode mformat mov output %s' % movie_path)
participants (2)
-
Lukas Palatinus
-
Thomas Goddard