help > Scripting show dark/hide bright commands in the gui
Showing 1-3 of 3 posts
Display:
Results per page:
Apr 14, 2021  02:04 AM | nagedem
Scripting show dark/hide bright commands in the gui
Dear Surf-ice users, 

I want to include 'show dark, hide bright' or vice versa ('show bright, hide dark') options in my python script. But I don't know how, is there a way?

Below is part of my script (I am loading so many regional overlay data and don't want them to interfere with each other as colors get translucent):

for i in range(len(regions)):
overlay = os.path.join(subjects_dir, subject, 'surf', 'label_surf_Destrieux_mean', 'lh.thickness.{l}.asc'.format(l=regions))
gl.overlayload(overlay)
gl.overlaycolorname(i+1, 'viridis{n}'.format(n=i))
gl.overlayinvert(i+1,1)
gl.overlayminmax(i+1,0,0)
gl.colorbarvisible(0)


I would appreciate your help!
Apr 14, 2021  01:04 PM | Chris Rorden
RE: Scripting show dark/hide bright commands in the gui
If you want to find an in-built Surfice Python function, you can use the Scripting/Python/Help menu item which will list all the functions with a brief explanation. In your case:

overlayextreme (built-in function):
overlayextreme(layer, mode) -> Behavior of values beyond min..max (-1 automatic, 0 hide dark & bright, 1: hide dark, 2 hide bright, 3 show dark & bright)

This command is illustrated in the script below:

import gl
gl.resetdefaults()
gl.azimuthelevation(70, 15)
gl.meshload('BrainMesh_ICBM152.rh.mz3')
gl.overlayload('motor_4t95vol.nii.gz')
gl.overlayminmax(1,2,8)
gl.overlayextreme(1,0)
Apr 14, 2021  01:04 PM | nagedem
RE: Scripting show dark/hide bright commands in the gui
Thank you so much Chris, that helps a lot!