Image {EBImage} | R Documentation |
Functions to create, copy and assert images.
Image(data=matrix(0,0,0), dim=base::dim(data), colormode=Grayscale, ...) is.Image(x) stopIfNotImage(x) ## S4 methods for signature 'x=Image' copy(x, ...) header(x, ...) ## S4 methods for signatures 'x=Image,y=Image' ## and 'x=list,y=missing' combine(x, y, ...) ## S4 methods for signatures 'x=Image,y=Image' ## and 'x=Image,y=missing' assert(x, y, strict=FALSE, ...)
x, y |
Objects of class Image . There is also
a combine method for lists of equally sized Image
objects, in that case y should be missing. |
data |
Data to fill the image, typically an array,
but can be any object for which as.numeric or
as.integer is defined. |
dim |
A numeric vector of image dimensions with length of 2 or 3. If its length is 2, the third dimension is set to 1. |
colormode |
An integer value for the image data color mode.
It is recommended to use the predefined symbols TrueColor or
Grayscale . |
strict |
A logical scalar. If TRUE , the size of all three dimensions of
two images will be compared, if FALSE , the function will
compare only the first two dimensions (i.e. stacks can have different
size in z-direction, but x- and y-size should be the same). |
... |
With Image , further arguments to new ;
with combine , further images to be combined. |
Image
new
, for
convenience.copy
Image
enforcing allocation of new memory for
the image data. Note that in R, a simple assignment like
a<-b
does lead to copying of the data until either a
or b
are further modified.combine
rbind
and
cbind
. It allows to combine images to stacks adding further
images at the back of the first one. Properties of the first image in
the argument x
are transferred to the result. All images must be of
the same size (in first two dimensions) and color mode. If applied to
a list of images, it calls do.call("combine", x)
header
is.Image
TRUE
if argument is a valid
Image
and FALSE
otherwise. assert
strict
is FALSE
images are allowed to have
different number of frames.
The constructors Image
, copy
, combine
and header
return a new object of Image
.
assert
and is.Image
return a logical
.
stopIfNotImage
will return invisible NULL
if its argument is of
Image
and an error message otherwise.
Oleg Sklyar, osklyar@ebi.ac.uk, 2005-2007
Image, IndexedImage, readImage
i1 = Image() sx = exp(24i*pi*seq(-1, 1, length=300)^2) i2 = Image(outer(Im(sx), Re(sx))) if (interactive()) display(normalize(i2)) i3 <- copy(i2) is.Image(i2) ## see 'stackObjects' for example on combine