getFeatures             package:EBImage             R Documentation

_E_x_t_r_a_c_t _f_e_a_t_u_r_e _e_x_t_r_a_c_t_i_o_n _f_r_o_m _i_m_a_g_e _o_b_j_e_c_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     Extracts numerical features from image objects.

_U_s_a_g_e:

       getFeatures(x, ref, N=12, R=30, apply.Gaussian, nc=32, pseudo)

_A_r_g_u_m_e_n_t_s:

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

     ref: An 'Image' object or an array, containing the intensity
          values of the objects.

       N: Passed to 'zernikeMoments'. Integer value  defining the
          degree of the Zernike polynomials, which in turn defines the
          number of features calculated. Defaults to 12.

       R: Passed to 'zernikeMoments'. Defines the radius  of the circle
          around an object centre from which the features are
          calculated.  See details. Defaults to 30.

      nc: Passed to 'haralickFeatures'. A numeric value.  Specifies the
          number of gray levels to bin 'ref' into when  computing the
          co-occurrence matrix. Defaults to 32.

apply.Gaussian, pseudo: Deprecated.

_D_e_t_a_i_l_s:

     Combines and returns the features returned by 'hullFeatures',
     'moments', 'edgeFeatures', 'haralickFeatures' and
     'zernikeMoments'.

_V_a_l_u_e:

     'getFeatures' returns feature matrices.

_A_u_t_h_o_r(_s):

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

_S_e_e _A_l_s_o:

     'hullFeatures', 'moments', 'edgeFeatures' 'haralickFeatures',
     'zernikeMoments'

_E_x_a_m_p_l_e_s:

       x = readImage(system.file('images', 'nuclei.tif', package='EBImage'))
       x = x[,,1]
       if (interactive()) display(x)

       ## computes object mask
       y = thresh(x, 10, 10, 0.05)
       y = opening(y, makeBrush(5, shape='disc'))
       mask = bwlabel(y)
       if (interactive()) display(mask, title='Cell nuclei')

       ## features
       ftrs = getFeatures(mask, x)[[1]]
       print(ftrs[1:5,])

       ## paint nuclei with an eccentricity higher than 0.85
       maskb = mask
       id = which(ftrs[,'m.ecc']<0.85)
       maskb[!is.na(match(maskb, id))] = 0

       img = paintObjects(maskb, channel(x, 'rgb'), col='red')
       if (interactive()) display(img, title='Nuclei with high eccentricity')

