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

_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

