Keeping windows synchronized under zero gravity mode

Questions about Anatomist manipulation

Moderators: denghien, riviere

Post Reply
User avatar
Grégory Operto
Posts: 18
Joined: Sun Jan 16, 2005 11:00 pm
Location: CEA NeuroSpin, Gif-sur-Yvette, France
Contact:

Keeping windows synchronized under zero gravity mode

Post by Grégory Operto »

Hi everybody,

my question is almost given in the title. I know it is possible to link different windows (using Ctrl+L) to have all of them synchronized when one of them is scrolling and it is really convenient ; now I'd like the windows to keep synchronized when one window is on "zero gravity" (Ctrl + space) mode and that, for instance, a brain is spinning in that window. I'd like indeed to always keep a common point of view from one window to all the others. Pressing 's' all the time does not make it very well...

Is there any secret mode for this ?
Many thanks !
Grégory
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: Keeping windows synchronized under zero gravity mode

Post by riviere »

Hi Grégory,

No I don't think such a thing exist. But I guess it would be quite easy to do, either by modifying the zero-gravity mode control (but it would need an additional key/mouse combination to activate/stop), or by a little program/script.
For instance, this little python prog periodically syncronizes all windows to the first one that is open by the script (run it in ipython -qthread or within a shell opened from anatomist):

Code: Select all

import anatomist.direct.api as ana
import qt
a = ana.Anatomist()
masterwin = a.createWindow( '3D' )
def wsync():
    wins = a.getWindows()
    wquat = masterwin.getInfos()['view_quaternion']
    wins = [ x for x in wins if x != masterwin ]
    a.execute( 'Camera', windows=wins, view_quaternion=wquat )

tim = qt.QTimer()
tim.connect( tim, qt.SIGNAL( 'timeout()' ), wsync )
tim.start( 50, False )
# ...
# now load object(s), put some in the 'masterwin' window, 
# open other windows, put objects in them, 
# now move the masrerwin, or set it to zero-gravity
# ...

# when you're fed up with it, stop:
tim.stop()
Denis
User avatar
Olivier Coulon
Posts: 176
Joined: Fri Feb 27, 2004 11:48 am
Location: MeCA research group, Institut de Neurosciences de La Timone, Marseille, France
Contact:

Re: Keeping windows synchronized under zero gravity mode

Post by Olivier Coulon »

I would like this post as an opportunity to learn more about Ctrl+L. It links windows ina group, but what can we do after this ? I see the group in the main window but there is no specific synchronization. In fact, nothing happens. Am I missing something ?
Olivier
Olivier Coulon
Institut de Neurosciences de La Timone,
Aix-Marseille Université,
Marseille, france
https://meca-brain.org
User avatar
Grégory Operto
Posts: 18
Joined: Sun Jan 16, 2005 11:00 pm
Location: CEA NeuroSpin, Gif-sur-Yvette, France
Contact:

Re: Keeping windows synchronized under zero gravity mode

Post by Grégory Operto »

Hi Olivier,

this link allows to keep windows synchronized when you animate one of them (in particular, when the windows have sliders on the right, you can press 'space' to have the slider scrolling automatically, either on one window, or on all of them if the Ctrl +L mode is on...). Quite useful when you have for instance different subjects on the screen with time textures showing an iterating minimization process, and when you want the iterations to match all the time for one mesh to another.

Greg
User avatar
Olivier Coulon
Posts: 176
Joined: Fri Feb 27, 2004 11:48 am
Location: MeCA research group, Institut de Neurosciences de La Timone, Marseille, France
Contact:

Re: Keeping windows synchronized under zero gravity mode

Post by Olivier Coulon »

But when I create the group and that I turn one brain in one window, the other ones are not synced ... Same if I display axial slices. Do I have to do anything specific ?
By the way, Ctrl+L does not work for me, I have to go to "window->link windows".
Thanks,

olivier
Olivier Coulon
Institut de Neurosciences de La Timone,
Aix-Marseille Université,
Marseille, france
https://meca-brain.org
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: Keeping windows synchronized under zero gravity mode

Post by riviere »

Hi Olivier,
The Crtl-L key doesn't activate the corresponding mode at each time, there must be a little bug somewhere in it. I had it work after using the space key and possibly ctrl-S, then Ctrl-L worked. But I don't know if there is a combination that works all the time. I have to look at the code...
Anyway ctrl-L links the slice cursor with the linked cursor position: behaves as if you clicked on the image when changing slice, so that the position is propagated to other views in the same group. But it doesn't do anything for rotation events.

By the way, I just remembered that there is an option to make 2 windows (but only 2) change view orientation simultaneously: it's the "stereoscopic view" feature that has never been finished nor tested, but that allows to open a second view from a given one, considering it as the "right eye view" (the first one is regarded as the "left eye"). that second view should have an observer position just a bit right of the first one (I don't even remember if this has been programmed or not), and every rotation to the first view orientation is propagated to the second one.

Denis
User avatar
Grégory Operto
Posts: 18
Joined: Sun Jan 16, 2005 11:00 pm
Location: CEA NeuroSpin, Gif-sur-Yvette, France
Contact:

Re: Keeping windows synchronized under zero gravity mode

Post by Grégory Operto »

Hi Denis,

thanks for your help, indeed the Python script works perfectly and is quite handy :P !
In the same time, I finally could add this additional mode in the code of my Anatomist version and it seems to be working.
In the future, I'd like to ask for your advice in order to commit (or not) this option.

Grégory
(I couldn't reproduce the bug you're talking about in your last post.. but in a sense that's a good thing :roll: )
Post Reply