IndexedImage-class          package:EBImage          R Documentation

_D_e_f_i_n_t_i_o_n _o_f _c_l_a_s_s '_I_n_d_e_x_e_d_I_m_a_g_e'

_D_e_s_c_r_i_p_t_i_o_n:

     The class 'IndexedImage' is used to store the results of functions
     that index image into separate objects using integer 1-based
     indexing. Such an image is essentially the same as 'Image' in the
     gray scale mode. The class was defined to ensure correct types in
     calls to other object detection and processing routines.

_C_l_a_s_s _D_e_f_i_n_i_t_i_o_n:


         ## S4 class definition
         setClass( "IndexedImage", contains="Image" )


_C_r_e_a_t_i_n_g _o_b_j_e_c_t_s:

     Objects of this class are not supposed to be created directly,
     rather as the  result of calls to 'watershed' or 'propagate', or
     other functions that index objects in images.

_D_e_t_a_i_l_s:

     No accessor methods are defined for this class, however all of the
      parents' ones are available, i.e. those of 'Image'  and 'array'.

     One coersion routine is defined in addition, which simply sets the
     class  attribute to 'Image':


         ## S4 method for signature 'x=IndexedImage'
         as.Image(x, ...)

     When used with 'IndexedImage''s 'display' by default normalizes
     the  image.

_A_u_t_h_o_r(_s):

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

_S_e_e _A_l_s_o:

     ' Image, watershed, getFeatures '

_E_x_a_m_p_l_e_s:

       ## load images
       f <- paste( system.file(package="EBImage"), "images/Gene1_G.tif", sep="/" )
       ii = readImage(f)
       ## normalize images
       ii = normalize(ii, separate=TRUE)
       ## segment
       mask = thresh(ii, 25, 25, 0.02)
       ## refine segmentation with morphology filters
       mk3 = morphKern(3)
       mk5 = morphKern(5)
       mask = dilate(erode(closing(mask, mk5), mk3), mk5)
       ## index objects with 'watershed'
       io = watershed( distmap(mask), 1.5, 1)

       class(io)

