Add info about color and intensity to surface guide#993
Add info about color and intensity to surface guide#993TimMonko wants to merge 1 commit intonapari:mainfrom
Conversation
| array of the indices of the triangles making up the faces of the surface, and a | ||
| length `N` list of values to associate with each vertex to use alongside a | ||
| colormap. | ||
| array of the indices of the triangles making up the faces of the surface, and, |
There was a problem hiding this comment.
Since there are several long components and one optional, changing to a bulleted list would reduce cognitive load for reader.
| Controls related to `contrast limits`, `auto-contrast`, `gamma`, and | ||
| `colormap` are only available when the surface color is computed from | ||
| `vertex_values`. If you provide `vertex_colors`, napari uses those colors |
There was a problem hiding this comment.
| Controls related to `contrast limits`, `auto-contrast`, `gamma`, and | |
| `colormap` are only available when the surface color is computed from | |
| `vertex_values`. If you provide `vertex_colors`, napari uses those colors | |
| When the surface color is computed from `vertex_values`, controls related to `contrast limits`, `auto-contrast`, `gamma`, and | |
| `colormap` are unavailable. If you provide `vertex_colors`, napari uses those colors |
Is vertex_colors a vertex_value?
There was a problem hiding this comment.
so this is IMO a bigger problem that I can address in the PR.
vertex_values is really the 3rd element of the data tuple, but it seems to be used throughout the docs and examples as if it were a real argument.
On the other hand, vertex_colors is an argument to Surface that overrides anything set in that third element of the data tuple.
I'll take another overall swing at the wording -- I think bulleting the tuple elements like above will probably help with this :)
There was a problem hiding this comment.
No problem. I just didn't know the answer. Keep it simple now with just the bullets.
| The data for a `surface` layer can be given as either a 2-tuple | ||
| `(vertices, faces)` or a 3-tuple `(vertices, faces, vertex_values)`. The | ||
| vertices are an `NxD` array of `N` vertices in `D` coordinates. The faces are | ||
| an `Mx3` integer array of the indices of the triangles making up the faces of | ||
| the surface. The optional vertex values are a length `N` list of scalar values | ||
| to associate with each vertex for colormap-based rendering. If you omit | ||
| `vertex_values`, napari fills them with ones, so the default underlying surface | ||
| color is white. |
There was a problem hiding this comment.
Consider a bullet list for sentences after the first.
| The data for a `surface` layer can be given as either a 2-tuple | |
| `(vertices, faces)` or a 3-tuple `(vertices, faces, vertex_values)`. The | |
| vertices are an `NxD` array of `N` vertices in `D` coordinates. The faces are | |
| an `Mx3` integer array of the indices of the triangles making up the faces of | |
| the surface. The optional vertex values are a length `N` list of scalar values | |
| to associate with each vertex for colormap-based rendering. If you omit | |
| `vertex_values`, napari fills them with ones, so the default underlying surface | |
| color is white. | |
| The data for a `surface` layer can be given as either a 2-tuple | |
| `(vertices, faces)` or a 3-tuple `(vertices, faces, vertex_values)`. | |
| - The vertices are an `NxD` array of `N` vertices in `D` coordinates. | |
| - The faces are an `Mx3` integer array of the indices of the triangles | |
| making up the faces of the surface. | |
| - The optional vertex values are a length `N` list of scalar values | |
| to associate with each vertex for colormap-based rendering. | |
| If you omit `vertex_values`, napari fills them with ones, so the default underlying surface color is white. |
| optionally, a length `N` list of values to associate with each vertex to use | ||
| alongside a colormap. If you omit the vertex values, napari uses a length `N` | ||
| array of ones. |
There was a problem hiding this comment.
Actually, surfaces values can be n-dimensional:
| `(vertices, faces)` or a 3-tuple `(vertices, faces, vertex_values)`. The | ||
| vertices are an `NxD` array of `N` vertices in `D` coordinates. The faces are | ||
| an `Mx3` integer array of the indices of the triangles making up the faces of | ||
| the surface. The optional vertex values are a length `N` list of scalar values |
References and relevant issues
depends on napari/napari#8909
Description
Adds information about how colors are handled in surface layers, especially as it relates to contrast and colormaps.
Adds info relevant to napari/napari#8909 where color controls are disabled when
vertex_colorsis passed.I tried also to clarify how omitting the vertex values resulted in 1s being used to color the surface, resulting in "white" and thus a bit of magic (to me) seemed to be involved in contrast controls and such. I still don't feel like I got the words out correctly.