help > mesh colour
Showing 1-3 of 3 posts
Display:
Results per page:
Jul 14, 2022  09:07 AM | MIchael Elmalem - UCL
mesh colour
Dear Chris,

I am using the voxelwise-to-mesh function to create meshes from nifti files. Each nifti file has N vowels with a mean value of a single cluster, and 0s everywhere else (i.e., each nifti represents a different cluster and has a unique mean value).
We want to be able to control the colour of the mesh using one of the default colourbars (e.g., inferno) but I am not sure how to do that. 
Would be grateful if you could advise.

Many thanks and best wishes,
Michael
Jul 14, 2022  12:07 PM | Chris Rorden
RE: mesh colour
Look at the Scripting/Templates/fmri_mesh menu item for a script illustrating how to select the color for a mesh. The color of the background mesh is driven by your shader, and you can control that with the `mesh color()` command (which is Color/ObjectColor menu item for the user interface). Overlays are controlled with `overlaycolorname()` which maps onto the color pull down menu in the overlays panel of the user interface:

```
import gl
gl.resetdefaults()
gl.meshload('BrainMesh_ICBM152.rh.mz3')
gl.meshcolor(198,64,198)
gl.overlayload('motor_4t95mesh.rh.mz3')
gl.overlaycolorname(1, 'red')
gl.shaderxray(1.0, 0.3)
gl.azimuthelevation(110, 15)
gl.meshcurv()
```
Jul 14, 2022  04:07 PM | MIchael Elmalem - UCL
RE: mesh colour
Many thanks for the swift reply.

Apologies, what I meant was that we would like to get a continuous colour map for the mesh overlays using a standard colour map. So, for example, if mesh 1 was created from a nifti with a mean value of 5 and mesh 2 with a mean value of 7, they would be assigned colours derived from a standard colour map (equivalent to thresholding applied to a normal nifti overlay, where mesh 2 has a brighter colour).
Is there a way to specify the exact RGB values of the overlay (equivalent to the gl.meshcolor function)?
Many thanks and best wishes,
Michael