channel handles color space conversions between image modes.
rgbImage combines Grayscale images into a Color one.
toRGB is a wrapper function for convenient grayscale to RGB color space conversion; the call toRGB(x) returns the result of channel(x, 'rgb').
x = readImage(system.file("images", "shapes.png", package="EBImage"))
display(x)
y = channel(x, 'asgreen')
display(y)
## rgbImage
x = readImage(system.file('images', 'nuclei.tif', package='EBImage'))
y = readImage(system.file('images', 'cells.tif', package='EBImage'))
display(x, title='Cell nuclei')
display(y, title='Cell bodies')
cells = rgbImage(green=1.5*y, blue=x)
display(cells, title='Cells')
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(EBImage)
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/EBImage/channel.Rd_%03d_medium.png", width=480, height=480)
> ### Name: channel
> ### Title: Color and image color mode conversions
> ### Aliases: channel rgbImage toRGB
>
> ### ** Examples
>
> x = readImage(system.file("images", "shapes.png", package="EBImage"))
> display(x)
> y = channel(x, 'asgreen')
> display(y)
>
> ## rgbImage
> x = readImage(system.file('images', 'nuclei.tif', package='EBImage'))
> y = readImage(system.file('images', 'cells.tif', package='EBImage'))
> display(x, title='Cell nuclei')
Only the first frame of the image stack is displayed.
To display all frames use 'all = TRUE'.
> display(y, title='Cell bodies')
Only the first frame of the image stack is displayed.
To display all frames use 'all = TRUE'.
>
> cells = rgbImage(green=1.5*y, blue=x)
> display(cells, title='Cells')
Only the first frame of the image stack is displayed.
To display all frames use 'all = TRUE'.
>
>
>
>
>
> dev.off()
null device
1
>