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')

