Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different roi colors in webGL #474

Open
N-HEDGER opened this issue Jan 3, 2023 · 2 comments
Open

Different roi colors in webGL #474

N-HEDGER opened this issue Jan 3, 2023 · 2 comments

Comments

@N-HEDGER
Copy link

N-HEDGER commented Jan 3, 2023

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
Copy link
Author

N-HEDGER commented Jan 3, 2023

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.

@marklescroart
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants