Image                package:EBImage                R Documentation

_I_m_a_g_e _c_r_e_a_t_i_o_n, _c_o_p_y_i_n_g _a_n_d _a_s_s_e_r_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     Functions to create, copy and assert images.

_U_s_a_g_e:

       Image(data=array(0,c(0,0,1)), dim=base::dim(data), colormode, ...)

       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, ...)

_A_r_g_u_m_e_n_t_s:

    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.

_D_e_t_a_i_l_s:



     '_I_m_a_g_e' This is a wrapper around 'new', for  convenience.

     '_c_o_p_y' Makes an identical copy of an object of '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.

     '_c_o_m_b_i_n_e' Acts similarly to '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)' 

     '_h_e_a_d_e_r' Acts similarly to copy, but does not copy the actual
          image data, only all the other slots. This function can be
          useful for creating new images from existing large ones
          preserving attributes.

     '_i_s._I_m_a_g_e' Returns 'TRUE' if argument is a valid 'Image' and
          'FALSE' otherwise. 

     '_a_s_s_e_r_t' Compares dimensions and color modes of two images. If
          argument 'strict' is 'FALSE' images are allowed to have
          different number of frames.


_V_a_l_u_e:

     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.

_A_u_t_h_o_r(_s):

     Oleg Sklyar, osklyar@ebi.ac.uk, 2005-2007

_S_e_e _A_l_s_o:

     ' Image, IndexedImage, readImage '

_E_x_a_m_p_l_e_s:

       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

