
Hi Stu, To find out about Python functions that control volume display in Chimera that you could use from your Tkinter gui take a look at the Chimera Python scripts web page: http://plato.cgl.ucsf.edu/trac/chimera/wiki/Scripts <http://plato.cgl.ucsf.edu/trac/chimera/wiki/Scripts> for example the readvol.py example shows how to access volume data values. In Python you can make use of commands that would be normally typed at the Chimera command-line in the following way from chimera import runCommand runCommand(‘volume #0 level 12.5 color pink’) or you could directly call functions in Python that change volume display, for example, import VolumeViewer as vv v0 = vv.volume_list()[0] v0.set_parameters(surface_levels = [12.5], surface_colors = [(1,.5,.5,1)]) To find those functions you can look at the Chimera Volume class Python code in your Chimera distribution chimera/share/VolumeViewer/volume.py (on Mac in Chimera.app/Contents/Resources/share/VolumeViewer/volume.py), and you can look at how the Chimera “volume” command does it chimera/share/VolumeViewer/volumecommand.py For making a Tk GUI look at a simple example in the Chimera distribution, for example, the values at atom positions dialog chimera/share/AtomDensity/gui.py Tom
On Mar 6, 2015, at 12:16 PM, hy liao wrote:
Hi, I am developing a GUI with Tkinter, using anaconda's python 2.7.9. I like how chimera displays volumes (density maps), so I would like to a chimera-volume-display in my GUI. I am now disregarding anaconda and developing all within chimera's IDLE. However, I do not know which chimera commands I could use for my purpose; could you please point to some choices?
I am new with developing chimera extension and tkinter, and I mostly look for code examples. I had a look at http://www.cgl.ucsf.edu/chimera/docs/ProgrammersGuide/Examples/ <http://www.cgl.ucsf.edu/chimera/docs/ProgrammersGuide/Examples/>, "Working with the Chimera Extension Manager," but I do not know which commands I could use to have chimera display a volume in a grid of my GUI.
Thanks! Stu _______________________________________________ Chimera-dev mailing list Chimera-dev@cgl.ucsf.edu http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev