Image                package:EBImage                R Documentation

_I_m_a_g_e _c_l_a_s_s

_D_e_s_c_r_i_p_t_i_o_n:

     The package 'EBImage' uses the class 'Image' to store and process
     images. Images are stored as multi-dimensional arrays containing
     the pixel intensities. The class 'Image' extends the base class
     'array' and uses the 'colormode' slot to store how the color
     information of the multi-dimensional data is handled.

     The 'colormode' slot could be either 'Grayscale' or 'Color'. In
     both modes, the two first dimensions of the underlying array are
     understood to be the spatial dimensions of the image. In the
     'Grayscale' mode, the remaining dimensions contain other images.
     In the the 'Color' mode, the third dimension contains the red,
     green and blue channels of the image and the remaining dimensions
     contain other images. The color mode 'TrueColor' exists but is
     deprecated.

     All methods of the package 'EBImage' works either with 'Image'
     objects or multi-dimensional arrays but in the latter case, the
     color mode is assumed to be 'Grayscale'.

_U_s_a_g_e:

       Image(data, dim, colormode)
       as.Image(x)
       is.Image(x)

       colorMode(y)  
       colorMode(y) <- value

       imageData(y)
       imageData(y) <- value 
             
       getNumberOfFrames(y, type='total')    

_A_r_g_u_m_e_n_t_s:

    data: A vector or array containing the pixel intensities of an
          image. If missing, a default 1x1 null array is used.

     dim: A vector containing the final dimensions of an 'Image'
          object. If missing, equals to 'dim(data)'.

colormode: A numeric or a character string containing the color mode
          which could be either 'Grayscale' or 'Color'. If missing,
          equals to 'Grayscale'.

       x: An R object.

       y: An 'Image' object or an array.

   value: For 'colorMode', a numeric or a character string containing
          the color mode which could be either 'Grayscale' or 'Color'.
          For 'imageData', an 'Image' object or an array.

    type: A character string containing 'total' or 'render'. If
          missing, equals to 'total'.

_D_e_t_a_i_l_s:

     Depending of 'type', 'getNumberOfFrames' returns the total number
     of frames contained in the object 'y' or the number of renderable
     frames. The total number of frames is independent of the color
     mode and is equal to the product of all the dimensions except the
     two first ones. The number of renderable frames is equal to the
     total number of frames in the 'Grayscale' color mode and is equal
     to the product of all the dimensions except the three first ones
     in the 'Color' color mode.

_V_a_l_u_e:

     'Image' and 'as.Image' return a new 'Image' object.

     'is.Image' returns TRUE if 'x' is an 'Image' object and FALSE
     otherwise.

     'colorMode' returns the color mode of 'y' and 'colorMode<-'
     changes the color mode  of 'y'.

     'imageData' returns the array contained in an 'Image' object.

_A_u_t_h_o_r(_s):

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

_S_e_e _A_l_s_o:

     'readImage', 'display'

_E_x_a_m_p_l_e_s:

       s1 = exp(12i*pi*seq(-1, 1, length=300)^2)
       y = Image(outer(Im(s1), Re(s1)))
       if (interactive()) display(normalize(y))

       x = Image(rnorm(300*300*3),dim=c(300,300,3), colormode='Color')
       if (interactive()) display(x) 

       w = matrix(seq(0, 1, len=300), nc=300, nr=300)
       m = abind(w, t(w), along=3)
       z = Image(m, colormode='Color')
       if (interactive()) display(normalize(z))

       y = Image(c('red', 'violet', '#ff51a5', 'yellow'), dim=c(71, 71))
       if (interactive()) display(y)

       ## colorMode example
       x = readImage(system.file('images', 'nuclei.tif', package='EBImage'))
       x = x[,,1:3]
       if (interactive()) display(x, title='Cell nuclei')
       colorMode(x)=Color
       if (interactive()) display(x, title='Cell nuclei in RGB')

