[BioC] EBImage: Negative pixel intensities?!?

Henrik Bengtsson hb at biostat.ucsf.edu
Tue Mar 6 17:42:48 CET 2012

[Package maintainer cc:ed]


in EBImage (3.11.2), an Image object can take intensities outside
[0,1] including negative ones.  What are they/how are they mapped when
rendered?  Here are some examples adopted from example("Image") and

# (a) Image object with intensities in [0,1]
> x <- readImage(system.file("images", "lena-color.png", package="EBImage"));
> range(x)
[1] 0.01176471 1.00000000

# (b) Image object with intensities in [0,1]
> y <- readImage(system.file('images', 'nuclei.tif', package='EBImage'))
> range(y)
[1] 0 1

# (c) Image object with large negative and positive intensities
> z <- Image(rnorm(300*300*3),dim=c(300,300,3), colormode='Color')
> range(z)
[1] -4.661843  4.353772

All three Image:s can be displayed using display().

I assume the colors in 'z' are rescaled/renormalized to (R,G,B) \in
[0,1]x[0,1]x[0,1], but how?

BTW, I went through the EBImage docs, but I cannot find any
information on what range the intensities should have.  I only
inferred from the examples that [0,1] seems to be the scale, but the
above 'z' puzzles me.



> library(EBImage)
Loading required package: abind
Warning message:
package 'EBImage' was built under R version 2.15.0
> sessionInfo()
R version 2.14.2 Patched (2012-02-29 r58590)
Platform: x86_64-pc-mingw32/x64 (64-bit)

[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] EBImage_3.11.2 abind_1.4-0

More information about the Bioconductor mailing list