Page 1 of 1

window saving mode in python script

Posted: Tue Jun 21, 2011 8:20 am
by joly
Dear All,
I am running my python script in the console iPython shell lauched in anatomist in order to get a snapshot of my window :

Code: Select all

a.execute( 'WindowConfig', windows=[winR],cursor_visibility=0)
a.execute( 'WindowConfig', windows=[winR], snapshot='Rtopfilenamesnap.png')
and this is already great. :)
However, I would rather prefer to get the *-rgba.png as you get it when
selecting the 'RGBA buffer' in the 'window saving mode' through the GUI Scene --> Tools --> Window saving modes.
But ideally I would like to set this parameter in my python script, is it possible ?
Many thanks
Olivier

Re: window saving mode in python script

Posted: Tue Jun 21, 2011 8:54 am
by Dominique Geffroy
Hi,

I don't think it is possible to change this option through this python API. You can find the available option for WindowConfig command here : http://brainvisa.info/doc/anatomist/htm ... onfig.html
Anyway, maybe you could change this option in Anatomist once and for all and save the options with Settings -> save preferences menu.

Dominique

Re: window saving mode in python script

Posted: Fri Jun 24, 2011 8:41 am
by Dominique Geffroy
In fact, I made a mistake, it is not possible to save this option in the global settings, the option is only related to the current window.
But it is possible to change it in a python script if you use the direct bindings implementation of pyanatomist (the default one in ipython shell started from anatomist).
Here is the script:

Code: Select all

import anatomist.api as ana
a=ana.Anatomist()
w=a.createWindow("Axial")
v=w.view()
v.setOtherBuffersSaveMode(0) # to unselect previous saving mode
v.setOtherBuffersSaveMode(4) # to select RGBA mode