Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
The issue seems to be this.
add_annotation
is setting the colors by callingsurf.module_manager.scalar_lut_manager.load_lut_from_list
. This keeps the lookup table at 255 colors and sets the firstn
colors wheren
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: