-
Notifications
You must be signed in to change notification settings - Fork 28
Closed
Labels
Description
Daniel Leopold requested a method to customize color schemes. The latest release (v1.0.20201102 ) provides two methods:
Method 1: specify dark and bright red/green/blue colors, e.g. here Overlay 1 will. have colors from purple (255,0,255) to lime green (128,255,128):
import gl
gl.meshload('BrainMesh_ICBM152.rh.mz3')
gl.overlayload('motor_4t95vol.nii.gz')
gl.overlaycolor(1,255,0,255,128,255,128)
Method 2: Generate a new color lookup table - these are simply text files. Hint: if you put this text file inside the Resources/LUT folder, it will be in the pull-down menu when you restart (on MacOS, you need to. “Show Package Contents” to see the Resources folder):
import gl
import os
fnm = os.path.expanduser("~")+os.path.sep+'myLUT.clut';
f = open(fnm, "w")
f.write("[INT]\n")
f.write("numnodes=3\n")
f.write("[BYT]\n")
f.write("nodeintensity0=0\n")
f.write("nodeintensity1=128\n")
f.write("nodeintensity2=255\n")
f.write("[RGBA255]\n")
f.write("nodergba0=0|0|0|0\n")
f.write("nodergba1=128|128|0|64\n")
f.write("nodergba2=255|0|0|128\n")
f.close()
gl.meshload('BrainMesh_ICBM152.rh.mz3')
gl.overlayload('motor_4t95vol.nii.gz')
gl.overlaycolorname(1,fnm)