-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
MRG: Add support for foreground in _Brain #7843
MRG: Add support for foreground in _Brain #7843
Conversation
"""Add a scalar bar in the scene. | ||
|
||
Parameters | ||
---------- | ||
source: | ||
The object of the scene used for the colormap. | ||
color: | ||
The color of the label text. | ||
title: str | None | ||
The title of the scalar bar. | ||
n_labels: int | None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bgcolor not documented?
mne/viz/_brain/_brain.py
Outdated
@@ -177,6 +177,8 @@ def __init__(self, subject_id, hemi, surf, title=None, | |||
|
|||
if isinstance(background, str): | |||
background = colorConverter.to_rgb(background) | |||
if foreground is None: | |||
foreground = "white" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should set it to white or black automatically depending on the luminance of the background
, see how it's done in PySurfer
Can you add to the TODO list to make the |
(not necessarily for this PR) |
Pushed a commit to fix I did notice a bug with the VectorSourceEstimate plotting -- it looks like the colormap of the arrows are not interactively updated, see how the brain surface and arrow colormaps do not match here: Sample code to reproduce, just click around the sliders and you should see the brain surface change color but the color/alpha of the arrows stays the same: Sample code
It becomes even more obvious if you set something like |
I updated #7162 with #7843 (comment) and #7843 (comment) |
merge when happy !
… |
Thanks @GuillaumeFavelier |
* upstream/master: MRG: Add support for foreground in _Brain (mne-tools#7843) MRG, MAINT: Change default role in conf.py (mne-tools#7841) MRG, ENH: Support n_col keyword in ica.plot_score (mne-tools#7825) add icons to source dist (mne-tools#7840) Add CZI to list of funders (mne-tools#7839) DOC: added reference to sesameeg package (mne-tools#7835) MRG, ENH: Automatically compute threshold for CTPS ECG detection (mne-tools#7819) MAINT: Show how picks work for planars (mne-tools#7833) Clearer info docstring (mne-tools#7832) MRG, ENH: Add estimation method legend (mne-tools#7830) Remove double spaces (mne-tools#7822) add troubleshooting message about OpenGL [skip travis] (mne-tools#7827) fix links [skip travis] (mne-tools#7826)
This PR adds support for the
foreground
parameter in_Brain
. This parameter influences the color of the labels displayed (scalar bar label, time label and slider title and label).Following the example given in #7842 (comment), this is what I obtain now:
Closes #7842
It's an item of #7162