help > RE: Overlay about extreme value in a batch
Jul 31, 2020  02:07 PM | Chris Rorden
RE: Overlay about extreme value in a batch
I can not replicate your issue. Try the code
import gl
gl.resetdefaults()
gl.azimuthelevation(70, 15)
gl.meshload('BrainMesh_ICBM152Right.mz3')
gl.overlayload('motor_4t95vol.nii.gz')
gl.overlayminmax(1,-2,6)
gl.overlayextreme(1,3)

And see how the image changes as you change the last line:

 gl.overlayextreme(1,-1)
"Automatic" mode hides values less than -2, values greater than 6 are clamped to 6. This mode is dynamic, if the overlayminmax specified two negative values (e.g. gl.overlayminmax(1,-2,-6)) it would behave as "Show Dark, Hide Bright"). 

gl.overlayextreme(1,0)
"Hide Dark and Bright" mode hides values less than -2, hides values greater than 6.

gl.overlayextreme(1,1)
"Hide Dark, Show Bright" mode hides values less than -2, values greater than 6 are clamped to 6.

gl.overlayextreme(1,2)
"Show Dark, Hide Bright" mode clamps values less than -2 to -2, hides values greater than 6.

gl.overlayextreme(1,3)
"Show Dark, Show Bright" mode clamps values less than -2 to -2, clamps values greater than 6 to 6.

In general, if you want to independently control the negative and positive values in a single statistical test, you should load the map twice, and adjust each layer independently. This gives you independent control of the color schemes, and for this situation the "Automatic" mode works nicely. This method is illustrated by the example script you can see by choosing Scripting/Python/basic_paint_surface, which loads the statistical map motor_4t95vol twice, with one layer being positive and the other being negative.

import gl
gl.resetdefaults()
gl.azimuthelevation(70, 15)
gl.meshload('BrainMesh_ICBM152Right.mz3')
gl.overlayload('motor_4t95vol.nii.gz')
gl.overlayminmax(1,2,12)
gl.overlayload('motor_4t95vol.nii.gz')
gl.overlayminmax(2,-1,-2)
gl.colorbarvisible(1)
gl.overlaytransparencyonbackground(25)
gl.meshcurv() 

Threaded View

TitleAuthorDate
Junhao Luo Jul 10, 2020
RE: Overlay about extreme value in a batch
Chris Rorden Jul 31, 2020
Junhao Luo Aug 1, 2020
Chris Rorden Jul 30, 2020
Junhao Luo Jul 30, 2020