[chimerax-users] Reproduce exact view

Elaine Meng meng at cgl.ucsf.edu
Mon Feb 10 09:26:05 PST 2020


Hello,
Maybe I’m missing something, but the “view” command allows saving and restoring named views.  These are included in saved session files.  I agree window size is also a factor, so you would make sure to set the same window size too.

E.g. once you have the view you like then use a command like:

view name myview

<http://rbvi.ucsf.edu/chimerax/docs/user/commands/view.html#name>

Then you can save the session file and/or move things around.  Later in the same session or after restoring the previously saved session from file,

view myview

…will restore that view.  Restoring the session restores window size if you have that Window Preference set:
<http://rbvi.ucsf.edu/chimerax/docs/user/preferences.html#window>

or you could have noted the window size when you saved the view:

windowsize

…and then use the reported values later to restore that size, e.g.

windowsize 600 400

<http://rbvi.ucsf.edu/chimerax/docs/user/commands/windowsize.html>

I hope this helps,
Elaine
-----
Elaine C. Meng, Ph.D.
UCSF Chimera(X) team
Department of Pharmaceutical Chemistry
University of California, San Francisco

> On Feb 10, 2020, at 8:53 AM, Alexis Rohou <a.rohou at gmail.com> wrote:
> 
> Hi Christophe,
> 
> I prepare my figures using ChimeraX command (.cxc) scripts and I believe I have a workflow that lets me reproduce exact views. I know it's not 100% robust, but it's reliable enough for me. It basically relies on a sequence of close; windowsize; view matrix; zoom; clip; save.
> 
> Here is a pseudo script. To work out the values you need for the matrices, just move your point of view and your models until you are happy, then do "view matrix".  I have not worked out a good way to get the distances for the clip planes. So I just play with them on the command line until I get the look I want, then save the values in my cxc file.
> 
> Hope this helps & that more experienced users can chime in with improvements.
> 
> Cheers,
> Alexis
> 
> 
> # close anything currently open
> close
> # go to relevant directory
> cd /my/absolute/path
> # 
> windowsize 1200 1200
> camera ortho
> clip near off far off front off back off
> # Open files
> open my_model.pdb name "my model"
> open my_map.mrc name "my map"
> # etc.
> 
> #insert here coloring, styles, for the model/map/background etc
> 
> # Go to your favorite view point, save a shot
> view matrix camera 1,0,0,182.59,0,1,0,229.79,0,0,1,352.89
> zoom 0.33
> clip near off far off front off back off; clip near -100.0 far +100.0 front off back off
> ~select
> save my_figure.png supersample 3 transparentBackground false
> 
> # If you need to move your models
> view matrix models #1,0.91269,-0.0093359,-0.40855,59.153,-0.40865,-0.018906,-0.91249,368.7,0.00079806,0.99977,-0.02107,-44.893,#2,-0.83654,-0.058918,-0.54474,344.52,-0.54355,-0.035951,0.83861,293.33,-0.068993,0.99762,-0.0019503,-42.032
> 
> # then take another shot
> view matrix camera 0.98289,-0.005269,-0.18408,131.07,-0.17421,-0.3506,-0.92018,70.662,-0.059691,0.93651,-0.34553,163.8
> clip near off far off front off back off; clip near -20.0 far +12.0 front off back off
> save Figures/TRPA1_3551_binding_site_details1.png supersample 3 transparentBackground false
> 
> 
> 
> 
> On Sun, Feb 9, 2020 at 10:01 AM Christophe Leterrier <christophe.leterrier at gmail.com> wrote:
> Hi,
> 
> I haven't been able to find how to
> - log
> - set
> - store
> - recall
> 
> a precise view (ie get the same exact image if I do a snapshot). 
> 
> First use case would within the same session (fixed computer, window size, no restart of the application in between). Second use case (more tricky?) would be independently of computer / window size / current session.
> 
> Thanks for your help!
> 
> Christophe




More information about the ChimeraX-users mailing list