| vol.intensity.to.color | R Documentation |
Convert a gray-scale image defined by intensity values in range [0, 1] to an image with identical dimensions that contains an R color string (like #222222) at each position. The color strings are computed from the intensities, by taking the intensity value as the value for all three RGB channels. I.e., the output is still gray-scale, but defined in RGB space. To make it clear, this function does not apply a colormap. It only changes the representation of the data, not the resulting colors.
vol.intensity.to.color(volume, scale = NULL)
volume |
numeric array, typically a 3D image with intensities in range |
scale |
numeric or character string, a scaling to apply to the values. Defaults to NULL, which means no scaling and requires the values in |
array (or matrix, or vector) of RGB color strings. All of them will represent gray values.
vol.intensity.to.color(c(0.0, 0.5, 1.0));
# output: "#000000" "#808080" "#FFFFFF"
vol.intensity.to.color(c(20, 186, 240), scale="normalize");
vol.intensity.to.color(c(20, 186, 240), scale=255);
vol.intensity.to.color(c(0.0, 0.5, 0.8), scale="normalize");
vol.intensity.to.color(c(0.0, 0.5, 0.8), scale="normalize_if_needed");
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.