pycortex
pycortex copied to clipboard
turn off flatmap tilt
In the webgl viewer, functionality was added (in the glrework branch) to tip the flatmap back, such that flatmaps can be viewed at oblique angles. This change has done some very annoying things to the controls for the viewer. The most annoying it is that the controls for the flatmap and for the inflated and fiducial brains are now different. For inflated and fiducial brains, shift + left click + mouse drag moves the brain around the screen in 2D. For flatmaps, it tilts the brain back. This is counter-intuitive and annoying, since in general the purpose of a flatmap is to be viewed flat-on. I believe that this change is also responsible for changing the way light interacts with the flatmap, such that at close zooms, the colors fade to dark as the simulated light changes positions wrt the flatmap. This is not desirable behavior, as it changes the look of the data itself. Finally, it makes the controls unusable when the brain is inflated just past 50% (i.e., when the cuts are just barely displayed on the inflated brain). See behavior in a newly created webgl instance vs the behavior of the controls in www.gallantlab.org/huth2016 (the 2016 paper viewer has the older, more sensible controls).
I think that the tilt functionality should be removed, or at least turned off by default, with an option to turn it on (much like the bumpy flatmap option).
I think there are a couple issues here:
First, regarding the tilt controls, I totally agree. This is something that should be disabled by default with an option to enable. It also seems in recent versions that middle click & drag now tilts by default in the flatmap view.. did it always do that? Anyway it's not great.
Second, regarding controls when the brain is just barely beginning to flatten--that's a different issue, but also something unique to glrework. I think the exact logic of how the controls switch from rotate mode to pan mode was replicated in glrework and not carried over directly from master. We could certainly make that better!
Third, regarding how the lighting changes as you zoom in on the brain. I'm annoyed by that too. And the lighting is different for the left and right hemispheres! It's really obvious when you use bumpy flatmaps. We should figure that one out.
For point (3) james has mentioned that is a bug deep in the bowels of the glrework shader
So tilting is one way to help show the surface geometry. Have you ever considered moving around the light source instead of the camera? Do you think that would help more/less/equally to tilting?
The lighting changes when you "zoom" because you're actually moving the brain while the lights stay static (I believe). And the lighting appeared different for the left and right hemispheres because by default lights were placed between the hemispheres. The latter problem is actually fixed in my new PR.
I would definitely be in favor of adding a control to en/disable tilting (with default set by config).
I think we have been in agreement for a while, I'm just trying to get you to do it =-P I don't have bandwidth right now to get into the bowels of javascript / webgl code,
@jamesgao, correct me if I'm wrong, but I believe originally the lighting model changed for flattened vs other brains such that you could zoom arbitrarily with no dimming. I think this was changed for bumpy flatmaps. Would it be a huge PITA to have that functionality switch with an if statement? Or is it a more fundamental change to the code than just a few lines?