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

Home Page






Download Algorithms




Software Package

Test images

Studies On Image Directionalies

Application Cases



Plugins for ImageJ


Java source code

Version 2.0.5

12 May 2020


A series of ImageJ plugins for directional image analysis

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


Slow variation of the local window of the gradient structure tensor

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 gradient structure tensor in a local neighborhood. The theoretical background is fully described in this PDF document. The software package OrientationJ automates the orientation analysis with four functionalities: performing a visual representation of the orientation of a image, creation of a vector field map, plotting the distribution of orientations, and detection of keypoints (Harris Corner). OrientationJ has also others tools: the manual measurement of the orientation and coherency in a ROI, the computation of the dominant orientation, the alignment of images based on the gradient structure tensor and some test images (chirp).

OrientationJ is a software package which consists of a series of plugins for ImageJ and Fiji. It is a open source project available on GitHub.

OrientationJ has a companion plugin MonogenicJ that performs multiresolution directional image analysis.


Reference on the 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, Springer International Publishing, ch. 3, 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
Biomechanics and Modeling in Mechanobiology, vol. 11, 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, 2009.

Visual directional analysis


Circular color map coding, Courtesy of Urszula Zajaczkowska.

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.


Original image
Courtesy of Carole Aemisegger, ZMB, University of Zürich.


Color survey





Distribution of orientations


Courtesy of Rana Rezakhaniha, LHCT, EPFL, Lausanne.

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.

Vector Field


Courtesy of Rana Rezakhaniha, LHCT, EPFL, Lausanne.

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.

Quantitative orientation measurement


Courtesy of Edouard Fonck, LHCT, EPFL, Lausanne.

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.

Harris corner detection


Courtesy of Wikipedia.

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


Free and easy-to-use software

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


ImageJ Macro

The OrientationJ plugins are recordable on ImageJ.

Example of macro: OrientationJ Analysis

// Call the Analysis plugin from a ImageJ macro
run("Straight Lines");
run("OrientationJ Analysis", "tensor=1.0 gradient=0 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)
// color-survey: to display the color-coded HSB

Example of macro: OrientationJ Measure

// 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

Example of macro: omparison of the isotropic properties of the gradient

run("Chirp Image Custom", "width=512 height=512");
run("OrientationJ Distribution", "tensor=1.0 gradient=0 radian=on histogram=on min-coherency=20.0 min-energy=10.0 ");
rename("Histogram Cubic Spline)");
run("OrientationJ Distribution", "tensor=1.0 gradient=1 radian=on histogram=on min-coherency=20.0 min-energy=10.0 ");
rename("Histogram (Finite Difference)");
run("OrientationJ Distribution", "tensor=1.0 gradient=2 radian=on histogram=on min-coherency=20.0 min-energy=10.0 ");
rename("Histogram (Fourier)");
run("OrientationJ Distribution", "tensor=1.0 gradient=4 radian=on histogram=on min-coherency=20.0 min-energy=10.0 ");
rename("Histogram (Gaussian)");


Conditions of use

Test images

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

artificial fibers






Ms. Steerable




Analysis on Test Image

Vector Field on Test Image

Distribution on Test Image

Studies On Image Directionalities

On the orientation analysis of digitized images

Helmut Günder

Validation of the fiber orientation

Reference: Erica E. Morrill, Azamat N. Tulepbergenov, Christina J. Stender, Roshani Lamichhane, Raquel J. Brown, Trevor J. Lujan, A validated software application to measure fiber organization in soft tissue Biomechanics and Modeling in Mechanobiology, December 2016.


DiameterJ is a validated nanofiber diameter characterization tool. DiameterJ is able to analyze an image and find the diameter of nanofibers or microfibers at every pixel along a fibers axis and produces a histogram of these diameters.

Reference: Hotaling NA, Bharti K, Kriel H, Simon Jr. CG. DiameterJ: A validated open source nanofiber diameter measurement tool. Biomaterials 2015.

ImageJ plugin: Directionality

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.


Application Cases of OrientationJ

  1. «The alignment of the trabeculae in all areas of interest was assessed using OrientationJ.»
    S.A. Sampath et al., Trabecular orientation in the human femur and tibia and the relationship with lower-limb alignment for patients with osteoarthritis of the knee, Journal of Biomechanics 48, Issue 6, 2015.
  2. ««It used to measure cellular ordering in regenerating plant tissues»
    Urszula Zajaczkowska, Ordering of the cellular arrangement and xylogenesis in wounded shoots of willow, International Association of Wood Anatomists Journal 36, 387-399, 2015.
  3. «For measurements of cellular ordering in the region of regenerating tissues the digital image analysis software OrientationJ was adopted.»
    Urszula Zajaczkowska, Regeneration of Scots pine stem after wounding, International Association of Wood Anatomists Journal 35, 2014
  4. «Fiber orientation was captured using the OrientationJ plugin to the ImageJ (NIH) software.»
    M. Sharabi et al., Laminated collagen-fiber bio-composites for soft-tissue bio-mimetics, Composites Science and Technology 117, Elsevier, 2015.
  5. «Quantification of fiber alignment using the OrientationJ plugin11 was performed in ImageJ. The OrientationJ plugin outputs the data after the histogram of angles has been assembled.»
    T. Fee et al., Image‐based quantification of fiber alignment within electrospun tissue engineering scaffolds is related to mechanical anisotropy, Journal of Biomedical Materials Research 104(7), Wiley, 2016.
  6. «... we used the ImageJ plugin OrientationJ to calculate the orientation of the MWCNTs aligned in the polymer thin-films»
    D. Changqin et al., Second Harmonic Generation of Unpolarized Light, Physical Review Letters 119, 2017.
    1. «The orientation of neurites of RGCs on scaffolds were measured using the ImageJ plugin OrientationJ. The ellipses were made using the "measure" function of the plugin with the Laplacian of Gaussian set to zero. The eccentricity of the ellipses demonstrates calculated coherence of the direction of neurites... The frequency of neurites extending toward an arbitrary direction was measured by the Distribution function of the OrientationJ plugin. »
      J. Hertz et al., A tunable synthetic hydrogel system for culture of retinal ganglion cells and amacrine cells, Acta Biomaterialia 9, 2013.
    2. « Image analysis with OrientationJ. This methodology uses a Java plugin for ImageJ/FIJI, called OrientationJ. OrientationJ was designed to characterize the orientation and isotropic properties of a region of interest in an image, based on the evaluation of the structure tensor in a local neighbourhood.»
      T. D. Clemons et al., Coherency image analysis to quantify collagen architecture: implications in scar assessment, RSC Advances, Royal Society of Chemistry 8, 2018.
    3. «Grayscale confocal reflectance images of collagen fibers were analyzed and colorized with OrientationJ such that pixel hue corresponded to the angle of local fiber orientation, which could range from −90° to +90° relative to horizontal.»
      S. P. Carey et al., Leading malignant cells initiate collective epithelial cell invasion in a three-dimensional heterotypic tumor spheroid model, Clinical & Experimental Metastasis 30, 2013.
    4. «Thus, OrientationJ measures the orientation features of the objects in the digital image. OrientationJ has been proven to be a very useful tool for quantifying in 3D the orientation characteristics of the collagen fibrils in arterial walls and articular cartilage.»
      J.P. Wu et al., High‐resolution study of the 3D collagen fibrillary matrix of Achilles tendons without tissue labelling and dehydrating, Journal of Microscopy, 2017.
    5. «The orientation can be calculated with OrientationJ. »
      M. Rosalien et al., Mechanical characterization of arterial tissue: Simultaneous confocal imaging and tensile testing, Proceedings of the 3rd Joint Workshop on New Technologies for Computer/Robot Assisted Surgery, 2013.
    6. «The grey-scale SEM images were analysed through the OrientationJ plug-in (EPFL, Switzerland) available in ImageJ software (NIH, Maryland, USA). Briefly, for every image (Fig. 2a), the software evaluated the structure tensor of every Gaussian-shaped window (defined as 0.5 pixels) by computing the continuous spatial derivatives in the x and y dimensions using Gaussian interpolation. From the structure tensor of every window, the local predominant orientation (corresponding to the orientation of the largest eigenvector of the structure tensor), the energy (defined as the trace of the structure tensor matrix) and the coherency (defined as the ratio between the difference and the sum of the maximum and minimum tensor eigenvalues) were computed. »
      D. U. Shaha et al., The biocomposite tube of a chaetopterid marine worm constructed with highly-controlled orientation of nanofilaments, Materials Science and Engineering: C, Volume 48, 1 March 2015.
    7. «Qualitative and quantitative analysis of the directionality of neurite outgrowth was performed using the ImageJ plug-in OrientationJ.»
      F. Gesellchen et al., Cell patterning with a heptagon acoustic tweezer – application in neurite guidance, Lab Chip, Royal Society of Chemistry 14, 2014.
    8. «Images were analyzed using an ImageJ plugin, OrientationJ. Briefly, this plugin created color-coded overlays based on local orientation in addition to providing numeric orientation values. Color-coded images were then used to qualitatively assess cell orientation»
      M. WinklerMelinda et al., A microfabricated, optically accessible device to study the effects of mechanical cues on collagen fiber organization, Biomedical Microdevices 16, 2014.