脊线/线状结构检测 (Steger) 插件用户手册
Ridge / Line Detection (Steger) - User Manual
Dragonfly Prototype Apps · Ridge / Line Detection (Steger)...
版本 Version 1.0 · 2026-07-09
第一部分 中文手册
目录
1. 简介
2. 适用场景
3. 安装与启用
4. 运行环境与首次配置
5. 界面说明
6. 使用步骤
7. 参数说明
8. 输出结果
9. 常见问题与故障排除
10. 注意事项与已知限制
11. 参考资料
1. 简介
脊线/线状结构检测 (Steger) 是一款 Dragonfly 插件,用于在图像中自动提取曲线状(脊状/线状)结构——例如材料裂纹、纤维、CT 或显微图像中的血管与神经突,并逐条估计每条线的宽度和长度。它把 Dragonfly 中的一个 Channel(图像) 逐 Z 切片交给本机安装的 Fiji/ImageJ,调用其中的 Ridge Detection 命令进行检测,再把检测得到的中心线二值图堆叠回 Dragonfly,转换成一个 MultiROI,同时汇总出一张每条线的宽度/长度结果表。
底层引擎与算法。 检测由 Fiji 的 Ridge Detection 命令完成,该命令实现的是 Steger 亚像素曲线(脊线)检测算法(sub-pixel curvilinear / ridge detector)。它通过 run("Ridge Detection", ...) 宏命令被无界面(headless)调用,并使用 make_binary 选项输出线中心线的二值掩膜、使用 displayresults 选项输出每条线的结果表(宽度/长度列),再由本插件解析。
处理方式。 Ridge Detection 是一个二维算法。当输入是三维体数据时,插件会逐 Z 切片处理:每个切片单独导出为 TIFF、单独交给 Fiji 检测,再把各切片的中心线堆叠成一个 (Z, Y, X) 体数据并转换为 MultiROI。切片范围可由用户选择。
许可证要点。 Ridge Detection 采用 GPL-2.0-only 许可。为遵循该许可,本插件从不将 Ridge Detection 或 Fiji 的任何代码导入 Dragonfly 进程内,而是把用户自行安装的 Fiji/ImageJ 作为一个独立的、无界面的 Fiji JVM 子进程来驱动;Dragonfly 与该子进程之间只通过 TIFF 图像和结果 CSV 文件交换数据。这个独立子进程就是许可隔离的边界。本插件自身代码遵循 DragonflyPrototypeLabs 仓库的许可条款。
2. 适用场景
本插件适用于需要从二维图像(或按切片处理的体数据)中提取曲线状目标并测量其宽度和长度的场景。典型用途包括:
- 材料科学: 提取 CT 或显微图像中的裂纹、划痕、纤维等线状特征,统计其长度分布与宽度。
- 生命科学: 在显微或 CT 图像中检测血管、神经突(neurite)、丝状结构等曲线目标。
- 任何线状/脊状结构分析: 只要目标在图像中表现为亮线或暗线,并且你希望得到中心线掩膜(MultiROI)以及每条线的长度、宽度测量结果。
提示:输入必须是 Dragonfly 中已经存在的 Channel。本插件不负责创建或加载源图像;请先在 Dragonfly 中打开或生成待处理的图像。
3. 安装与启用
本插件随 Prototype Apps 完整安装包(Full Package) 一起分发。安装与启用步骤如下:
1. 把完整安装包 zip 解压到任意较短的目录(如 C:\PL\,不要放在很深或 OneDrive 重定向的路径下)。
2. 双击运行 `Install_FullPackage.bat`。
3. 在弹出的对话框中选择核心安装模式(Fresh 全新 / Compatible 兼容),并在 Prototype Apps 列表中勾选 Ridge / Line Detection (Steger)。
4. 点击 Install,等待控制台完成。
5. 完全退出并重启 Dragonfly(菜单只在启动时被扫描)。
默认未勾选,需要手动启用。 在完整安装包中,所有插件默认处于关闭状态(仅轻量菜单项默认开启)。因此必须在安装器列表中主动勾选本插件,它才会被部署。
重启后菜单出现的位置。 Dragonfly 重启后,本插件出现在:
Prototype Apps > Ridge / Line Detection (Steger)...
它位于 Prototype Apps 菜单的 Detection & Bridges(检测与桥接) 分组下。点击后会打开一个可停靠(dockable)的浮动面板。
以后修改勾选。 你可以随时在 Dragonfly 内更改是否启用本插件:打开 Developer ▸ Prototype Labs... ▸ Menu Item Manager,在底部的 "Prototype Apps (Full Package)" 列表中勾选或取消勾选本插件,然后重启 Dragonfly 生效。停用不会删除任何已下载的内容或配置,重新启用即时可用。也可以随时重跑安装器修改选择。
全部内容安装在当前用户目录(%LOCALAPPDATA%)下,不需要管理员权限。每次修改勾选后都需要重启一次 Dragonfly。
4. 运行环境与首次配置
本插件属于 外部应用(external_app) 类型:它不创建 Python 虚拟环境(venv)、不需要 GPU、也不需要 WSL。它唯一的外部依赖是一份用户本机安装的 Fiji/ImageJ,并且其中已启用 Ridge Detection 命令。
4.1 定位 Fiji/ImageJ
面板打开时会自动尝试查找 Fiji/ImageJ 启动器(例如 ImageJ-win64.exe、fiji-windows-x64.exe)。查找顺序为:面板中已填写的路径 → 环境变量 DF_FIJI_PATH → 常见安装位置(%LOCALAPPDATA%、Program Files、用户主目录、桌面、下载目录,以及各盘根目录下的 Fiji.app / Fiji / ImageJ 等)→ 系统 PATH。
如果没有自动找到,请点击 Locate 重新搜索,或点击 Browse... 手动选择启动器可执行文件。填好的路径会被记住(保存在插件配置中),下次打开面板时自动填入。
4.2 检查 / 安装 Ridge Detection
Ridge Detection 并非 Fiji 自带命令,它由 Fiji 的 Biomedgroup 更新站点 提供:
Biomedgroup -> https://sites.imagej.net/Biomedgroup/
点击面板中的 Check / Install Ridge Detection 按钮,插件会扫描所选 Fiji 安装目录的 plugins、jars 等文件夹,查找名称含 ridge_detection / ridgedetection / steger 的 jar 文件。若已找到,会弹窗告知路径;若未找到,会弹窗询问是否现在安装。
确认安装后,插件会以无界面方式调用 Fiji 的更新器(updater),先执行 add-update-site Biomedgroup 添加该更新站点,再执行 update 应用更新。此过程需要联网,可能耗时几分钟。
下载体积。 本插件安装时不下载任何东西;只有在你首次点击安装 Ridge Detection、或运行检测前发现缺少该命令时,才通过 Fiji 更新器联网下载 Ridge Detection 相关组件。下载体积由 Fiji 更新站点决定(通常为若干 MB 级的 jar 文件)。
4.3 失败时的替代方案
如果自动安装失败,或安装后命令仍不可用,可采用以下替代方案:
- 手动在 Fiji 中启用更新站点: 打开 Fiji,依次进入 Help > Update > Manage update sites,勾选(或添加) Biomedgroup 站点,点击 Apply/关闭后运行更新,最后重启 Fiji。
- 重启后重试: 更新站点安装后,Fiji 常常需要重启才能加载新装入的 jar。安装完成后请重启 Fiji(必要时也重启 Dragonfly),再回到面板点击 Check / Install Ridge Detection 确认已检测到。
- 通过环境变量指定 Fiji: 若面板始终找不到 Fiji,可在启动 Dragonfly 前设置环境变量
DF_FIJI_PATH指向启动器路径。
安装/更新阶段需要联网;完成后的正常检测运行不需要联网。若你的机器无法访问外网,请在联网环境中先装好 Ridge Detection,再离线使用。
5. 界面说明
面板顶部是一段简介文字。其下按分组自上而下排列以下控件。
5.1 Input Channel(输入通道)
- 通道下拉框: 列出 Dragonfly 当前会话中所有可用的 Channel(图像),每项显示标题与其 (Z, Y, X) 尺寸。
- Refresh(刷新): 重新扫描当前会话中的 Channel。在 Dragonfly 里新加载或新建了图像后点此更新列表。
5.2 Ridge Detection (Steger)(检测算法与参数)
- 操作下拉框: 选择检测操作。目前提供一项:Steger Ridge / Line Detection(Steger 脊线/线状结构检测)。
- 参数表单: 根据所选操作动态生成。对于 Steger 检测,包含
Sigma、Lower response threshold(下响应阈值)、Upper response threshold(上响应阈值)、Estimated line width(估计线宽)、Minimum line length(最小线长)、Detect dark lines(检测暗线)几项(详见第 7 章参数说明)。 - 灰色说明文字: 表单下方显示当前操作的功能说明。
5.3 Slice range (Z)(切片范围)
- from / to 两个数值框: 指定要处理的 Z 切片区间(从
from到to,含两端)。切换输入通道后,范围会自动重置为覆盖整卷(0 到 Z-1)。二维图像时该范围为单张切片。
5.4 Fiji / Ridge Detection(Fiji 与检测命令)
- Launcher(启动器): 显示 Fiji/ImageJ 启动器路径。旁边的 Locate 按钮自动搜索,Browse... 按钮手动选择(占位提示为
path to ImageJ-win64.exe / fiji-windows-x64.exe)。 - Max heap(最大堆内存): 传给 Fiji JVM 的最大内存,单位 MB(默认 4096 MB,步长 512,范围 0–262144)。处理大图像时可适当增大。
- Check / Install Ridge Detection: 检测所选 Fiji 中是否已装 Ridge Detection;若无则提示安装 Biomedgroup 更新站点(见第 4 章)。
5.5 Output(输出)
- MultiROI suffix(MultiROI 后缀): 输出 MultiROI 的命名后缀(默认
Ridges)。最终名称为<通道标题> - <后缀>。
5.6 运行与日志
- Run Ridge Detection + Create MultiROI(蓝色按钮): 启动检测并生成 MultiROI。
- 状态标签: 显示通道数量、检测状态、完成结果等简要信息。
- 日志区(只读文本框): 逐行显示运行日志,包括当前处理的切片进度、检测到的线数、结果 CSV 路径与临时作业文件夹路径等。
6. 使用步骤
下面是一次完整的端到端检测流程。
6.1 前置准备
输入要求: Dragonfly 中已存在待处理的 Channel;本机已安装 Fiji/ImageJ 且已启用 Ridge Detection 命令(否则先按第 4 章安装)。
6.2 运行检测
1. 打开面板:Prototype Apps > Ridge / Line Detection (Steger)...。
2. 在 Input Channel 下拉框中选择要处理的图像(必要时先点 Refresh)。
3. 在 Ridge Detection (Steger) 分组中确认操作为 Steger Ridge / Line Detection,并根据图像特征调整参数(至少确认 Sigma、Estimated line width 与上/下响应阈值,详见第 7 章)。
4. 在 Slice range (Z) 中设置要处理的切片区间(默认覆盖整卷)。
5. 确认 Launcher 指向正确的 Fiji 启动器;如尚未确认 Ridge Detection 是否可用,点击 Check / Install Ridge Detection。
6. 如需要,修改 MultiROI suffix;必要时增大 Max heap。
7. 点击 Run Ridge Detection + Create MultiROI。
8. 在日志区观察逐切片进度;运行结束后状态标签会显示检测到的线数,并生成 MultiROI。
得到什么: 运行成功后,Dragonfly 中出现一个名为 <通道标题> - <后缀> 的 MultiROI(中心线掩膜);同时在作业文件夹里生成汇总结果表 ridge_results.csv,并(在支持的 Dragonfly 版本中)发布一个包含总线数、平均长度、平均宽度的文本注释。
运行过程中可以随时关闭面板取消当前作业。大体数据 + 大量切片可能耗时较长,并需要足够的 JVM 堆内存。
7. 参数说明
Steger 检测参数(位于 Ridge Detection (Steger) 分组的参数表单中):
参数 | 默认值 | 说明 |
Sigma | 1.51 | 高斯平滑尺度,与待检测线宽相关。线越宽,Sigma 应越大。取值必须大于 0(非法值会回退到默认 1.51)。 |
Lower response threshold(下响应阈值) | 0.5 | 线响应的下阈值:响应低于此值的点被舍弃。用于滤除弱响应/噪声。取值不小于 0。 |
Upper response threshold(上响应阈值) | 1.36 | 线响应的上阈值:响应高于此值的点被确定为线上的点。上阈值会被自动约束为不小于下阈值。 |
Estimated line width(估计线宽) | 3.5 | 待检测线的估计宽度(像素)。影响宽度估计与检测灵敏度。取值必须大于 0(非法值回退到 3.5)。 |
Minimum line length(最小线长) | 0.0 | 检测结果中保留的最小线长度;短于此值的线被丢弃。0 表示不做长度过滤。取值不小于 0。 |
Detect dark lines(检测暗线) | 否 (False) | 勾选后检测暗线(暗背景上的亮线以外的情况,即亮背景上的暗线);默认检测亮线。对应宏中的 |
Fiji 运行参数(位于 Fiji / Ridge Detection 分组):
参数 | 默认值 | 说明 |
Launcher(启动器路径) | 自动检测 | Fiji/ImageJ 启动器可执行文件的路径,可自动定位或手动选择。 |
Max heap(最大堆内存) | 4096 MB | Fiji JVM 的最大内存,步长 512,范围 0–262144 MB。处理大图像时增大。 |
MultiROI suffix(输出后缀) | Ridges | 输出 MultiROI 名称后缀;最终名为 |
面板对参数做了合法性校正:Sigma 与 Estimated line width 必须为正,否则回退默认值;上阈值不会小于下阈值;下阈值与最小线长不小于 0。因此即使填了非法值,运行也不会崩溃,而是使用被校正后的取值。
8. 输出结果
一次成功的运行会产生以下结果:
- MultiROI(中心线掩膜): 名为
<通道标题> - <后缀>的 MultiROI,由各切片的线中心线二值图堆叠而成。它继承源 Channel 的体素间距(spacing)与原点(origin)几何信息(在可能的情况下),因此与源图像空间对齐。可在 Dragonfly 的对象列表中查看、着色并叠加显示。 - 汇总结果表 `ridge_results.csv`: 写入本次运行的临时作业文件夹中,列为
slice, line_index, length, width——逐切片、逐条线记录长度与宽度。 - 文本注释(尽力发布): 在支持的 Dragonfly 版本中,发布一个名为
<通道标题> - <后缀> (results)的文本注释对象,内容包含通道名、切片范围、总线数、平均长度、平均宽度。若当前版本不支持该注释 API,会自动跳过,但 CSV 始终保留在磁盘上。
如何查看。 MultiROI 与文本注释会出现在 Dragonfly 的对象/数据列表中,可像普通对象一样在 2D/3D 视图里显示。汇总 CSV 的完整路径会打印在面板日志区(以及临时作业文件夹路径),可用任意表格软件打开做进一步统计。
临时的输入切片 TIFF、每切片输出 TIFF 与每切片 CSV 都创建在操作系统临时目录下的作业文件夹中。若某次运行失败,错误信息中会保留这些临时路径,便于你手动检查 Fiji 的输出。
9. 常见问题与故障排除
Q1:面板提示找不到 Fiji/ImageJ 怎么办?
A:先点击 Locate 让插件重新自动搜索;若仍失败,点击 Browse... 手动指向启动器(如 ImageJ-win64.exe 或 fiji-windows-x64.exe)。也可在启动 Dragonfly 前设置环境变量 DF_FIJI_PATH 指向该启动器。若本机尚未安装 Fiji,请先安装 Fiji。
Q2:点了安装 Ridge Detection,但运行时仍提示命令不可用?
A:更新站点装好后,Fiji 通常需要重启才能加载新的 jar。请先重启 Fiji(必要时重启 Dragonfly),再回面板点 Check / Install Ridge Detection 确认已检测到。若仍不行,可在 Fiji 中手动操作:Help > Update > Manage update sites,勾选 Biomedgroup 后应用更新并重启。
Q3:安装 Ridge Detection 时联网失败或超时?
A:安装/更新阶段需要访问 https://sites.imagej.net/Biomedgroup/,请确认网络与代理设置允许访问该站点。可以在能联网的环境中先装好 Ridge Detection,再拿到离线机器上使用(正常检测本身不需要联网)。也可适当增大 Max heap 后重试。
Q4:检测结果为空,或提示没有产生中心线体素?
A:说明当前参数下未检测到任何线。请调整参数:适当降低下/上响应阈值以提高灵敏度;让 Sigma 与 Estimated line width 更贴合实际线宽;若目标是亮背景上的暗线,勾选 Detect dark lines;把 Minimum line length 设为 0 以避免过滤掉短线。
Q5:处理大体数据很慢,或 Fiji 报内存不足?
A:Ridge Detection 是二维算法,体数据按切片逐张处理,切片多时耗时较长。可缩小 Slice range (Z) 只处理关心的切片区间,并适当增大 Max heap。
Q6:结果表里长度/宽度列为空?
A:不同 Fiji 版本的 Ridge Detection 结果表列名可能不同。插件会自动匹配常见列名(如 length / line length / contour length 及 line width / mean width / width 等)。若列名差异过大可能解析不到,此时中心线 MultiROI 仍会正常生成,只是汇总的长度/宽度可能缺失;可打开作业文件夹里的每切片 CSV 手动查看原始数据。
10. 注意事项与已知限制
- 二维算法: Ridge Detection 逐 Z 切片处理,中心线在切片方向上被简单堆叠为体数据,不是真正的三维曲线检测。
- 需要已存在的 Channel: 插件不创建源图像,只处理 Dragonfly 中已有的 Channel。
- 外部进程开销: Fiji 作为独立进程运行,大体数据耗时较长且需要足够的 JVM 堆内存。
- 几何还原尽力而为: 输出 MultiROI 的几何(间距/原点)在可能的情况下从源 Channel 还原。
- 命令名/参数名随 Fiji 版本变化: 宏使用标准的
run("Ridge Detection", ...)选项名;若某个命令在你的 Fiji 版本中不可用,插件会在日志里报告 Fiji 的标准输出/错误输出。 - 许可隔离: Ridge Detection 为 GPL-2.0-only,仅作为独立 Fiji 子进程运行,绝不被导入 Dragonfly;本插件不打包、不内嵌任何 Fiji 或 Ridge Detection 代码。
- 无 venv / 无 GPU / 无 WSL: 本插件不创建 Python 虚拟环境,不使用 GPU,也不需要 WSL;仅依赖用户本机的 Fiji。
11. 参考资料
- Fiji / ImageJ 官方站点:https://fiji.sc/ 、https://imagej.net/
- Ridge Detection(Biomedgroup)更新站点:https://sites.imagej.net/Biomedgroup/
- Steger 曲线检测算法(Ridge Detection 命令的底层方法):C. Steger, "An Unbiased Detector of Curvilinear Structures"。
- Ridge Detection 采用 GPL-2.0-only 许可,通过独立的 Fiji/ImageJ 子进程调用。
Part II English Manual
Contents
1. Overview
2. Use cases
3. Install and enable
4. Runtime environment and first-time setup
5. Interface guide
6. Step-by-step usage
7. Parameter reference
8. Outputs
9. FAQ and troubleshooting
10. Notes and known limitations
11. References
1. Overview
Ridge / Line Detection (Steger) is a Dragonfly plugin that automatically extracts curvilinear (ridge/line-like) structures from images - for example material cracks, fibers, or vessels and neurites in CT and microscopy images - and estimates each line's width and length. It takes one Dragonfly Channel (image), exports it slice by slice along Z to a locally-installed Fiji/ImageJ, runs Fiji's Ridge Detection command on each slice, then stacks the detected centerline binaries back into Dragonfly as a MultiROI and aggregates a per-line width/length results table.
Underlying engine and algorithm. Detection is performed by Fiji's Ridge Detection command, which implements the Steger sub-pixel curvilinear (ridge) detector. It is invoked headlessly through the run("Ridge Detection", ...) macro command, using the make_binary option to produce a binary mask of the line centerlines and the displayresults option to produce a per-line results table (width/length columns) that this plugin then parses.
Processing model. Ridge Detection is a 2D algorithm. For a volume, the plugin processes it one Z slice at a time: each slice is exported as its own TIFF, detected in Fiji individually, and the per-slice centerlines are stacked into a (Z, Y, X) volume that becomes a MultiROI. The slice range is user-selectable.
Licensing. Ridge Detection is GPL-2.0-only. To respect that license, the plugin never imports any Ridge Detection or Fiji code into the Dragonfly process. Instead it drives the user's own installed Fiji/ImageJ as a separate, headless Fiji JVM subprocess, and Dragonfly exchanges data with it only through TIFF images and a results CSV. That separate subprocess is the license isolation boundary. The plugin's own code follows the terms of the DragonflyPrototypeLabs repository.
2. Use cases
The plugin is for users who need to extract curvilinear targets from 2D images (or a volume processed slice-by-slice) and measure their width and length. Typical uses include:
- Materials science: extract cracks, scratches, or fibers from CT/microscopy images and quantify their length distribution and width.
- Life sciences: detect vessels, neurites, or filamentous structures in microscopy or CT images.
- Any line/ridge analysis: whenever a target appears as a bright or dark line and you want both a centerline mask (MultiROI) and per-line length/width measurements.
Note: the input must be a Channel that already exists in Dragonfly. The plugin does not create or load the source image - open or generate the image in Dragonfly first.
3. Install and enable
The plugin ships with the Prototype Apps Full Package. Install and enable it as follows:
1. Unzip the Full Package to a short folder (e.g. C:\PL\; avoid deep or OneDrive-redirected paths).
2. Double-click `Install_FullPackage.bat`.
3. In the dialog, choose the core install mode (Fresh or Compatible) and tick Ridge / Line Detection (Steger) in the Prototype Apps list.
4. Click Install and wait for the console to finish.
5. Fully quit and restart Dragonfly (menus are only scanned at startup).
Off by default - you must enable it. In the Full Package all plugins are off by default (only the light menu items are on). You must actively tick this plugin in the installer for it to be deployed.
Where it appears after restart. Once Dragonfly restarts, the plugin appears at:
Prototype Apps > Ridge / Line Detection (Steger)...
It sits under the Detection & Bridges group of the Prototype Apps menu. Clicking it opens a dockable, floating panel.
Change your choice later. You can enable or disable the plugin at any time from inside Dragonfly: open Developer > Prototype Labs... > Menu Item Manager, tick or untick this plugin in the "Prototype Apps (Full Package)" list at the bottom, then restart Dragonfly. Disabling never deletes anything downloaded or configured; re-enabling is instant. You can also re-run the installer at any time.
Everything is installed per-user (under %LOCALAPPDATA%); no admin rights are needed. Every enable/disable change requires one Dragonfly restart.
4. Runtime environment and first-time setup
This plugin is an external application (external_app) type: it creates no Python virtual environment (venv), needs no GPU, and needs no WSL. Its only external dependency is a user-installed Fiji/ImageJ with the Ridge Detection command enabled.
4.1 Locating Fiji/ImageJ
When the panel opens it automatically tries to find a Fiji/ImageJ launcher (e.g. ImageJ-win64.exe, fiji-windows-x64.exe). The search order is: the path already in the panel -> the DF_FIJI_PATH environment variable -> common install locations (%LOCALAPPDATA%, Program Files, the user profile, Desktop, Downloads, and Fiji.app / Fiji / ImageJ under drive roots) -> the system PATH.
If none is found automatically, click Locate to re-search, or Browse... to pick the launcher executable yourself. The chosen path is remembered (saved in the plugin config) and pre-filled next time.
4.2 Check / install Ridge Detection
Ridge Detection is not a built-in Fiji command; it is provided by Fiji's Biomedgroup update site:
Biomedgroup -> https://sites.imagej.net/Biomedgroup/
Click Check / Install Ridge Detection. The plugin scans the selected Fiji install's plugins, jars and related folders for a jar whose name contains ridge_detection / ridgedetection / steger. If found, it reports the path; if not, it asks whether to install it now.
If you confirm, the plugin invokes the Fiji updater headlessly: first add-update-site Biomedgroup to add the update site, then update to apply updates. This requires internet and may take a few minutes.
Download size. The plugin downloads nothing at install time; it only downloads Ridge Detection components (via the Fiji updater) when you first install the command or when a run finds it missing. The size is determined by the Fiji update site (typically a few MB of jar files).
4.3 Fallbacks when installation fails
If automatic installation fails, or the command is still unavailable afterwards, use these fallbacks:
- Enable the update site manually in Fiji: open Fiji, go to Help > Update > Manage update sites, tick (or add) the Biomedgroup site, apply/close, run the update, then restart Fiji.
- Restart and retry: after an update-site install, Fiji often needs a restart to load the newly installed jar. Restart Fiji (and Dragonfly if needed), then return to the panel and click Check / Install Ridge Detection to confirm it is detected.
- Point at Fiji via env var: if the panel keeps failing to find Fiji, set the
DF_FIJI_PATHenvironment variable to the launcher path before starting Dragonfly.
Internet is needed only during install/update; normal detection runs need no internet. If your machine is offline, install Ridge Detection on a connected machine first, then use it offline.
5. Interface guide
The panel opens with a short intro paragraph at the top, followed by these groups from top to bottom.
5.1 Input Channel
- Channel dropdown: lists all available Channels (images) in the current Dragonfly session, each showing its title and (Z, Y, X) shape.
- Refresh: re-scans the current session for Channels. Click it after loading or creating a new image in Dragonfly.
5.2 Ridge Detection (Steger)
- Operation dropdown: selects the detection operation. One is provided: Steger Ridge / Line Detection.
- Parameter form: built dynamically for the chosen operation. For Steger detection it contains
Sigma,Lower response threshold,Upper response threshold,Estimated line width,Minimum line length, andDetect dark lines(see chapter 7). - Grey note text: a description of the current operation is shown beneath the form.
5.3 Slice range (Z)
- from / to spin boxes: the Z-slice range to process (inclusive). Switching the input channel auto-resets the range to cover the whole volume (0 to Z-1). For a 2D image the range is a single slice.
5.4 Fiji / Ridge Detection
- Launcher: shows the Fiji/ImageJ launcher path. The Locate button auto-searches; Browse... selects manually (placeholder text
path to ImageJ-win64.exe / fiji-windows-x64.exe). - Max heap: the max memory given to the Fiji JVM, in MB (default 4096 MB, step 512, range 0-262144). Increase it for large images.
- Check / Install Ridge Detection: detects whether Ridge Detection is present in the selected Fiji; if not, offers to install the Biomedgroup update site (see chapter 4).
5.5 Output
- MultiROI suffix: the suffix for the output MultiROI name (default
Ridges). The final name is<Channel title> - <suffix>.
5.6 Run and log
- Run Ridge Detection + Create MultiROI (blue button): starts detection and creates the MultiROI.
- Status label: shows brief information such as the channel count, detection status, and the completed result.
- Log area (read-only text box): shows the run log line by line, including the current slice progress, the number of lines detected, and the results-CSV and temporary job-folder paths.
6. Step-by-step usage
Below is one complete end-to-end detection run.
6.1 Prerequisites
Input requirements: a Channel already exists in Dragonfly, and Fiji/ImageJ is installed locally with the Ridge Detection command enabled (otherwise install it first per chapter 4).
6.2 Running detection
1. Open the panel: Prototype Apps > Ridge / Line Detection (Steger)....
2. In Input Channel, select the image to process (click Refresh first if needed).
3. In the Ridge Detection (Steger) group, confirm the operation is Steger Ridge / Line Detection and adjust the parameters to your image (at least Sigma, Estimated line width, and the lower/upper response thresholds - see chapter 7).
4. Set the Slice range (Z) to the slices you want (defaults to the whole volume).
5. Confirm Launcher points to the correct Fiji launcher; if you have not yet confirmed Ridge Detection is available, click Check / Install Ridge Detection.
6. Adjust MultiROI suffix if desired; increase Max heap if needed.
7. Click Run Ridge Detection + Create MultiROI.
8. Watch the per-slice progress in the log; when it finishes the status label shows the number of lines detected and a MultiROI is created.
What you get: on success, Dragonfly gains a MultiROI named <Channel title> - <suffix> (the centerline mask); a summary table ridge_results.csv is written to the job folder; and (on supported Dragonfly builds) a text annotation with the total line count, mean length, and mean width is published.
You can cancel the current job at any time by closing the panel. A large volume with many slices can take a while and needs enough JVM heap.
7. Parameter reference
Steger detection parameters (in the Ridge Detection (Steger) parameter form):
Parameter | Default | Description |
Sigma | 1.51 | Gaussian smoothing scale, related to the width of the lines to detect. Wider lines want a larger sigma. Must be > 0 (an invalid value falls back to 1.51). |
Lower response threshold | 0.5 | Lower threshold on the line response: points below it are discarded, to reject weak responses/noise. Must be >= 0. |
Upper response threshold | 1.36 | Upper threshold on the line response: points above it are accepted as line points. The upper threshold is automatically clamped to be >= the lower threshold. |
Estimated line width | 3.5 | Estimated width (in pixels) of the lines to detect. Affects width estimation and sensitivity. Must be > 0 (an invalid value falls back to 3.5). |
Minimum line length | 0.0 | Minimum length of lines kept in the result; shorter lines are dropped. 0 means no length filtering. Must be >= 0. |
Detect dark lines | False (off) | When ticked, detects dark lines (dark lines on a bright background); by default bright lines are detected. Maps to the macro's |
Fiji run parameters (in the Fiji / Ridge Detection group):
Parameter | Default | Description |
Launcher | auto-detected | Path to the Fiji/ImageJ launcher executable, auto-located or picked manually. |
Max heap | 4096 MB | Max memory for the Fiji JVM; step 512, range 0-262144 MB. Increase for large images. |
MultiROI suffix | Ridges | Suffix for the output MultiROI name; the final name is |
The panel sanitises parameters: Sigma and Estimated line width must be positive or they fall back to defaults; the upper threshold is never below the lower; the lower threshold and minimum line length are never below 0. So even invalid entries never crash the run - the corrected values are used instead.
8. Outputs
A successful run produces the following:
- MultiROI (centerline mask): a MultiROI named
<Channel title> - <suffix>, built by stacking each slice's binary line centerlines. It inherits the source Channel's voxel spacing and origin geometry where possible, so it aligns with the source image. View, colour, and overlay it like any object in Dragonfly's object list. - Summary table `ridge_results.csv`: written to the run's temporary job folder, with columns
slice, line_index, length, width- one row per line per slice. - Text annotation (best-effort): on supported Dragonfly builds, a text annotation named
<Channel title> - <suffix> (results)is published, containing the channel name, slice range, total line count, mean length, and mean width. If the current build does not expose that annotation API it is skipped, but the CSV is always kept on disk.
How to view. The MultiROI and text annotation appear in Dragonfly's object/data list and can be shown in 2D/3D views like any object. The full path of the summary CSV (and the temporary job folder) is printed in the panel log, and can be opened in any spreadsheet tool for further statistics.
The temporary input-slice TIFFs, per-slice output TIFFs, and per-slice CSVs are created in a job folder under the OS temp directory. If a run fails, the error message keeps these temp paths so you can inspect Fiji's output manually.
9. FAQ and troubleshooting
Q1: The panel says it cannot find Fiji/ImageJ. What do I do?
A: First click Locate to re-run the auto-search; if it still fails, click Browse... and point at the launcher (e.g. ImageJ-win64.exe or fiji-windows-x64.exe). You can also set the DF_FIJI_PATH environment variable to the launcher before starting Dragonfly. If Fiji is not installed at all, install it first.
Q2: I installed Ridge Detection but a run still says the command is unavailable.
A: After the update site is installed, Fiji usually needs a restart to load the new jar. Restart Fiji (and Dragonfly if needed), then click Check / Install Ridge Detection to confirm detection. If it still fails, enable it manually in Fiji via Help > Update > Manage update sites, tick Biomedgroup, apply the update, and restart.
Q3: Installing Ridge Detection fails or times out on the network.
A: The install/update step needs access to https://sites.imagej.net/Biomedgroup/; make sure your network and proxy settings allow it. You can install Ridge Detection on a connected machine and then use it offline (normal detection needs no internet). Increasing Max heap and retrying can also help.
Q4: Detection returns nothing, or reports that no centerline voxels were produced.
A: This means no lines were detected with the current parameters. Adjust them: lower the lower/upper response thresholds to raise sensitivity; make Sigma and Estimated line width match the real line width; tick Detect dark lines if the target is dark lines on a bright background; set Minimum line length to 0 so short lines are not filtered out.
Q5: Processing a large volume is slow, or Fiji runs out of memory.
A: Ridge Detection is a 2D algorithm, so a volume is processed slice by slice and many slices take longer. Narrow the Slice range (Z) to just the slices you care about, and increase Max heap.
Q6: The length/width columns in the results table are empty.
A: The Ridge Detection results-table column names vary between Fiji builds. The plugin auto-matches common names (e.g. length / line length / contour length, and line width / mean width / width). If the names differ too much, parsing may miss them - the centerline MultiROI is still created, only the aggregated length/width may be missing. Open the per-slice CSVs in the job folder to see the raw data.
10. Notes and known limitations
- 2D algorithm: Ridge Detection runs per Z slice; centerlines are simply stacked along Z into a volume, not a true 3D curve detection.
- Requires an existing Channel: the plugin does not create the source image; it only processes a Channel already in Dragonfly.
- External-process overhead: Fiji runs as a separate process, so large volumes take time and need enough JVM heap.
- Best-effort geometry: the output MultiROI geometry (spacing/origin) is restored from the source Channel where possible.
- Command/parameter names vary by Fiji build: the macro uses the standard
run("Ridge Detection", ...)option names; if a command is unavailable in your Fiji, the plugin reports Fiji's stdout/stderr in the log. - License isolation: Ridge Detection is GPL-2.0-only and runs only as a separate Fiji subprocess, never imported into Dragonfly; the plugin bundles no Fiji or Ridge Detection code.
- No venv / no GPU / no WSL: the plugin creates no Python virtual environment, uses no GPU, and needs no WSL; it depends only on the user's local Fiji.
11. References
- Fiji / ImageJ official sites: https://fiji.sc/ and https://imagej.net/
- Ridge Detection (Biomedgroup) update site: https://sites.imagej.net/Biomedgroup/
- Steger curvilinear detection (the method behind the Ridge Detection command): C. Steger, "An Unbiased Detector of Curvilinear Structures".
- Ridge Detection is licensed GPL-2.0-only and is invoked through a separate Fiji/ImageJ subprocess.