readImage              package:EBImage              R Documentation

_I_m_a_g_e _I/_O

_D_e_s_c_r_i_p_t_i_o_n:

     Functions to choose, read and write images from/to files and
     URL's. Supported image formats are determined by the ImageMagick
     installation.

_U_s_a_g_e:

       chooseImage(colormode = Grayscale)
       readImage(files, colormode = Grayscale, ...)

       ## S4 method for signature 'Image':
       writeImage(x, files, ...)

_A_r_g_u_m_e_n_t_s:

       x: An object of 'Image'. 

   files: A character vector of files/URL's to read from or to write
          to. 

colormode: An integer value for the color mode of images after they are
          read. By default all images will be converted to Grayscale on
          read. 

     ...: Reserved. 

_D_e_t_a_i_l_s:

     If 'files' is missing when writing images, 'fileName(x)' method
     will be used to select a single file to write to. Otherwise, the
     length of this vector must be equal either 1 or the number of 2D
     images in the stack.

     When writing images in formats supporting non-lossless compression
     (like JPEG), the quality can be spcified used a numeric 'quality'
     argument with the range '[1,100]'. Higher values correspond to
     better quality. Defaults to 95.

     The file format is deduced from the file name extension(s), there
     is neither a need nor a way to specify the format explicitly.

     'ImageMagick' is used to perform all image I/O operations.
     Therefore, the package supports all the file types supported by
     'ImageMagick'.

     When reading images, files of different formats can be mixed in
     any consequence, including mixing single 2D images with TIFF image
     stacks. The result will contain a stack of all images and stacks
     cropped (filled with background if images are smaller) at the size
     of the first image read.

     'choose.image' is an interactive function that does not return to
     R until either Ok or Cancel button is pressed in the GUI dialog.
     It uses 'GTK+2' File Open Dialog to select images. Multiple images
     can be selected and loaded at once. By default this functions
     reads images as 'TrueColor'. This function will produce an error
     message if the package was compiled without 'GTK+' support.

_V_a_l_u_e:

     For 'readImage' and 'chooseImage' a new instance of  'Image'.

     For 'writeImage' an invisible 'NULL'.

_A_u_t_h_o_r(_s):

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

_R_e_f_e_r_e_n_c_e_s:

     _ImageMagick_: <URL: http://www.imagemagick.org>.

_S_e_e _A_l_s_o:

     ' Image, Image, channel '

_E_x_a_m_p_l_e_s:

         f <- paste( system.file(package="EBImage"), "images/Gene1_G.tif", sep="/" )
         ii = readImage(f)
       if ( interactive() ) {
         url <- c("http://www.google.com/intl/en/images/logo.gif")
         im <- readImage (url, TrueColor)
         ## Not run: writeImage (im, "googlelogo.tif")
         ## Not run: im1 <- channel ( chooseImage(), "gray")
       }

