RNotes | EBImage | Features

Basic | Haralick | Moment | Shape

Haralick Textural Features Details


The function computeFeatures.haralick computes features that quantify pixel texture. Features are named according to Haralick’s original paper. See Haralick Textural Features Details for details about the 26 features.

All Haralick features have a prefix “h.”.

library(EBImage)
computeFeatures.haralick(x, ref , properties=FALSE, haralick.nbins=32, haralick.scales=c(1, 2), xs, ...)

List properties of Haralick features

feature.properties <- computeFeatures.haralick(properties=TRUE)
feature.properties
       name translation.invariant rotation.invariant
1  h.asm.s1                  TRUE               TRUE
2  h.con.s1                  TRUE               TRUE
3  h.cor.s1                  TRUE               TRUE
4  h.var.s1                  TRUE               TRUE
5  h.idm.s1                  TRUE               TRUE
6  h.sav.s1                  TRUE               TRUE
7  h.sva.s1                  TRUE               TRUE
8  h.sen.s1                  TRUE               TRUE
9  h.ent.s1                  TRUE               TRUE
10 h.dva.s1                  TRUE               TRUE
11 h.den.s1                  TRUE               TRUE
12 h.f12.s1                  TRUE               TRUE
13 h.f13.s1                  TRUE               TRUE
14 h.asm.s2                  TRUE               TRUE
15 h.con.s2                  TRUE               TRUE
16 h.cor.s2                  TRUE               TRUE
17 h.var.s2                  TRUE               TRUE
18 h.idm.s2                  TRUE               TRUE
19 h.sav.s2                  TRUE               TRUE
20 h.sva.s2                  TRUE               TRUE
21 h.sen.s2                  TRUE               TRUE
22 h.ent.s2                  TRUE               TRUE
23 h.dva.s2                  TRUE               TRUE
24 h.den.s2                  TRUE               TRUE
25 h.f12.s2                  TRUE               TRUE
26 h.f13.s2                  TRUE               TRUE

Load and segment nucleus

par(mfrow=c(1,2))
y <- readImage(system.file("images", "nuclei.tif", package="EBImage"))[,,1]
x <- thresh(y, 10, 10, 0.05)
x <- opening(x, makeBrush(5, shape='disc'))
x <- bwlabel(x)

display(y, title="Cell nuclei")
display(x, title="Segmented nuclei")

Compute Haralick features

haralickFeatures <- computeFeatures.haralick(x, y)
str(haralickFeatures)
 num [1:76, 1:26] 0.02222 0.01259 0.00712 0.02203 0.01764 ...
 - attr(*, "dimnames")=List of 2
  ..$ : NULL
  ..$ : chr [1:26] "h.asm.s1" "h.con.s1" "h.cor.s1" "h.var.s1" ...
options(digits=4, width=100)
haralickFeatures
      h.asm.s1 h.con.s1 h.cor.s1 h.var.s1 h.idm.s1 h.sav.s1 h.sva.s1 h.sen.s1 h.ent.s1 h.dva.s1
 [1,] 0.022224   3.8455   0.7456    8.559   0.3909    16.21   250.38   1.2483   1.7418   3.8455
 [2,] 0.012585   4.4215   0.8502   15.763   0.4295    29.07   818.19   1.4333   2.0212   4.4215
 [3,] 0.007124  16.2582   0.7255   30.612   0.3025    45.20  2006.48   1.5651   2.3143  16.2582
 [4,] 0.022026   1.8475   0.8924    9.582   0.5523    32.03   974.36   1.3421   1.7653   1.8475
 [5,] 0.017644   2.0354   0.8970   10.879   0.5416    31.29   931.33   1.3878   1.8426   2.0354
 [6,] 0.021749   1.7653   0.9078   10.573   0.5682    34.57  1139.58   1.3604   1.7779   1.7653
 [7,] 0.013924   3.4527   0.8805   15.449   0.4718    39.01  1464.00   1.4603   1.9906   3.4527
 [8,] 0.014018   2.8896   0.9029   15.887   0.4984    33.53  1085.51   1.4547   1.9549   2.8896
 [9,] 0.118404   5.0848   0.8988   26.130   0.5633    55.21  3004.93   1.2674   1.7165   5.0848
[10,] 0.070508   0.7958   0.7841    2.843   0.6917    22.74   478.44   1.0142   1.2724   0.7958
[11,] 0.117755   0.7929   0.6469    2.123   0.7150    22.09   453.66   0.8806   1.0929   0.7929
[12,] 0.019052   2.1181   0.8822    9.988   0.5226    29.30   815.66   1.3435   1.7948   2.1181
[13,] 0.104005   0.8071   0.5875    1.978   0.7079    14.52   190.24   0.8417   1.0818   0.8071
[14,] 0.102355   6.7783   0.8584   24.933   0.5233    54.93  2968.50   1.2727   1.7536   6.7783
[15,] 0.494436   9.1845   0.5674   11.614   0.7602    61.20  3698.75   0.6524   0.8468   9.1845
[16,] 0.471465   6.8751   0.6229   10.115   0.7601    61.40  3716.50   0.6764   0.8991   6.8751
[17,] 0.018188   3.1399   0.8390   10.752   0.4826    36.96  1302.91   1.3634   1.8676   3.1399
[18,] 0.398206   9.6490   0.6271   13.936   0.7046    60.46  3603.85   0.7798   1.0367   9.6490
[19,] 0.072663   6.5401   0.8631   24.880   0.4948    54.89  2958.74   1.3213   1.8221   6.5401
[20,] 0.021163   5.2949   0.6223    8.009   0.4286    23.09   500.35   1.2323   1.8300   5.2949
[21,] 0.011421   3.4193   0.8854   15.918   0.4416    36.37  1274.24   1.4718   2.0196   3.4193
[22,] 0.010491   4.8877   0.8690   19.648   0.4047    39.20  1491.54   1.4905   2.0666   4.8877
[23,] 0.031133   1.4491   0.8789    6.984   0.6097    27.50   710.41   1.2745   1.6548   1.4491
[24,] 0.040622   1.2458   0.8432    4.973   0.6328    26.62   662.07   1.1761   1.5235   1.2458
[25,] 0.025687   8.2625   0.8685   32.421   0.3862    50.09  2479.43   1.4932   2.1146   8.2625
[26,] 0.010082   5.0272   0.8692   20.218   0.4052    40.25  1572.32   1.5178   2.1160   5.0272
[27,] 0.014073   5.6684   0.8433   19.088   0.4313    46.30  2077.04   1.4605   2.0782   5.6684
[28,] 0.009097   4.8458   0.8840   21.881   0.3928    43.09  1806.17   1.5309   2.1400   4.8458
[29,] 0.025400   4.4500   0.5775    6.266   0.4156    33.37  1053.79   1.1648   1.6949   4.4500
[30,] 0.010761   5.4360   0.9030   29.018   0.4011    48.71  2330.38   1.5515   2.1595   5.4360
[31,] 0.011218   4.4797   0.8694   18.145   0.4337    43.00  1787.79   1.4807   2.0794   4.4797
[32,] 0.019212   4.3747   0.9194   28.133   0.4792    50.50  2503.18   1.5177   2.0593   4.3747
[33,] 0.009222   5.8258   0.8650   22.584   0.3973    42.12  1726.05   1.5506   2.1870   5.8258
[34,] 0.013840   6.4152   0.8893   29.986   0.4144    47.87  2255.38   1.5461   2.1593   6.4152
[35,] 0.329953  17.2167   0.5080   18.496   0.6483    59.76  3521.91   0.8610   1.1231  17.2167
[36,] 0.010473   4.6216   0.8466   16.061   0.3992    39.73  1519.99   1.4651   2.0598   4.6216
[37,] 0.083051   6.4902   0.8627   24.630   0.5080    54.66  2933.90   1.3114   1.8107   6.4902
[38,] 0.023596   2.5292   0.7938    7.133   0.4834    31.05   909.64   1.2526   1.7270   2.5292
[39,] 0.026801   1.6944   0.8657    7.310   0.5743    28.02   738.74   1.2772   1.6802   1.6944
[40,] 0.053604   9.2340   0.7684   20.938   0.4534    55.03  2953.18   1.3378   1.9122   9.2340
[41,] 0.017447   2.5536   0.8662   10.541   0.5106    31.94   969.96   1.3763   1.8740   2.5536
[42,] 0.010582   9.5952   0.7053   17.280   0.3182    36.23  1265.73   1.4422   2.0898   9.5952
[43,] 0.436319  10.2013   0.5770   13.059   0.7332    60.93  3662.32   0.7250   0.9569  10.2013
[44,] 0.258074   7.3100   0.7528   15.784   0.6363    59.30  3453.41   0.9733   1.3300   7.3100
[45,] 0.059910   1.4515   0.6942    3.374   0.5672    19.28   341.55   1.0221   1.3543   1.4515
[46,] 0.301235   7.6518   0.7383   15.618   0.6524    59.51  3484.18   0.9184   1.2562   7.6518
[47,] 0.016343   2.1269   0.9169   13.790   0.5362    35.06  1179.03   1.4469   1.9088   2.1269
[48,] 0.016675   6.1948   0.7189   12.021   0.4104    46.36  2063.93   1.3494   1.9703   6.1948
[49,] 0.013807   5.5517   0.8065   15.348   0.4164    47.74  2195.18   1.4403   2.0572   5.5517
[50,] 0.016387   2.7011   0.8530   10.185   0.4965    31.20   924.83   1.3580   1.8703   2.7011
[51,] 0.030667   1.4603   0.8664    6.463   0.5956    25.61   614.42   1.2324   1.6120   1.4603
[52,] 0.029860   1.7946   0.8140    5.823   0.5701    26.52   657.78   1.2137   1.6411   1.7946
[53,] 0.008802   5.1924   0.8643   20.130   0.3804    42.31  1735.24   1.5217   2.1479   5.1924
[54,] 0.014474   3.3030   0.8481   11.870   0.4527    35.34  1193.38   1.3793   1.9198   3.3030
[55,] 0.191807   5.9194   0.8573   21.734   0.6081    57.30  3235.12   1.1025   1.4992   5.9194
[56,] 0.028715   1.5953   0.9154   10.429   0.5989    25.87   638.17   1.3338   1.7186   1.5953
[57,] 0.010888   4.0323   0.9146   24.603   0.4467    47.90  2239.11   1.5478   2.1048   4.0323
[58,] 0.017029   3.2836   0.8518   12.081   0.4722    33.06  1045.14   1.3737   1.8770   3.2836
[59,] 0.022553   2.1714   0.8476    8.125   0.5126    26.74   672.82   1.3102   1.7707   2.1714
[60,] 0.036504   7.5008   0.8765   31.370   0.4186    51.55  2622.73   1.4646   2.0486   7.5008
[61,] 0.015874   3.1103   0.8586   12.002   0.4805    38.67  1429.44   1.4022   1.9256   3.1103
[62,] 0.023382   2.3135   0.8250    7.611   0.5282    31.23   920.36   1.2943   1.7558   2.3135
[63,] 0.015938   2.7924   0.8810   12.731   0.4989    36.09  1246.74   1.4158   1.9202   2.7924
[64,] 0.027671   1.6003   0.8596    6.698   0.5716    24.39   557.02   1.2406   1.6263   1.6003
[65,] 0.071228   0.7895   0.7929    2.906   0.6986    17.48   277.82   1.0184   1.2734   0.7895
[66,] 0.014803   2.2884   0.9253   16.313   0.5228    38.69  1443.71   1.4769   1.9496   2.2884
[67,] 0.019140   3.2590   0.8372   11.010   0.4753    36.05  1239.76   1.3680   1.8759   3.2590
[68,] 0.051484   1.0102   0.8203    3.812   0.6596    22.23   456.15   1.1116   1.4238   1.0102
[69,] 0.015627   3.8377   0.8479   13.615   0.4516    37.29  1334.65   1.3975   1.9362   3.8377
[70,] 0.032586   1.6664   0.8289    5.869   0.5924    26.72   667.98   1.2228   1.6255   1.6664
[71,] 0.048703   1.0672   0.8295    4.130   0.6579    20.75   396.15   1.1358   1.4567   1.0672
[72,] 0.154361   6.4140   0.8551   23.138   0.5641    56.69  3164.78   1.1730   1.6006   6.4140
[73,] 0.016355   3.9383   0.8524   14.340   0.4415    37.59  1359.13   1.3969   1.9385   3.9383
[74,] 0.025208   1.9476   0.8507    7.523   0.5493    28.18   747.37   1.2852   1.7277   1.9476
[75,] 0.076100   0.7171   0.8216    3.009   0.7208    20.66   393.17   1.0139   1.2382   0.7171
[76,] 0.097994   1.6667   0.0625    1.889   0.5000     9.00    70.86   0.6951   1.0343   1.6667
      h.den.s1 h.f12.s1 h.f13.s1 h.asm.s2 h.con.s2 h.cor.s2 h.var.s2 h.idm.s2 h.sav.s2 h.sva.s2
 [1,]   0.6232   0.2212   0.5929 0.025992   13.609   0.2132    9.648   0.2278    18.13    307.5
 [2,]   0.6944   0.2508   0.6632 0.012431   14.217   0.5565   17.027   0.2982    29.27    827.0
 [3,]   0.9491   0.1821   0.6091 0.007236   44.679   0.3663   36.252   0.1919    45.43   2022.7
 [4,]   0.5288   0.3290   0.7078 0.019348    5.011   0.6825    8.890   0.4067    32.51   1001.4
 [5,]   0.5503   0.3246   0.7143 0.013385    5.340   0.7327   10.991   0.4020    31.72    956.3
 [6,]   0.5266   0.3407   0.7198 0.016636    4.178   0.7566    9.583   0.4325    35.28   1184.3
 [7,]   0.6541   0.2975   0.7080 0.010355    8.755   0.6597   13.864   0.3313    39.95   1528.1
 [8,]   0.6178   0.3199   0.7246 0.010343    8.369   0.7037   15.122   0.3203    33.91   1104.2
 [9,]   0.7124   0.3223   0.6949 0.108581   11.313   0.7616   24.731   0.4872    56.04   3086.0
[10,]   0.3927   0.2828   0.5851 0.066460    1.467   0.5896    2.787   0.5901    22.70    478.0
[11,]   0.4063   0.2484   0.5163 0.151627    1.000   0.2194    1.641   0.6385    21.77    446.8
[12,]   0.5476   0.3103   0.6948 0.014531    6.074   0.6471    9.607   0.3587    29.97    850.1
[13,]   0.4073   0.1793   0.4381 0.070749    1.931   0.3148    2.409   0.5310    14.14    179.5
[14,]   0.7669   0.2876   0.6672 0.106626   18.774   0.5907   23.934   0.4380    55.73   3043.0
[15,]   0.5480   0.1835   0.3966 0.473235   12.362   0.2224    8.949   0.7462    61.90   3774.7
[16,]   0.5455   0.1982   0.4237 0.417110    9.374   0.2986    7.682   0.7168    61.89   3764.0
[17,]   0.6339   0.2590   0.6529 0.016725    7.675   0.5390    9.324   0.3715    37.57   1341.8
[18,]   0.6294   0.2090   0.4636 0.446429   16.085   0.2688   11.999   0.7061    61.22   3691.0
[19,]   0.7737   0.2828   0.6717 0.069931   16.516   0.6044   21.874   0.4024    56.03   3063.6
[20,]   0.7273   0.1318   0.4770 0.026783   14.040   0.1085    8.875   0.3096    22.71    482.3
[21,]   0.6356   0.3003   0.7143 0.010048    9.325   0.6894   16.014   0.2815    36.76   1298.4
[22,]   0.7076   0.2811   0.7009 0.018870   14.477   0.5907   18.685   0.2722    39.41   1503.9
[23,]   0.5004   0.3300   0.6929 0.023655    3.555   0.7043    7.011   0.4642    27.88    729.8
[24,]   0.4718   0.3013   0.6461 0.030493    2.752   0.6028    4.465   0.4828    27.25    694.0
[25,]   0.8256   0.2625   0.6871 0.029419   24.114   0.5924   30.584   0.2865    51.69   2619.4
[26,]   0.7189   0.2750   0.7005 0.009247   14.284   0.6488   21.334   0.2523    40.91   1622.4
[27,]   0.7496   0.2484   0.6673 0.013193   14.969   0.5635   18.146   0.3176    47.25   2156.4
[28,]   0.7047   0.2836   0.7120 0.008587   14.797   0.6470   21.960   0.2341    43.78   1856.8
[29,]   0.6919   0.1446   0.4819 0.070312   11.750  -0.3875    5.234   0.2181    33.25   1061.3
[30,]   0.7367   0.2931   0.7236 0.008997   15.886   0.6949   27.030   0.2692    49.56   2396.7
[31,]   0.7013   0.2617   0.6822 0.010505   11.390   0.6369   16.685   0.2873    43.88   1854.2
[32,]   0.7047   0.3322   0.7481 0.016839   13.410   0.7574   28.642   0.3444    50.81   2528.8
[33,]   0.7480   0.2609   0.6937 0.010777   15.306   0.6646   23.815   0.2885    42.27   1737.9
[34,]   0.7750   0.2822   0.7128 0.014349   15.726   0.7329   30.436   0.3078    48.52   2310.3
[35,]   0.7370   0.1660   0.4289 0.312643   21.179   0.2088   14.385   0.6343    60.52   3600.0
[36,]   0.6946   0.2634   0.6817 0.012893   10.528   0.5878   13.770   0.2674    40.76   1591.7
[37,]   0.7683   0.2878   0.6752 0.094428   14.932   0.6701   23.628   0.4530    55.53   3021.1
[38,]   0.5694   0.2505   0.6246 0.021910    5.515   0.4617    6.123   0.3521    32.07    970.6
[39,]   0.5211   0.3033   0.6720 0.022210    4.474   0.6376    7.172   0.4297    28.49    763.2
[40,]   0.8349   0.2038   0.5933 0.029757   22.777   0.4294   20.958   0.3274    55.49   2989.9
[41,]   0.5920   0.2883   0.6842 0.013745    5.744   0.6807    9.995   0.3701    32.52   1002.8
[42,]   0.8353   0.1958   0.6038 0.015163   21.962   0.3538   17.994   0.1802    36.85   1306.0
[43,]   0.6010   0.1792   0.4144 0.428952   13.080   0.2918   10.236   0.7093    61.52   3724.9
[44,]   0.6974   0.2369   0.5482 0.268438   14.853   0.3982   13.342   0.5959    60.05   3531.3
[45,]   0.4657   0.2393   0.5549 0.103448    4.103  -0.2081    2.698   0.4282    19.00    335.2
[46,]   0.6820   0.2349   0.5331 0.253679   14.493   0.4967   15.399   0.5862    59.76   3502.4
[47,]   0.5587   0.3514   0.7462 0.011913    5.355   0.7780   13.061   0.3745    35.69   1218.2
[48,]   0.7609   0.1720   0.5567 0.016197   13.776   0.3289   11.264   0.2826    47.14   2132.9
[49,]   0.7388   0.2283   0.6415 0.012400   14.015   0.4779   14.422   0.2888    48.54   2264.1
[50,]   0.6005   0.2639   0.6585 0.012180    8.167   0.5929   11.032   0.3172    31.35    932.7
[51,]   0.4929   0.3112   0.6693 0.020517    3.831   0.6558    6.565   0.4274    25.87    626.5
[52,]   0.5335   0.2543   0.6165 0.025794    3.923   0.5741    5.605   0.4314    26.85    674.2
[53,]   0.7167   0.2604   0.6887 0.007411   14.708   0.5993   19.352   0.2311    42.97   1781.3
[54,]   0.6309   0.2569   0.6574 0.012706    9.527   0.5873   12.541   0.3559    35.36   1193.0
[55,]   0.7032   0.2888   0.6302 0.205532   13.208   0.6358   19.133   0.5567    58.14   3318.4
[56,]   0.5134   0.3617   0.7293 0.020497    4.014   0.7790   10.083   0.4377    26.10    646.3
[57,]   0.6821   0.3262   0.7481 0.007444   11.473   0.7403   23.091   0.2926    48.69   2303.2
[58,]   0.6418   0.2810   0.6772 0.016475    8.455   0.5982   11.521   0.3496    33.84   1092.9
[59,]   0.5493   0.2786   0.6605 0.014844    5.627   0.6335    8.677   0.3487    27.31    701.8
[60,]   0.8079   0.2755   0.6930 0.033490   22.957   0.6245   31.570   0.3188    52.22   2678.7
[61,]   0.6293   0.2787   0.6811 0.013102    8.797   0.6183   12.525   0.3143    38.85   1442.0
[62,]   0.5756   0.2702   0.6497 0.019669    5.350   0.5683    7.196   0.3892    32.06    969.5
[63,]   0.6096   0.2979   0.6995 0.014074    7.330   0.7032   13.347   0.3764    36.45   1271.9
[64,]   0.5023   0.3189   0.6786 0.025222    3.807   0.6696    6.761   0.4113    24.19    548.2
[65,]   0.3931   0.2940   0.5961 0.056230    1.452   0.6207    2.913   0.5793    17.62    282.6
[66,]   0.5724   0.3601   0.7584 0.010258    6.300   0.7948   16.355   0.3572    39.32   1488.2
[67,]   0.6385   0.2690   0.6647 0.014965    8.870   0.5630   11.149   0.3378    36.89   1296.8
[68,]   0.4353   0.2932   0.6220 0.040242    1.829   0.6780    3.840   0.5545    22.33    461.0
[69,]   0.6690   0.2712   0.6748 0.014542   11.234   0.5655   13.926   0.3194    37.55   1351.3
[70,]   0.5244   0.2807   0.6417 0.025063    4.172   0.5720    5.874   0.4539    27.19    691.4
[71,]   0.4483   0.3035   0.6374 0.032932    2.470   0.6348    4.382   0.5135    20.80    398.8
[72,]   0.7389   0.2798   0.6371 0.171786   16.396   0.6086   21.946   0.5096    57.48   3245.0
[73,]   0.6732   0.2638   0.6672 0.020161   11.496   0.5679   14.301   0.3368    37.78   1370.6
[74,]   0.5447   0.2837   0.6597 0.019987    4.475   0.6256    6.975   0.4007    28.64    771.1
[75,]   0.3830   0.3312   0.6231 0.058423    1.351   0.6959    3.221   0.6306    20.74    396.3
[76,]   0.4260   0.1387   0.3780 0.000000    0.000   0.0000    0.000   0.0000     0.00      0.0
      h.sen.s2 h.ent.s2 h.dva.s2 h.den.s2 h.f12.s2 h.f13.s2
 [1,]   1.2031   1.6636   13.609   0.8430  0.16833   0.5133
 [2,]   1.3979   2.0907   14.217   0.9226  0.17791   0.5790
 [3,]   1.5400   2.2309   44.679   1.1333  0.21550   0.6454
 [4,]   1.2907   1.8594    5.011   0.7142  0.18325   0.5593
 [5,]   1.3616   1.9794    5.340   0.7311  0.18096   0.5705
 [6,]   1.3104   1.8777    4.178   0.6815  0.20337   0.5885
 [7,]   1.4114   2.0854    8.755   0.8189  0.16992   0.5666
 [8,]   1.4176   2.0677    8.369   0.8077  0.18022   0.5797
 [9,]   1.2468   1.7031   11.313   0.8479  0.23748   0.6067
[10,]   0.9708   1.3235    1.467   0.4909  0.15028   0.4399
[11,]   0.6696   0.9144    1.000   0.4125  0.07828   0.2679
[12,]   1.3008   1.9191    6.074   0.7445  0.15260   0.5212
[13,]   0.8809   1.2328    1.931   0.5221  0.08477   0.3215
[14,]   1.2351   1.6631   18.774   0.9239  0.20476   0.5619
[15,]   0.6215   0.7609   12.362   0.5800  0.13762   0.3261
[16,]   0.6797   0.8643    9.374   0.6122  0.10784   0.3063
[17,]   1.2855   1.9052    7.675   0.8056  0.12811   0.4791
[18,]   0.6946   0.8409   16.085   0.6244  0.15695   0.3653
[19,]   1.2881   1.8154   16.516   0.9411  0.18475   0.5558
[20,]   1.1472   1.7517   14.040   0.9178  0.14428   0.4883
[21,]   1.4326   2.0913    9.325   0.8137  0.19497   0.6029
[22,]   1.3665   1.8243   14.477   0.9086  0.22084   0.6035
[23,]   1.2497   1.7629    3.555   0.6548  0.18747   0.5528
[24,]   1.1216   1.6111    2.752   0.5935  0.14288   0.4686
[25,]   1.4400   2.0156   24.114   1.0236  0.20522   0.6077
[26,]   1.4713   2.1546   14.284   0.9126  0.20692   0.6259
[27,]   1.3905   2.0718   14.969   0.9304  0.16400   0.5562
[28,]   1.4955   2.1494   14.797   0.9139  0.17173   0.5764
[29,]   0.7526   1.1665   11.750   0.6773  0.42019   0.6799
[30,]   1.5106   2.1981   15.886   0.9419  0.19914   0.6205
[31,]   1.4158   2.1209   11.390   0.8746  0.16071   0.5565
[32,]   1.4998   2.1558   13.410   0.9132  0.21728   0.6393
[33,]   1.5066   2.1798   15.306   0.9340  0.20851   0.6308
[34,]   1.5256   2.1418   15.726   0.9471  0.23375   0.6578
[35,]   0.7948   0.9775   21.179   0.7217  0.13295   0.3605
[36,]   1.3794   1.9636   10.528   0.8353  0.14995   0.5221
[37,]   1.2604   1.7077   14.932   0.8770  0.25045   0.6219
[38,]   1.1568   1.7269    5.515   0.7025  0.14575   0.4876
[39,]   1.2371   1.8123    4.474   0.6968  0.16237   0.5235
[40,]   1.3332   1.9154   22.777   0.9835  0.15756   0.5285
[41,]   1.3294   1.9557    5.744   0.7369  0.16646   0.5467
[42,]   1.3496   1.8578   21.962   0.9672  0.24512   0.6363
[43,]   0.6819   0.8319   13.080   0.6239  0.11202   0.3066
[44,]   0.9209   1.2305   14.853   0.7805  0.17361   0.4567
[45,]   0.7642   1.0807    4.103   0.6600  0.17684   0.4349
[46,]   0.9457   1.2551   14.493   0.7899  0.18020   0.4691
[47,]   1.4077   2.0132    5.355   0.7182  0.21488   0.6198
[48,]   1.2554   1.9517   13.776   0.9048  0.10130   0.4336
[49,]   1.3752   2.0820   14.015   0.9111  0.12542   0.4931
[50,]   1.3419   2.0189    8.167   0.8018  0.13535   0.5040
[51,]   1.2084   1.7689    3.831   0.6565  0.15230   0.5029
[52,]   1.1625   1.7101    3.923   0.6643  0.12201   0.4464
[53,]   1.4688   2.2105   14.708   0.9090  0.16790   0.5772
[54,]   1.3551   2.0023    9.527   0.8425  0.17273   0.5614
[55,]   1.0549   1.4180   13.208   0.8010  0.21490   0.5378
[56,]   1.3215   1.8294    4.014   0.6598  0.24728   0.6350
[57,]   1.5102   2.2275   11.473   0.8771  0.20095   0.6261
[58,]   1.2990   1.9210    8.455   0.8162  0.18263   0.5659
[59,]   1.2979   1.9320    5.627   0.7185  0.14407   0.5091
[60,]   1.4335   2.0291   22.957   1.0073  0.21006   0.6155
[61,]   1.3683   2.0252    8.797   0.8222  0.15747   0.5409
[62,]   1.2409   1.8537    5.350   0.7182  0.14423   0.5003
[63,]   1.3844   1.9997    7.330   0.7932  0.20579   0.6065
[64,]   1.1938   1.6611    3.807   0.6439  0.19474   0.5488
[65,]   0.9947   1.3560    1.452   0.4786  0.16146   0.4604
[66,]   1.4597   2.0875    6.300   0.7553  0.22474   0.6407
[67,]   1.3262   1.9658    8.870   0.8251  0.15125   0.5245
[68,]   1.0839   1.5054    1.829   0.5243  0.17910   0.5063
[69,]   1.3483   1.9751   11.234   0.8667  0.18169   0.5711
[70,]   1.1854   1.7241    4.172   0.6897  0.15411   0.5001
[71,]   1.1119   1.5940    2.470   0.5784  0.16389   0.4976
[72,]   1.1107   1.5097   16.396   0.8601  0.22324   0.5619
[73,]   1.3292   1.9241   11.496   0.8803  0.17627   0.5573
[74,]   1.2242   1.7943    4.475   0.6818  0.16536   0.5257
[75,]   1.0277   1.3571    1.351   0.4846  0.21405   0.5270
[76,]   0.0000   0.0000    0.000   0.0000  0.00000   0.0000

Correlations of Haralick features

correlationMatrix <- cor(haralickFeatures)
correlationMatrix
##          h.asm.s1 h.con.s1 h.cor.s1  h.var.s1 h.idm.s1 h.sav.s1 h.sva.s1 h.sen.s1 h.ent.s1 h.dva.s1
## h.asm.s1  1.00000  0.47368 -0.51077 -0.031988  0.66446  0.52951  0.64284 -0.80003 -0.76562  0.47368
## h.con.s1  0.47368  1.00000 -0.27150  0.634937 -0.20300  0.75491  0.76844 -0.06138  0.04364  1.00000
## h.cor.s1 -0.51077 -0.27150  1.00000  0.330692 -0.26615  0.07788 -0.05427  0.72823  0.62964 -0.27150
## h.var.s1 -0.03199  0.63494  0.33069  1.000000 -0.53337  0.73935  0.68147  0.51746  0.56754  0.63494
## h.idm.s1  0.66446 -0.20300 -0.26615 -0.533369  1.00000 -0.05902  0.05482 -0.82354 -0.89955 -0.20300
## h.sav.s1  0.52951  0.75491  0.07788  0.739352 -0.05902  1.00000  0.98299  0.01296  0.07189  0.75491
## h.sva.s1  0.64284  0.76844 -0.05427  0.681472  0.05482  0.98299  1.00000 -0.14337 -0.07953  0.76844
## h.sen.s1 -0.80003 -0.06138  0.72823  0.517460 -0.82354  0.01296 -0.14337  1.00000  0.98501 -0.06138
## h.ent.s1 -0.76562  0.04364  0.62964  0.567538 -0.89955  0.07189 -0.07953  0.98501  1.00000  0.04364
## h.dva.s1  0.47368  1.00000 -0.27150  0.634937 -0.20300  0.75491  0.76844 -0.06138  0.04364  1.00000
## h.den.s1 -0.07778  0.74726  0.16229  0.859731 -0.70482  0.68825  0.61617  0.51238  0.61817  0.74726
## h.f12.s1 -0.40751 -0.52940  0.80732  0.080132  0.06648 -0.14641 -0.22123  0.45178  0.30345 -0.52940
## h.f13.s1 -0.71545 -0.33387  0.90495  0.370768 -0.47526 -0.05803 -0.19477  0.86404  0.77495 -0.33387
## h.asm.s2  0.98538  0.49199 -0.45537 -0.004335  0.63909  0.55795  0.65999 -0.76453 -0.73129  0.49199
## h.con.s2  0.11126  0.88462 -0.01167  0.796214 -0.52568  0.65910  0.62901  0.29491  0.40239  0.88462
## h.cor.s2 -0.36699 -0.28246  0.80558  0.292590 -0.07508  0.05687 -0.03050  0.55226  0.44286 -0.28246
## h.var.s2 -0.11763  0.60768  0.36636  0.986518 -0.58778  0.66518  0.59946  0.58057  0.63002  0.60768
## h.idm.s2  0.74432  0.05073 -0.10203 -0.284392  0.91269  0.22607  0.31156 -0.71574 -0.77833  0.05073
## h.sav.s2  0.50918  0.74434  0.13332  0.740204 -0.06375  0.99689  0.97284  0.04255  0.09564  0.74434
## h.sva.s2  0.63628  0.76705 -0.04399  0.685802  0.04908  0.98424  0.99974 -0.13465 -0.07154  0.76705
## h.sen.s2 -0.67092 -0.02304  0.85486  0.525040 -0.65815  0.10492 -0.04762  0.94298  0.90534 -0.02304
## h.ent.s2 -0.72583 -0.07937  0.82090  0.460260 -0.69448  0.03900 -0.11829  0.95599  0.92510 -0.07937
## h.dva.s2  0.11126  0.88462 -0.01167  0.796214 -0.52568  0.65910  0.62901  0.29491  0.40239  0.88462
## h.den.s2 -0.30263  0.49041  0.54702  0.782777 -0.71850  0.52556  0.40945  0.73274  0.78407  0.49041
## h.f12.s2 -0.23789  0.11785  0.44471  0.404242 -0.30697  0.20950  0.13411  0.42094  0.40285  0.11785
## h.f13.s2 -0.56680  0.02066  0.81045  0.530306 -0.56863  0.15805  0.01967  0.82777  0.78886  0.02066
##            h.den.s1 h.f12.s1 h.f13.s1  h.asm.s2 h.con.s2   h.cor.s2 h.var.s2 h.idm.s2 h.sav.s2
## h.asm.s1 -0.0777753 -0.40751 -0.71545  0.985377  0.11126 -0.3669857  -0.1176  0.74432  0.50918
## h.con.s1  0.7472575 -0.52940 -0.33387  0.491994  0.88462 -0.2824569   0.6077  0.05073  0.74434
## h.cor.s1  0.1622943  0.80732  0.90495 -0.455366 -0.01167  0.8055827   0.3664 -0.10203  0.13332
## h.var.s1  0.8597313  0.08013  0.37077 -0.004335  0.79621  0.2925897   0.9865 -0.28439  0.74020
## h.idm.s1 -0.7048215  0.06648 -0.47526  0.639095 -0.52568 -0.0750848  -0.5878  0.91269 -0.06375
## h.sav.s1  0.6882488 -0.14641 -0.05803  0.557952  0.65910  0.0568716   0.6652  0.22607  0.99689
## h.sva.s1  0.6161698 -0.22123 -0.19477  0.659991  0.62901 -0.0305023   0.5995  0.31156  0.97284
## h.sen.s1  0.5123797  0.45178  0.86404 -0.764532  0.29491  0.5522633   0.5806 -0.71574  0.04255
## h.ent.s1  0.6181704  0.30345  0.77495 -0.731293  0.40239  0.4428624   0.6300 -0.77833  0.09564
## h.dva.s1  0.7472575 -0.52940 -0.33387  0.491994  0.88462 -0.2824569   0.6077  0.05073  0.74434
## h.den.s1  1.0000000 -0.26105  0.18333 -0.036403  0.90495  0.0002202   0.8615 -0.42969  0.69092
## h.f12.s1 -0.2610455  1.00000  0.83367 -0.396447 -0.38053  0.8437773   0.0936  0.04258 -0.11589
## h.f13.s1  0.1833271  0.83367  1.00000 -0.686852 -0.02759  0.8129299   0.4144 -0.41805 -0.02310
## h.asm.s2 -0.0364032 -0.39645 -0.68685  1.000000  0.14633 -0.3913314  -0.0901  0.75994  0.54466
## h.con.s2  0.9049452 -0.38053 -0.02759  0.146329  1.00000 -0.1366918   0.8158 -0.25596  0.65833
## h.cor.s2  0.0002202  0.84378  0.81293 -0.391331 -0.13669  1.0000000   0.3143 -0.02785  0.08360
## h.var.s2  0.8614716  0.09360  0.41441 -0.090100  0.81579  0.3142634   1.0000 -0.34368  0.66829
## h.idm.s2 -0.4296859  0.04258 -0.41805  0.759940 -0.25596 -0.0278492  -0.3437  1.00000  0.23883
## h.sav.s2  0.6909192 -0.11589 -0.02310  0.544662  0.65833  0.0836040   0.6683  0.23883  1.00000
## h.sva.s2  0.6200413 -0.21461 -0.18540  0.654751  0.62992 -0.0239530   0.6029  0.30867  0.97518
## h.sen.s2  0.4781344  0.53303  0.87337 -0.635392  0.29878  0.6879302   0.5894 -0.48626  0.14942
## h.ent.s2  0.4514830  0.49026  0.85757 -0.693474  0.25287  0.6415864   0.5288 -0.55074  0.08136
## h.dva.s2  0.9049452 -0.38053 -0.02759  0.146329  1.00000 -0.1366918   0.8158 -0.25596  0.65833
## h.den.s2  0.8760303  0.04816  0.48780 -0.240788  0.74927  0.2599108   0.8158 -0.40946  0.55871
## h.f12.s2  0.3685400  0.30712  0.42017 -0.155883  0.29319  0.1387164   0.4277 -0.15529  0.23450
## h.f13.s2  0.4809108  0.53445  0.80056 -0.497678  0.32453  0.5271276   0.5861 -0.37637  0.20186
##          h.sva.s2 h.sen.s2 h.ent.s2 h.dva.s2 h.den.s2 h.f12.s2 h.f13.s2
## h.asm.s1  0.63628 -0.67092 -0.72583  0.11126 -0.30263  -0.2379 -0.56680
## h.con.s1  0.76705 -0.02304 -0.07937  0.88462  0.49041   0.1178  0.02066
## h.cor.s1 -0.04399  0.85486  0.82090 -0.01167  0.54702   0.4447  0.81045
## h.var.s1  0.68580  0.52504  0.46026  0.79621  0.78278   0.4042  0.53031
## h.idm.s1  0.04908 -0.65815 -0.69448 -0.52568 -0.71850  -0.3070 -0.56863
## h.sav.s1  0.98424  0.10492  0.03900  0.65910  0.52556   0.2095  0.15805
## h.sva.s1  0.99974 -0.04762 -0.11829  0.62901  0.40945   0.1341  0.01967
## h.sen.s1 -0.13465  0.94298  0.95599  0.29491  0.73274   0.4209  0.82777
## h.ent.s1 -0.07154  0.90534  0.92510  0.40239  0.78407   0.4029  0.78886
## h.dva.s1  0.76705 -0.02304 -0.07937  0.88462  0.49041   0.1178  0.02066
## h.den.s1  0.62004  0.47813  0.45148  0.90495  0.87603   0.3685  0.48091
## h.f12.s1 -0.21461  0.53303  0.49026 -0.38053  0.04816   0.3071  0.53445
## h.f13.s1 -0.18540  0.87337  0.85757 -0.02759  0.48780   0.4202  0.80056
## h.asm.s2  0.65475 -0.63539 -0.69347  0.14633 -0.24079  -0.1559 -0.49768
## h.con.s2  0.62992  0.29878  0.25287  1.00000  0.74927   0.2932  0.32453
## h.cor.s2 -0.02395  0.68793  0.64159 -0.13669  0.25991   0.1387  0.52713
## h.var.s2  0.60295  0.58939  0.52878  0.81579  0.81585   0.4277  0.58611
## h.idm.s2  0.30867 -0.48626 -0.55074 -0.25596 -0.40946  -0.1553 -0.37637
## h.sav.s2  0.97518  0.14942  0.08136  0.65833  0.55871   0.2345  0.20186
## h.sva.s2  1.00000 -0.03817 -0.10903  0.62992  0.41666   0.1372  0.02746
## h.sen.s2 -0.03817  1.00000  0.98851  0.29878  0.77925   0.3986  0.85776
## h.ent.s2 -0.10903  0.98851  1.00000  0.25287  0.75239   0.3475  0.82312
## h.dva.s2  0.62992  0.29878  0.25287  1.00000  0.74927   0.2932  0.32453
## h.den.s2  0.41666  0.77925  0.75239  0.74927  1.00000   0.4349  0.72616
## h.f12.s2  0.13719  0.39862  0.34749  0.29319  0.43488   1.0000  0.80844
## h.f13.s2  0.02746  0.85776  0.82312  0.32453  0.72616   0.8084  1.00000

Heatmaps of correlation matrix

Color-coded display of correlation matrix

library(gplots)         # heatmap.2
library(RColorBrewer)   # brewer.pal
heatmap.2(correlationMatrix, dendrogram="none", Rowv=FALSE, symm=TRUE,
          main="Texture Features",
          scale="none", col=brewer.pal(11,"RdBu"), margins=c(7,7), trace="none")

Dendrograms show relationships in correlation matrix

heatmap.2(correlationMatrix, key=FALSE,
          main="Haralick Texture Features",
          scale="none", col=brewer.pal(11,"RdBu"), margins=c(7,7), trace="none")

A diverging palette from RColorBrewer is used for the heatmaps since correlations can range from -1 to +1. In the RdBu pallete, red is low and blue is high.


packageVersion("EBImage")
## [1] '4.8.2'
packageVersion("gplots")
## [1] '2.16.0'
packageVersion("RColorBrewer")
## [1] '1.1.2'

efg
2015-01-22 2328