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")
       }

