How do I edit this website?

AnDi-J

AnDi-J logo

AnDi-J is a Fiji/ImageJ plugin for anomalous-diffusion analysis of single-particle tracking (SPT) data. Given input trajectories, it provides state-of-the-art machinery to analyse them, combining statistical and machine learning (ML) analysis. The plugin works at two scales: from single-trajectory analysis, returning properties for each of the input trajectories, to “per-frame” predictions, allowing for a fine-grained analysis and the segmentation of trajectories with expected diffusion changes.

An up-to-date version of this wiki is available in Github. We strongly suggest following that, as it is more regularly updated.

Overview

AnDi-J is organised around two menu commands under Plugins › AnDi-J:

Command Purpose
Trajectory Analysis Per-trajectory observables: mean squared displacement (MSD) analysis, diffusion coefficient D, anomalous exponent α, the D–α plane, diffusion-model classification, turning angles and PSD.
Trajectory Segmentation Per-frame predictions of α and D along each trajectory, change-point detection that splits it into homogeneous segments, and the diffusive state (immobile, confined, free diffusion, or directed) of each segment.

Both commands share the same Data Manager for loading and grouping data, and both can analyse several experiments (conditions) at once, each with its own colour, overlaid for comparison.

Documentation

Page Contents
Input data Expected .csv layout, the Data Manager (loading trajectories, units), and selecting the segmentation model.
Trajectory Analysis tMSD, diffusion coefficient, anomalous exponent, D vs α, diffusion model, turning angles and PSD.
Trajectory Segmentation Visualization, D vs α density, segment stats and diffusive state.
ML models The bundled models, the ONNX contract, how to plug in your own models, and how to contribute them.

Installation

From the update site

The easiest way to install AnDi-J, and to keep it up to date, is to follow the AnDi-J update site:

  1. Start Fiji (or download and install it first).
  2. Select Help › Update… from the menu bar.
  3. Click on the Manage update sites button.
  4. Scroll down the list and tick the checkbox for the AnDi-J update site, then click Close. If AnDi-J is not in the list, click Add unlisted site and enter the name AnDi-J and the URL https://sites.imagej.net/AnDi-J/.
  5. Click Apply changes to install the plugin.
  6. Restart Fiji.

The plugin is then available under Plugins › AnDi-J.

The update site installs AnDi-J together with the CPU build of ONNX Runtime. For GPU (CUDA) acceleration, available only on Windows and Linux, replace onnxruntime-1.26.0.jar with onnxruntime_gpu-1.26.0.jar (download link) in the Fiji.app/jars/ folder (see the requirements below).

Manual installation

  1. Go to the Releases page of the AnDi-J repository.
  2. Under the latest plugin release, download the file andi-j-X.Y.Z.jar. It already contains the two default ML models.
  3. AnDi-J uses ONNX Runtime for its machine-learning predictions, on CPU or GPU (CUDA). The GPU is much faster, and needs CUDA Toolkit 12.x and cuDNN 9.x for CUDA 12 (see Other CUDA versions otherwise). Download one of the two ONNX Runtime jars from Maven Central:
  4. Copy the andi-j jar and the ONNX Runtime jar into the Fiji.app/jars/ folder. Keep a single ONNX Runtime jar in that folder.
  5. Restart Fiji.
  6. The plugin is now available under Plugins › AnDi-J.

With the GPU jar, AnDi-J runs the models on the GPU when CUDA is available and on the CPU otherwise. Without CUDA, Fiji’s console shows an error line such as [E:onnxruntime…] Failed to load library libonnxruntime_providers_cuda.so when a model loads; it is harmless, and the models then run on the CPU.

Build from source

git clone https://github.com/gorkamunoz/andi-j.git

Download the two default ML models from the latest model release on the Releases page and place them in andi-j/src/main/resources/models/. The plugin loads them by name, so rename the files, if needed, to exactly:

  • andi-j-analysis-latest.onnx (Trajectory Analysis model)
  • andi-j-seg-latest.onnx (Trajectory Segmentation model)

Then:

cd andi-j
mvn clean package
cp target/andi-j-X.Y.Z.jar Fiji.app/jars/   # not the -sources.jar

The build downloads the GPU build of ONNX Runtime (Windows and Linux only) into your local Maven cache, so you can copy it from there:

cp ~/.m2/repository/com/microsoft/onnxruntime/onnxruntime_gpu/1.26.0/onnxruntime_gpu-1.26.0.jar Fiji.app/jars/

For the CPU build, download onnxruntime-1.26.0.jar as in Manual installation.

Requires Java 8+ and Maven. The build uses the pom-scijava parent POM.

Debug mode. AnDi-J keeps its diagnostics quiet by default. To see them, enable ImageJ’s debug mode at Edit › Options › Misc… and open Window › Console. With debug mode on, the plugin prints information about the ML models (ONNX model input/output tensor shapes and CPU/GPU usage). Genuine anomalies (e.g. a custom model returning an unexpected output type) are always reported, debug mode or not.

Other CUDA versions

If your machine has a different CUDA toolkit than the one ONNX Runtime 1.26.0 needs, use the matching onnxruntime_gpu release instead:

  1. Check your installed CUDA version: nvcc --version.
  2. Look up which onnxruntime_gpu release supports that CUDA version in the ONNX Runtime CUDA Execution Provider compatibility table.
  3. Download the matching jar from Maven Central: https://repo1.maven.org/maven2/com/microsoft/onnxruntime/onnxruntime_gpu/<version>/onnxruntime_gpu-<version>.jar
  4. Put it in Fiji.app/jars/ in place of the ONNX Runtime jar that is there.
  5. Restart Fiji.

The plugin uses whichever ONNX Runtime jar is in Fiji.app/jars/, so no rebuild is needed. AnDi-J is tested with ONNX Runtime 1.26.0.

Citing AnDi-J

If you use AnDi-J in your work, please cite:

G. Muñoz-Gil, AnDi-J: diffusion analysis of single-particle tracking data in Fiji, bioRxiv (2026). https://doi.org/10.64898/2026.10.14.756868

@article{andij_paper,
  author    = {Mu{\~n}oz-Gil, Gorka},
  title     = {{AnDi-J}: diffusion analysis of single-particle tracking data in Fiji},
  year      = {2026},
  doi       = {10.64898/2026.10.14.756868},
  publisher = {Cold Spring Harbor Laboratory},
  url       = {https://www.biorxiv.org/content/early/2026/10/14/2026.10.14.756868},
  journal   = {bioRxiv}
}

More resources

AnDi-J relies on previous work done in the context of the AnDi Challenge and related projects. To learn more about them, you can use the following references:

See also

  • TrackMate — produces the .csv trajectory files AnDi-J reads.
  • TraJClassifier — another Fiji tool for classifying diffusion trajectories.