pycortex icon indicating copy to clipboard operation
pycortex copied to clipboard

Different roi colors in webGL

Open N-HEDGER opened this issue 3 years ago • 2 comments

Hi there,

As illustrated in the documentation is straightforward to give different ROIs different colors in quickflat mode, as shown below

Full_brain_creatures

However, I am unable to replicate this behavior in webGL mode. No matter the color of the path in the svg, it always appears white in the webGL viewer.

Interestingly, adding a colored rectangle (but not path) in the cutouts folder appears to respect the path color (shown in black).

Screenshot 2023-01-03 at 16 19 55

After having read through what I think are the relevant parts of code. I am scratching my head as to why colors are respected in webGL mode for rectangles but not for paths/rois. Could anyone shed any light on how different roi colors could be achieved in webGL mode?

N-HEDGER avatar Jan 03 '23 16:01 N-HEDGER

FYI. I have managed to get the correct result by pasting the paths into the 'display' layer. Note that the color again does not appear if put in the shapes sublayer.

image - 2023-01-03T171811 898

Screenshot 2023-01-03 at 17 22 05

I'll leave this open since it seems like it could be desirable to achieve this by using the conventional roi sublayers.

N-HEDGER avatar Jan 03 '23 17:01 N-HEDGER

There is a way to do this in pycortex.

If you want to change the appearance of an overlay in webgl, make the change you want (e.g. turn it red, make the line dotted, whatever) and then lock the layer and save the overlays file. Once a layer is locked, the style is no longer overwritten by the defaults in the pycortex config file.

The config file (cortex.options.usercfg) provides a way to set properties for all sub-layers under shapes for a given superordinate layer. If e.g. you want all rois to have a different color or line thickness, you can set that under the [rois_paths] section of the config file. The locking of individual layers (e.g. V1 in the rois layer or STS in the sulci layer or whatever) provides more flexible control.

Sorry for the lack of documentation. We original developers built lots of things in a big hurry and for our own purposes, and left the Gallant lab before we could properly document all our tricks.

marklescroart avatar Feb 17 '23 07:02 marklescroart