window saving mode in python script

Questions about Anatomist manipulation

Moderators: denghien, riviere

Post Reply
joly
Posts: 3
Joined: Tue Apr 20, 2004 10:14 am
Location: Institute of Neuroscience
Contact:

window saving mode in python script

Post 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
Dominique Geffroy
Site Admin
Posts: 161
Joined: Thu Mar 01, 2007 4:22 pm
Location: IFR 49 - Neurospin, Gif-sur-Yvette, France
Contact:

Re: window saving mode in python script

Post 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
Dominique Geffroy
Site Admin
Posts: 161
Joined: Thu Mar 01, 2007 4:22 pm
Location: IFR 49 - Neurospin, Gif-sur-Yvette, France
Contact:

Re: window saving mode in python script

Post 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
Post Reply