Image {EBImage}R Documentation

Image creation, copying and assertion

Description

Functions to create, copy and assert images.

Usage

    Image(data=0.5, dim=c(200,200), colormode=Grayscale, ...)
    is.Image(x)
    stopIfNotImage(x)

    # S4 methods for class 'Image':

    copy(x)
    combine(x, y, ...)
    header(x)
    assert(x, y, strict=FALSE)

Arguments

x, y
Objects of Image-class.
data
A vector giving data to fill the image.
dim
Image dimensions, 2D or 3D. In case of 2D, the third dimension is set to 1 automatically.
colormode
Image color mode, TrueColor or Grayscale.
strict
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, but image size should be the same).
...
Further arguments to fill the slot values in constructor or further images in combine.

Value

Image, copy, combine and header will return a new object of Image-class.

assert and is.Image will return a logical.

Details

Image
This is a default constructor for images. It is a convenience functions being a wrapper around standard R function new.
copy
Makes an identical copy of an object of Image-class. It is similar to assignment, but it forces R to allocate new memory for the object.
combine
Acts similarly to rbind and cbind allowing to add images into the stack. Properties of the first image in argument x will be transfered to the result. Images must be of the same size (in first two dimensions) and in the same color mode.
header
Acts similarly to copy, but leaves image data empty – only copies other properties. This function is useful when creating new images from existing large ones changing the dimensions. In this case, the result will have all the properties of the source and its data can be assigned later using imageData.
assert
Compares image dimensions and other properties. This is a method defined for objects of Image-class, therefore it will generate an error if x is not an Image. Use is.Image to test the class of a single object.
is.Image
Returns TRUE if argument is a valid Image and FALSE otherwise.
stopIfNotImage
Prints an error message if argument is not of Image-class.

Author(s)

2005-2006 Oleg Sklyar : osklyar@ebi.ac.uk

See Also

Image-class, read.image


[Package EBImage version 2.0.1 Index]