Skip to content

Set annotation LUT directly #271

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

Merged
merged 1 commit into from
Jul 30, 2019
Merged

Set annotation LUT directly #271

merged 1 commit into from
Jul 30, 2019

Conversation

mwaskom
Copy link
Member

@mwaskom mwaskom commented Jul 29, 2019

I was having an issue where one label in an annotation would mistakenly be colored bright blue. e.g. this is an incorrect rending of the Yeo2011_7Networks_N1000 annot included with Freesurfer:

image

The issue seems to be this. add_annotation is setting the colors by calling surf.module_manager.scalar_lut_manager.load_lut_from_list. This keeps the lookup table at 255 colors and sets the first n colors where n is the length of the list you pass in. So what's happening is the "wrong" label is the largest ID in the annotation, and it is being colored in with the next color, which is blue (for a relatively small annotation). Why is that happening? It's not exactly clear. I don't see anything obviously wrong with the code we are using to set the scalar values of the annotation mesh. It may be a bug in mayavi.

In either case, it's also possible to set the LUT trait directly. This seems to fix my issue:

image

@larsoner larsoner merged commit b2474cf into nipy:master Jul 30, 2019
@larsoner
Copy link
Contributor

Thanks @mwaskom

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

Successfully merging this pull request may close these issues.

2 participants