Revision as of 12:11, 2 March 2010 by White (talk | contribs) (How does it work?: fourier not fouroer)
Directionality (Fiji)
Author Jean-Yves Tinevez
Maintainer Jean-Yves Tinevez ([1])
File Directionality_.jar
Initial release March 1st, 2010
Latest version March 1st, 2010
Development status v1.0 - bug review
Category Analysis


Directionality Example.png

This plugin is used to infer the preferred orientation of structures present in the input image. It computes a histogram indicating the amount of structures in a given direction. Images with completely isotropic content are expected to give a flat histogram, whereas images in which there is a preferred orientation are expected to give a histogram with a peak at that orientation.

For instance, in the pine tree branch pictured above, the needle shaped leaves exist in 2 populations, one with a preferred orientation at about 45º, and another one with preferred orientation around -45º. This is well detected by the plugin, which reports two main peaks at 60º and -60º. On top of that, a minor peak can be seen around 0º, reporting the main branch orientation.

Angles are reported in their common mathematical sense. That is: 0º is the East direction, and the orientation is counterclockwise.

Statistics generated

On top of the histogram, the plugin tries to generate statistics on the highest peak found.

  • The highest peak is fitted by a Gaussian function, taking into account the periodic nature of the histogram.
  • The 'Direction (º)' column reports the center of the gaussian.
  • The 'Dispersion (º)' column reports the standard deviation of the gaussian.
  • The 'Amount' column is the sum of the histogram from center-std to center+std, divided by the total sum of the histogram. The real histogram values are used for the summation, not the gaussian fit.
  • The 'Goodness' column reports the goodness of the fit; 1 is good, 0 is bad.

A study made on artificial images reveal that the 'Amount' value as calculated here underestimates the real proportion of structures with the preferred orientation. So for the pine image up there, one can conclude that the proportion of needle leaves oriented around +60º is at least 25% (however, the image is not completely uniform, which cripples the meaning of this amount value).

Results data export

  1. Save the Directionality Results window contents to a spreadsheet by copy pasting.
  2. If you want to save an image of the histogram, right-click on the plot, and choose save as.
  3. If you want to export the histogram data, check the Data table box in the plugin dialog window. This will generate a results table, that can be exported as a csv file with a right click, or copy pasted directly into a spreadsheet etc.

How does it work?

Different solutions have been thought about, but so far, only one has been implemented:

The method implemented is based on Fourier spectrum analysis. For a square image, structures with a preferred orientation generate a periodic pattern at +90º orientation in the Fourier transform of the image, compared to the direction of the objects in the input image. This plugin chops the image into square pieces, and computes their Fourier power spectra. The later are analyzed in polar coordinates, and the power is measured for each angle using the spatial filters proposed in [1]

Wish list for this plugin

Possible way for further developments:

  • Implements another way to analyze the image, e.g using local gradient orientation.
  • Have a peak finder that can deal with multiple peaks and return statistics on them.


  • [1] Liu. Scale space approach to directional analysis of images. Appl. Opt. (1991) vol. 30 (11) pp. 1369-1373

A discussion with A. Leroy is greatly acknowledged.