razvanmarinescu / brain-coloring

BrainPainter - Brain Visualisation Software
57 stars 17 forks source link

Additional question about the color bar #14

Closed kacey-yang closed 3 years ago

kacey-yang commented 3 years ago

Thank you for the website update! I have tried with the new Destrieux template and now it is working properly. Thanks!

I have an additional question about the input range. If I want to plot some ROI values range from 0-max (max can be larger than 10, say 12), rather than just 0-3 or 0-4, and I still want to use 3 colors (say yellow/orange/red), is that I just need to edit the latex file for color bar?

For example, I just need to change those latex syntax:

\draw (0,0) -- (0.5,0);\node[inner sep=0] (corr_text) at (1.6,0.0) {normal};

\draw (0,2) -- (0.5,2);\node[inner sep=0] (corr_text) at (1.6,2.0) {1-sigma};

\draw (0,4) -- (0.5,4);\node[inner sep=0] (corr_text) at (1.6,4.0) {2-sigma};

\draw (0,6) -- (0.5,6);\node[inner sep=0] (corr_text) at (1.6,6.0) {3-sigma};

To:

\draw (0,0) -- (0.5,0);\node[inner sep=0] (corr_text) at (1.6,0.0) {0};

\draw (0,2) -- (0.5,2);\node[inner sep=0] (corr_text) at (1.6,2.0) {4};

\draw (0,4) -- (0.5,4);\node[inner sep=0] (corr_text) at (1.6,4.0) {8};

\draw (0,6) -- (0.5,6);\node[inner sep=0] (corr_text) at (1.6,6.0) {12};

Am I correct?

Thank you!

vmallela0 commented 3 years ago

Yes, I think you're right. If you're trying to just change the name of the values on the color bar, then that looks perfect.

kacey-yang commented 3 years ago

Thank you for your quick answer!

I have another question about the negative values.

If I would like to plot ROI measures including negative values (say -1 to 1), can BrainPainter tool takes the negative values as input? Can I just modify the color bar the same way as above?

Thank you!

vmallela0 commented 3 years ago

No, sorry BrainPainter only takes 0-3, 0-4, etc. It can't handle negative values. What you could do however, is modify line 23 in config.py COLORS_RGB = [(1,1,1), (1,1,0), (1,0.4,0), (1,0,0)] # white -> yellow -> orange -> red to have the color's that you're looking for.

This would basically be the same effect as having negative values I would imagine. Then, you can change the color bar's values as you described earlier.

kacey-yang commented 3 years ago

Thanks!

May I ask why BrainPainter only takes positive values?

vmallela0 commented 3 years ago

It's because the colors are user defined. If we had negative values, then it would be tough to assume what the negative values' colors are. (I think this is why)

Do you think it would be helpful if we had negative values where it's just the opposite of the first value?

kacey-yang commented 3 years ago

https://matplotlib.org/stable/tutorials/colors/colormaps.html Can you take a look this colormap documentation in Matplotlib? At the bottom, it shows all the available color bars in python and one of them is called jet.

Sometimes when we have normalized ROI measurements ranged from -1 to 1 on each ROI, jet is a popular choice for the color bar. The color range of blue for negative values and color range of red for positive values.

Previously, I was using BrainPainter website for plotting, and last night I was able to install the package on my local machine following the YouTube video someone previously shared.

After trying both ways, I feel like it would be easier to adjust the color by using the website, since we do not need to deal with the RGB code for different colors. The color code shown on the website was in letters, but in the source code it is shown as a list of numbers. Do you have any suggestion for this?

But, I noticed a small problem for the website that it automatically plot both right and left hemisphere views, even though I only choose one view (right or left) in the Angles selection part.

Did you also notice this?

Thanks!

razvanmarinescu commented 3 years ago

@kacey-yang regarding the question of why BrainPainter doesn't take negative values ... it doesn't really matter, as you can change the color-bar labels in the LaTex file afterwards. So if you need [-10,-7], just do [0,3], and then change labels back to [-10, -7].

vmallela0 commented 3 years ago

@kacey-yang I did notice this problem on the website. I'll fix it soon. Thanks for letting us know.

vmallela0 commented 3 years ago

@kacey-yang should be fixed now! Thank you again :)

kacey-yang commented 3 years ago

@kacey-yang regarding the question of why BrainPainter doesn't take negative values ... it doesn't really matter, as you can change the color-bar labels in the LaTex file afterwards. So if you need [-10,-7], just do [0,3], and then change labels back to [-10, -7].

Hello! Do you mean that if I want [-1, 1], I just need to do [0, 2], then change color bar labels back to [-1, 1]?