rmObjects              package:EBImage              R Documentation

_O_b_j_e_c_t _r_e_m_o_v_a_l _a_n_d _r_e_i_n_d_e_x_a_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     The 'rmObjects' functions deletes objects from an image by setting
     their pixel intensity values to 0. 'reenumerate' re-enumerates all
     objects in an image from 0 (background) to the actual number of
     objects.

_U_s_a_g_e:

       rmObjects(x, index)

       reenumerate(x)

_A_r_g_u_m_e_n_t_s:

       x: An 'Image' object in 'Grayscale' color mode or an array
          containing object masks. Object masks are sets of pixels with
          the same unique integer value.

   index: A numeric vector (or a list of vectors if 'x' contains
          multiple frames)  containing the indexes of objects to remove
          in the frame.

_V_a_l_u_e:

     An 'Image' object or an array, containing the new objects.

_A_u_t_h_o_r(_s):

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

_S_e_e _A_l_s_o:

     'bwlabel', 'watershed'

_E_x_a_m_p_l_e_s:

       ## make objects
       x = readImage(system.file('images', 'shapes.png', package='EBImage'))
       x = x[110:512,1:130]
       y = bwlabel(x)
       if (interactive()) display(normalize(y), title='Objects')
       
       ## remove and reenumerate
       y = rmObjects(y, 5)
       if (interactive()) display(normalize(y), title='Removal')
       y = reenumerate(y)
       if (interactive()) display(normalize(y), title='Reenumerated')

