Connection between scalars and lut for color matching
- Dominant language
- Python
- Stars
- 1.4k
- Forks
- 316
- Avg merge
- 7h 44m
- Merged PRs (30d)
- 5
Description
Let's say I have scalar list `s` and a lut `L` of size `m x 4 `. The way I understand it, the process of mapping scalars `s` to the RGBA values in `L` works the following way:
`color_of_point_s[i] = L[round(m * ((s[i] - min(s))/(max(s) - min(s)))]`
Or written: If I normalize the values of `s` to the interval `[0,1]` and divide this into `m` equal sub-intervals, normalized scalar values in the `i`th sub-interval will be mapped to the `i`th RGBA entry in `L`.
1) Is this correct?
2) If yes, can this (for the sake of everyone using mayavi not going insane) either be documented somewhere or be changed to be more intuitive?
I'm really curious about the reasoning behind having it this way. The actual values of `s` are basically meaningless. The whole (intended) connection to the lut is also completely skewed if the lowest/highest value in `s` is changed.
If I set up 1 lut of `m` colors, it would be nice if I could reach color `i` by simply specifying e.g. the index of that color, i.e. `i`. This would remove so much (in my opinion) unnecessary complexity. In many use-cases, all that you want is map 1 point to 1 color. In the case of animating things, having to retailor `L` based on my current `s` for every single frame is really frustrating.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.