
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:
- Start Fiji (or download and install it first).
- Select Help › Update… from the menu bar.
- Click on the button.
- Scroll down the list and tick the checkbox for the AnDi-J update site, then click . If AnDi-J is not in the list, click and enter the name
AnDi-Jand the URLhttps://sites.imagej.net/AnDi-J/. - Click to install the plugin.
- 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
- Go to the Releases page of the AnDi-J repository.
- Under the latest plugin release, download the file
andi-j-X.Y.Z.jar. It already contains the two default ML models. - 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:
- CPU:
onnxruntime-1.26.0.jar - GPU/CUDA (Windows and Linux only):
onnxruntime_gpu-1.26.0.jar
- CPU:
- Copy the
andi-jjar and the ONNX Runtime jar into theFiji.app/jars/folder. Keep a single ONNX Runtime jar in that folder. - Restart Fiji.
- 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:
- Check your installed CUDA version:
nvcc --version. - Look up which
onnxruntime_gpurelease supports that CUDA version in the ONNX Runtime CUDA Execution Provider compatibility table. - Download the matching jar from Maven Central:
https://repo1.maven.org/maven2/com/microsoft/onnxruntime/onnxruntime_gpu/<version>/onnxruntime_gpu-<version>.jar - Put it in
Fiji.app/jars/in place of the ONNX Runtime jar that is there. - 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:
andi_datasets: Python library used as backbone for many of the methods underlying AnDi-J.- Objective comparison of methods to decode anomalous diffusion, G. Muñoz-Gil et al. (2021): paper gathering the results of the 1st AnDi Challenge. Related to the analysis performed in Trajectory Analysis.
- Quantitative evaluation of methods to analyze motion changes in single-particle experiments, G. Muñoz-Gil et al. (2025): paper gathering the results of the 2nd AnDi Challenge. Related to the analysis performed in Trajectory Segmentation.
- Single-particle diffusion characterization by deep learning, N. Granik et al. (2019): convolutional networks for single-trajectory analysis. The default model of the Trajectory Analysis tab is built on their architecture.
- Inferring pointwise diffusion properties of single trajectories with deep learning, B. Requena et al. (2023): paper proposing step-wise prediction of anomalous diffusion trajectories.
- U-Net 3+ for anomalous diffusion analysis enhanced with mixture estimates (U-AnD-ME) in particle-tracking data, S. Asghar et al. (2025): paper of the winners of the 2nd AnDi Challenge. The default model of the segmentation tab is a direct update of their model.
See also
- TrackMate — produces the
.csvtrajectory files AnDi-J reads. - TraJClassifier — another Fiji tool for classifying diffusion trajectories.