Centerline and Length (v2) - User Manual
Dragonfly Prototype Apps · Centerline and Length (v2)...
Version 1.0 · 2026-09-22
English Manual
Contents
1. Introduction
2. Use cases
3. Installation & enabling
4. Runtime environment & first-run setup
5. Interface
6. How to use
7. Parameters
8. Output
9. FAQ & troubleshooting
10. Notes & known limitations
11. References
1. Introduction
Starting from one published Multi-ROI, extracts a centerline for every non-zero label, measures its real length, and appends that length to the same Multi-ROI as a new per-label scalar slot. The five tabs are the workflow: Input → Centerline → Smooth → Length measurement → Report.
Unlike simply summing a skeleton polyline, this plugin classifies the shape of each label before measuring it: an open curve and a branched skeleton are measured along the longest weighted geodesic path; a closed ring is measured as a ring; a shell or plate has no centerline and is refused with a stated reason.
A digital skeleton staircases, so summing it directly reports a length that is too large. Measured: +9.0% on a shallow line, +10.5% on a 3-D diagonal, +21.7% at 5:1 anisotropy. The Smooth tab removes exactly that; at the default settings the same phantoms all measure to within roughly 1%.
2. Use cases
- Per-label length of slender, curved objects: vessels, fibres, channels, cracks.
- Data whose voxel skeleton is visibly jagged, or whose Z spacing is much larger than X and Y (anisotropic).
- Workflows that need the length written back onto the Multi-ROI so labels can be coloured, filtered or exported by length.
- Hundreds of labels at once: measured 0.32 s in total for 300 labels in a 120×300×300 volume (about 1.1 ms per label). Reading the Multi-ROI out of Dragonfly dominates the run.
Not suitable for solid blobs, shells or plates. Such labels have no meaningful length, and the plugin flags them not elongated or refuses them outright rather than printing a plausible wrong number.
3. Installation & enabling
1. Run the Prototype Apps installer (Full Package / App Store package).
2. Tick Centerline and Length (v2) in the plugin list.
3. Restart Dragonfly completely — menus are built at startup, so a new entry does not appear until then.
4. Open it from Prototype Apps ▸ Measurements & Analysis ▸ Centerline and Length (v2)...
To disable the plugin, open Prototype Apps ▸ App Store, select it and click Disable. Restart Dragonfly to refresh the menu.
4. Runtime environment & first-run setup
This is an in_process plugin: there is no first-run setup at all. No virtual environment, no model download, no internet, no GPU and no administrator access.
It uses only the PyQt6, NumPy, SciPy and scikit-image bundled with Dragonfly. It is verified on Dragonfly 2025.1 (Python 3.10.13 / scikit-image 0.19.3) and 2027.1 (Python 3.14.3 / scikit-image 0.25.2), with bit-identical results.
The HTML report is a self-contained local file. Nothing is uploaded anywhere.
5. Interface
1 Input
Pick a published MultiROI and a Time step, then Read input. The Optional steps group configures the one-button run: Include smoothing and Include report are ticked by default, Publish extracted centerlines and Publish smoothed centerlines are not. Execute all steps with current settings runs the whole pipeline.
2 Centerline
Set Minimum label size (voxels) and press Extract centerlines. Publish centerlines publishes the result as a Dragonfly Graph carrying a Label ID scalar.
3 Smooth (optional)
Iterations, Smoothing factor and Resampling step (voxels) control the strength; press Smooth centerlines. This step can be skipped entirely.
4 Length measurement
Measure from selects raw or smoothed centerlines and Scalar slot name names the slot. Measure lengths fills the table and Write as new MultiROI scalar slot writes it back. Beside the lengths the table gives Shape, Discarded, Length / diameter and Warnings; hovering a row explains what each warning costs for that label.
5 Report (optional)
Choose an output path and press Generate report to write a self-contained local HTML file.
6. How to use
1. On 1 Input, choose the Multi-ROI and time step, then Read input.
2. On 2 Centerline, set the minimum label size and press Extract centerlines; read the log for labels that were skipped and why.
3. (Optional) On 3 Smooth, press Smooth centerlines to remove the staircase bias.
4. On 4 Length measurement, choose the source and press Measure lengths; check the Shape and Warnings columns.
5. Press Write as new MultiROI scalar slot to store the lengths on the Multi-ROI.
6. (Optional) On 5 Report, generate the HTML report.
All of the above can be done in one click with Execute all steps with current settings on 1 Input; the two checkboxes there decide whether Smooth and Report take part.
7. Parameters
Parameter | Default | Range | Meaning |
Time step | 0 | 0–9999 | Which time step to read. A Multi-ROI with several time steps is measured one step at a time, and the number ignored is stated in the log rather than dropped silently. |
Minimum label size (voxels) | 8 | 2–100000000 | Labels smaller than this are skipped and listed under Skipped. |
Iterations | 12 | 0–500 | Laplacian smoothing iterations. 0 means no smoothing. |
Smoothing factor | 0.35 | 0.00–1.00 | How far each point moves towards the mean of its neighbours per iteration. Larger is stronger. |
Resampling step (voxels) | 1.00 | 0.10–20.00 | The polyline is resampled to this step before smoothing. It is multiplied by the smallest voxel spacing internally, so the same setting is the same physical window on anisotropic data. |
Measure from | Smoothed | Raw / Smoothed | Which set of centerlines the length is taken from. Only Raw is available if smoothing was not run. |
Scalar slot name | Centerline Length (v2) | any text | Name of the scalar slot written back. An existing slot of the same name is updated rather than duplicated. |
Too many iterations, or too large a factor, keep shortening the path past the point where only the staircase is being removed. Compare Raw length with Measured length and read Reduction: sensible smoothing takes 1%–10% off, not tens of percent.
8. Output
- A new scalar slot on the Multi-ROI: per-label length in metres, carrying a length dimension, usable directly for colouring or filtering by length.
- The lengths table: Label, Name, Voxels, Points, Raw length, Measured length, Reduction, Shape, Discarded, Length / diameter, Warnings.
- Dragonfly Graphs (optional): raw and smoothed centerlines, each carrying a Label ID scalar, viewable in the 3-D scene.
- An HTML report (optional): one self-contained file with the full table, the run settings, the skipped labels, and a legend for exactly those warnings that actually occurred.
Shape | Meaning | How it is measured |
Open curve | a simple open curve | longest weighted geodesic path |
Branched | a tree with side branches | longest weighted geodesic path; branches are excluded and the excluded fraction is given under Discarded |
Closed loop | a closed ring | as a ring; measured as an open path it would read about half |
Network | a skeleton containing loops | longest weighted geodesic path; one length cannot describe the whole structure |
Surface | a shell or plate | refused |
Single point / No skeleton | a degenerate skeleton | refused |
9. FAQ & troubleshooting
A label was skipped. Read the log: the reasons are grouped (too few voxels, empty label, no measurable path, shell or plate). The Skipped section of the report repeats them.
The length looks too large. Smoothing was not run, or was too weak. Run the 3 Smooth tab and watch the Reduction percentage.
The length looks too small. Look for the blunt ends warning and the End radius column: at a flat end the skeleton stops short by roughly the local radius (measured: 1 voxel at r=2, 7 voxels at r=6). It is not added to the length, because the cap shape that would decide the true figure cannot be known from the mask.
A result is flagged not elongated. That label's length divided by its equivalent sphere diameter is below 1, so it is not a slender object and a centerline length is not meaningful for it.
A result is flagged symmetry fallback. That label is perfectly symmetric about a voxel boundary (for example a prism of exactly 4×4 cross-section, or a cylinder centred on a voxel boundary), and thinning deletes such a body entirely. The plugin re-measures it after a one-voxel dilation, so expect about one voxel of deviation.
The plugin is not in the menu. Dragonfly builds its menus at startup; restart it completely after installing or enabling.
10. Notes & known limitations
- Only time step 0 is measured. A Multi-ROI with more time steps reports how many were ignored, in the log and in the report.
- A branched label reports its trunk only. Side branches are excluded and the excluded fraction is in the Discarded column — that is the definition, not an error.
- A network with loops cannot be described by one length. The longest path is still given, flagged contains a loop.
- End shortening is never compensated automatically (see the FAQ).
- Smoothing is optional but strongly recommended for curved objects. An axis-aligned or exactly-45° line is unbiased to begin with, and smoothing leaves it completely unchanged.
- The plugin never modifies the labels of the source Multi-ROI; it only appends a scalar slot.
11. References
- T. C. Lee, R. L. Kashyap, C. N. Chu, Building skeleton models via 3-D medial surface/axis thinning algorithms, CVGIP: Graphical Models and Image Processing, 56(6):462–478, 1994 — the algorithm behind
skimage.morphology.skeletonize(method="lee"). - scikit-image and SciPy documentation (
scipy.ndimage,scipy.sparse.csgraph). DESIGN.mdin the plugin repository: every measurement quoted in this manual, with the phantom it was taken from.