Graphic STI
logo EPFL
english only
Biomedical Imaging Group
BIG > Algorithms > OrientationJ

Home Page






Download Algorithms






Test images

Conditions of use



Plugin for ImageJ

[Version 16.01.2018]


ImageJ's plugin for directional analysis in images

Written by Daniel Sage at the Biomedical Image Group (BIG), EPFL, Switzerland

Slowly variation of the structure tensor window ImageJ Macro to produce this series of images


The aim is to characterize the orientation and isotropy properties of a region of interest (ROI) in an image, based on the evaluation of the structure tensor in a local neighborhood. The theoretical background is fully described in this PDF document. The software OrientationJ automates the orientation analysis. It is a Java plug-in for ImageJ. OrientationJ has four functionalities: visual representation of the orientation, quantitative orientation measurement, making distribution of orientations and corner detection (Harris Corner).


Reference on method:

Z. Püspöki, M. Storath, D. Sage, M. Unser, "Transforms and Operators for Directional Bioimage Analysis: A Survey," Advances in Anatomy, Embryology and Cell Biology, vol. 219, Focus on Bio-Image Informatics, Springer International Publishing, ch. 3, pp. 69-93, May 21, 2016.

Reference on the angular distribution:

R. Rezakhaniha, A. Agianniotis, J.T.C. Schrauwen, A. Griffa, D. Sage, C.V.C. Bouten, F.N. van de Vosse, M. Unser, N. Stergiopulos, "Experimental Investigation of Collagen Waviness and Orientation in the Arterial Adventitia Using Confocal Laser Scanning Microscopy," Biomechanics and Modeling in Mechanobiology, vol. 11, no. 3-4, pp. 461-473, 2012.

Reference on the local measurements:

E. Fonck, G.G. Feigl, J. Fasel, D. Sage, M. Unser, D.A. Rüfenacht, N. Stergiopulos, "Effect of Aging on Elastin Functionality in Human Cerebral Arteries," Stroke, vol. 40, no. 7, pp. 2552-2556, July 2009.


Visual orientation analysis

Qualitative or visual mode: the user specifies the size of a Gaussian-shaped window, and the program computes the structure tensor for each pixel in the image by sliding the Gaussian analysis window over the entire image. The local orientation properties are computed according to the equations above and are then visualized as gray level or color images with the orientation being typically encoded in the color (hue).

In the left example, the original image (source) is used as input of the structure tensor computation. The program computes the local orientation and the local coherency. The feature are gather in color map in HSB mode, e.g, hue is orientation, saturation is coherency, and brigthness is the source image.

SourceColor SurveyCoherencyOrientation
Courtesy of Carole Aemisegger, ZMB, University of Zürich.


Circular color map coding, Courtesy of Urszula Zajaczkowska.


Quantitative orientation measurement

Quantitative mode: the user specifies a sequence of ROIs and the software saves the corresponding orientation features in a spreadsheet. The weighting function in this mode is the ROI window with uniform weights.


Courtesy of Edouard Fonck, LHCT, EPFL, Lausanne.



Distribution of orientations

The orientation is evaluated for every pixel of the image based on the structure tensor. A histogram of orientations is built taken into account the pixel that have a coherency larger than min-coherency and an energy larger than min-energy. The histogram is a weighted histogram, the weigth is the coherency itself. The min-coherency is expressed is % since the coherency factor is a index between 0 and 1. The min-energy is expressed in % of the maximum energy of the image.

  • Click to enlarge the figure
  • montage3.jpg

    Courtesy of Rana Rezakhaniha, LHCT, EPFL, Lausanne.


    Vector Field

    The orientation is evaluated for every patch of the image based which allows to visualize the orientation of the vector. The module of the vector is usually proportional to the coherency and a scale factor provided by the user.


    Courtesy of Rana Rezakhaniha, LHCT, EPFL, Lausanne.


    Harris corner detection

    Based on structure tensor computation, the Harris index is evaluated. The local maximum of the Harris index represent corners in images.


    Courtesy of Wikipedia.



    Free and easy-to-use software

    We provide a software OrientationJ to produce to visualize and to measure the orientation in the images. The software is a plugin of ImageJ, a general purpose image-processing package. ImageJ has a public domain licence; it runs on several plateforms: Unix, Linux, Windows, Mac OSX.

    OrientationJ contains 3 ImageJ plugins.

    Installation for final users

    1. Get a copy of ImageJ.
    2. Download the plugin: OrientationJ_.jar (16.01.2018).
    3. Place the file OrientationJ_.jar in the "plugins" folder of ImageJ.

    Installation for macro development

    1. Get a copy of ImageJ.
    2. Download the archive: (16.01.2018) and unzip it.
    3. Place the folder OrientationJ in the "plugins" folder of ImageJ.
    4. Call OrientationJ Analysis from a macro:
      // Call the Analysis plugin from a ImageJ macro
      run("OrientationJ Analysis", "tensor=1.0 gradient=0 orientation=on coherency=on color-survey=on hue=Orientation sat=Coherency bri=Original-Image ");
      // tensor: value of the standard deviation of the Gaussian local window of the structure tensor
      // gradient: index of the used gradient (0: Cubic Spline, 1: Finite difference, 2: Fourier; 3: Riesz, 4: Gaussian)
      // orientation: display the orientation map if it is set to on
    5. Call OrientationJ Measure from a macro:
      // Call the Measure plugin from a ImageJ macro
      makeRectangle(250, 250, 50, 50);
      run("OrientationJ Measure", "sigma=.0.0");
      // sigma: standard deviation of the Laplacian of Gaussian prefilter
      // The results are displayed on the log window of ImageJ in tab-separated format

    Java source code

    Git Repository:

    Conditions of use

    Test images

    artificial-fibers.tif collagen-mip.tif test-orientation.tif Ms. Steerable.tif test-orientation.tif

    artificial fibers

    Download in TIFF format


    Download in TIFF format


    Download in TIFF format

    Ms. Steerable

    Download in TIFF format


    Download in TIFF format

    Analysis on Test Image

    Vector Field on Test Image

    Distribution on Test Image