You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/sliceview/image_layer_rendering.md
+23-5Lines changed: 23 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
The rendering of image layers is fully customizable by specifying GLSL fragment
4
4
shader code for computing an RGBA output value for each pixel of the viewport
5
-
based on the the single- or multi-channel values associated with the
5
+
based on the single- or multi-channel values associated with the
6
6
corresponding voxel.
7
7
8
8
The fragment shader code can be entered interactively from the side panel for an image layer, or
@@ -195,11 +195,11 @@ The following parameters are supported:
195
195
196
196
### Retrieving voxel channel value
197
197
198
-
The raw value for a given channel is obtained by calling the `getDataValue` or `getInterpolated` function:
198
+
The raw value for a given channel is obtained by calling the `getDataValue` or `getInterpolatedDataValue` function:
199
199
200
200
```glsl
201
201
T getDataValue(int channelIndex...);
202
-
T getInterpolated(int channelIndex...);
202
+
T getInterpolatedDataValue(int channelIndex...);
203
203
```
204
204
205
205
The type `T` is `{u,}int{8,16,32}_t`, `uint64_t`, or `float` depending on the data source. The
@@ -208,7 +208,7 @@ backward compatibility, if there are no channel dimensions, a single unused `cha
208
208
may still be specified.
209
209
210
210
The `getDataValue` function returns the nearest value without interpolation, while the
211
-
`getInterpolated` function uses trilinear interpolation.
211
+
`getInterpolatedDataValue` function uses trilinear interpolation.
212
212
213
213
Note that only `float` is a builtin GLSL type. The remaining types are defined as simple structs in order to avoid ambiguity regarding the nature of the value:
214
214
@@ -305,7 +305,25 @@ If a discontinuous color mapping is applied to a volume that is stored or retrie
305
305
306
306
### Examples
307
307
308
-
The default shader, that displays the first channel as a grayscale intensity:
308
+
The default shader, which displays the first channel as a grayscale intensity using the `invlerp` ui control for easier editing of contrast limits and channels:
309
+
310
+
```glsl
311
+
#uicontrol invlerp normalized
312
+
void main () {
313
+
emitGrayscale(normalized());
314
+
}
315
+
```
316
+
317
+
Trilinear interpolation on the data with an `invlerp` ui control, displaying the first channel as a grayscale intensity:
0 commit comments