Train Custom ModelChinese & English

MONAI Label Segmentation

MONAI Label Segmentation is a native, dockable panel embedded in Dragonfly. It connects to a (local or remote) MONAI Label server to perform interactive AI segmentation of CT / MRI volumes inside Dragonfly: click a few p

Updated 2026-07-07User manual

MONAI Label 交互式分割 插件用户手册

MONAI Label Segmentation - User Manual

Dragonfly Prototype Apps · MONAI Label Segmentation...

版本 Version 1.0 · 2026-07-04


第一部分 中文手册

目录

1. 简介

2. 适用场景

3. 安装与启用

4. 运行环境与首次配置

5. 界面说明

6. 使用步骤

7. 参数说明

8. 输出结果

9. 常见问题与故障排除

10. 注意事项与已知限制

11. 参考资料

1. 简介

MONAI Label 交互式分割(MONAI Label Segmentation)是一个原生嵌入 Dragonfly 的可停靠面板。它连接一台(本机或远程的)MONAI Label 服务器,在 Dragonfly 内部对 CT / MRI 等体数据做交互式 AI 分割:只需在切片查看器上点几个点(左键=前景、右键=背景),模型即可补全整卷分割;不点任何点则退化为纯自动分割。得到满意结果后可一键导入为 MultiROI,回到 Dragonfly 做后续测量与分析,或作为深度学习训练标注。

底层引擎为开源项目 MONAI Label(Project MONAI),配合其官方 radiology 示例应用,提供 DeepEdit、DeepGrow 与常规分割模型。DeepEdit / DeepGrow 属于交互式分割范式:先给出少量提示点,模型据此推断并完善整卷标签。推理计算在服务器端进行(基于 PyTorch),面板本身只负责导出体数据、发送点位、接收并显示结果掩膜。

面板运行在 Dragonfly 自带的 Python 中,无需为插件单独搭建虚拟环境:体数据的 NIfTI 读写由内置的纯 numpy 编解码器完成,不依赖 SimpleITK 或 nibabel。面板与服务器之间使用共享的 monailabel_client.py 通过 HTTP(REST)通信。

许可证要点:MONAI Label 及 MONAI 生态遵循 Apache-2.0 许可证(宽松许可)。本插件仅作为客户端调用 MONAI Label 服务器,不改动其许可条款;请遵循 MONAI Label 项目自身的许可与使用说明。

2. 适用场景

本插件面向医学、临床前研究与生命科学领域的 CT / MRI 体数据分割任务,典型场景包括:

  • 器官 / 病灶快速分割:对单个体数据,用少量前景 / 背景点击即可得到整卷的器官或病灶掩膜,远快于逐层手工描画。
  • 纯自动分割:对已训练好的自动分割 / DeepEdit 模型,不点任何点直接运行,得到一键式全自动结果。
  • 生成训练标注:把 MONAI Label 的分割结果导入为 Dragonfly 的 MultiROI,作为后续深度学习(如 Dragonfly 内建训练)或统计分析的标注来源。
  • 主动学习(批量标注排序):面对大量未标注扫描时,由服务器按不确定性(如 epistemic 熵)对未标注卷排序,提示你最先标注哪一卷,让每份人工标注对模型的提升最大化。

面板内的点击提示点在嵌入的二维切片查看器中采集,为整数体素坐标 [i, j, k]。目前不支持直接在 Dragonfly 自己的 2D / 3D 视图中拾取点,这一能力属于未来增强。

3. 安装与启用

本插件随 Prototype Labs & Apps 完整安装包(Full Package) 一同分发。安装步骤:

1. 将安装包解压到任意较短的目录(如 C:\PL\;避免过深路径或 OneDrive 重定向的桌面)。

2. 双击 Install_FullPackage.bat。

3. 在对话框中选择核心安装模式(Fresh 全新 / Compatible 兼容),并在应用列表中勾选 MONAI Label Segmentation(所有插件默认未勾选,需要手动勾上)。

4. 点击 Install,等待控制台完成。

5. 完全退出并重启 Dragonfly(菜单只在启动时扫描)。

重启后,插件出现在 Dragonfly 顶部菜单:Prototype Apps ▸ MONAI Label Segmentation...(位于 "Interactive Segmentation" 交互式分割分组)。点击即可打开可停靠的分割面板。

本插件依赖 Prototype Labs 嵌入式包——它提供共享的 monailabel_client.py(REST 协议实现)。面板会从相邻的 GenericMenuItems\Prototype_Labs\ 目录(或环境变量 DF_PROTOTYPE_LABS_DIR)自动解析该文件。使用完整安装包时,Prototype Labs 核心与本插件会一并部署,通常无需额外操作。

以后修改勾选:在 Dragonfly 内打开 Developer ▸ Prototype Labs... ▸ Menu Item Manager,在底部 "Prototype Apps (Full Package)" 列表中勾选 = 部署、取消 = 移除该菜单项,重启 Dragonfly 生效。停用从不删除任何已下载 / 已搭建的环境,重新启用立即可用。

卸载:双击安装包中的 Uninstall_FullPackage.bat 可移除全部 Full Package 菜单项与插件。它会保留 Prototype Labs 核心及各插件环境(如 MONAI Label 服务器 venv),并在结束时列出这些路径,便于你按需手动删除以腾出磁盘空间。

4. 运行环境与首次配置

插件本体无需环境搭建:它运行在 Dragonfly 自带的 Python 中,使用其内置 numpy,NIfTI 读写为内置纯 numpy 编解码器,不需要安装任何第三方库,也不需要点击 "Setup Environment"。

真正需要准备的是一台可访问的 MONAI Label 服务器。有两种方式:

方式一:在 Server Management 里启动本机服务器(推荐)

1. 打开 Prototype Apps ▸ Server Management...。

2. 在服务器列表中找到 MONAI Label Server,点击 Start(启动)。

3. 首次启动会自动完成:创建专用 venv → 先安装匹配的 torch(自动选择 CUDA / CPU;若显卡驱动过旧会回退到 CPU) → pip install -U monailabel → 下载 radiology 示例应用(含 DeepEdit / DeepGrow / 分割) → 写入就绪标记 → 以后台方式启动 monailabel start_server。

4. 服务器默认监听 http://127.0.0.1:8384。就绪后即可在面板中连接。

下载体积与联网:首次安装 MONAI Label 服务器需要联网下载 torch(CUDA 版本可达数 GB)、monailabel 及 radiology 应用,可能耗时较长。之后再次启动不再重复下载。是否使用 GPU 取决于本机是否有可用的 NVIDIA 显卡:有则自动使用 CUDA 加速,无则自动使用 CPU(推理会明显更慢)。

方式二:指向已运行 / 远程的服务器

若你已有一台运行中的 MONAI Label 服务器(本机其他进程或网络中的另一台机器),可直接在面板顶部 Server URL 字段填入其地址,然后点击 Connect / Refresh 连接,无需在本机安装。

安装位置:MONAI Label 服务器默认安装在 %LOCALAPPDATA%\DragonflyPrototypeLabs\MONAILabel(可通过环境变量 MONAILABEL_DIR 修改)。服务器的默认端点、示例应用与模型可分别通过 MONAILABEL_URL / MONAILABEL_HOST / MONAILABEL_PORT、MONAILABEL_APP(默认 radiology)、MONAILABEL_MODELS(默认 deepedit)等环境变量覆盖。

失败时的替代方案:若本机自动安装失败(如网络受限、无合适的系统 Python),可在具备条件的另一台机器上运行 MONAI Label 服务器,再用方式二把面板 URL 指向它;或按 MONAI Label 官方文档手动部署服务器后连接。主动学习 / 提交修正需要把扫描放入服务器的 studies 数据仓才能生效。

5. 界面说明

面板为单一分页布局,从上到下依次为:连接区、模型 / 通道选择区、切片查看器、切片与掩膜控制条、操作按钮区、状态日志。各控件说明如下。

5.1 连接区

  • Server URL(服务器地址,文本框):MONAI Label 服务器地址,默认 http://127.0.0.1:8384(取自环境变量或默认端口 8384)。
  • Connect / Refresh(连接 / 刷新,按钮):连接服务器并读取 /info,用返回的模型、策略、标签列表填充下拉框。

5.2 模型与通道选择区

  • Model(模型,下拉框):列出服务器上可用的模型,并附带类型与维度标注,例如 deepedit [deepedit/3D]。切换模型会自动更新其可用标签。
  • Label(标签,下拉框):当前模型的标签名(自动剔除 background)。点击提示点作用于此处选中的标签。
  • Channel(通道,下拉框):当前 Dragonfly 会话中的图像 Channel 列表(标题)。
  • ↻(刷新通道,按钮):重新枚举 Dragonfly 中的 Channel 列表。
  • Load Channel(加载通道,按钮):把选中的 Channel 读入面板内存(numpy 体数据),并记录其体素间距与原点,随后在切片查看器中显示。

5.3 切片查看器与控制条

  • 切片查看器(灰度图像区):显示当前切片。左键单击 = 前景点、右键单击 = 背景点;点会以整数体素坐标 [i, j, k] 记录,并在图上以十字标记(前景绿色、背景红色)。仅左键 / 右键生效,中键等其他按钮被忽略。
  • Slice(切片,滑块):在层面之间滚动;加载后默认停在体数据的中间切片。
  • 切片计数标签:显示当前切片索引 / 总层数(格式 当前/最大)。
  • Show mask(显示掩膜,复选框,默认勾选):在切片上以红色半透明叠加显示推理结果掩膜。

5.4 操作按钮区

  • Run (auto-seg / clicks)(运行,按钮):把体数据导出为 NIfTI,连同点击参数发送到服务器 /infer/{model} 进行推理;点为空即纯自动分割。
  • Clear points(清除点,按钮):清空当前所有前景 / 背景点。
  • Import as MultiROI(导入为 MultiROI,按钮):把推理掩膜作为 MultiROI 发布到源 Channel 的网格上。推理成功前该按钮不可用。
  • Strategy(策略,下拉框):主动学习的采样策略(取自服务器 /info 返回的 strategies,如 epistemic)。
  • Next best volume(下一卷,按钮):询问服务器按所选策略应最先标注哪一卷未标注数据。

5.5 状态日志

  • 面板底部的只读文本框,实时显示连接状态、加载信息、点击记录、推理进度与结果统计,以及错误信息(以 ERROR: 前缀标记)。

6. 使用步骤

6.1 交互式分割(DeepEdit / DeepGrow)

输入要求:一台可访问的 MONAI Label 服务器;Dragonfly 中已打开一个待分割的图像 Channel(CT / MRI 体数据)。

1. 确认 Server URL 正确,点击 Connect / Refresh;日志显示已连接的应用名、版本、模型数与策略数。

2. 在 Model 下拉框选择一个交互式模型(如 deepedit / deepgrow),并在 Label 中选择目标标签。

3. 在 Channel 下拉框选择图像通道(必要时先点 ↻ 刷新),点击 Load Channel 加载。

4. 拖动 Slice 滑块滚动到目标层面,在切片查看器上左键点前景、右键点背景;点会以十字标记显示,日志给出累计点数。

5. 点击 Run (auto-seg / clicks);模型据点位补全整卷分割。

6. 推理完成后,结果掩膜以红色叠加显示(可用 Show mask 开关);检查各层面是否满意。若不满意,可 Clear points 后补点重跑,或增删点后再次 Run。

7. 满意后点击 Import as MultiROI,把结果发布为 Dragonfly 的 MultiROI。

6.2 纯自动分割

输入要求:同上,但选用支持自动分割的模型(segmentation / DeepEdit)。

1. 连接服务器并选择自动分割 / DeepEdit 模型。

2. 选择并 Load Channel 加载图像。

3. 不点任何点,直接点击 Run;此时发送空点位,服务器执行全自动分割。

4. 检查叠加结果,满意后 Import as MultiROI。

6.3 主动学习:下一卷该标哪个

输入要求:服务器的 studies 数据仓中已放入待处理的未标注扫描。

1. 连接服务器后,在 Strategy 下拉框选择一种采样策略(如 epistemic)。

2. 点击 Next best volume;服务器返回按不确定性排序后最该标注的卷。

3. 日志给出该卷的 id 及不确定性 / 权重等信息;据此在服务器的数据仓中优先标注该卷。

7. 参数说明

控件 / 参数

默认值

说明

Server URL(服务器地址)

http://127.0.0.1:8384

MONAI Label 服务器地址;可指向本机或远程服务器。

Model(模型)

服务器返回的第一个模型

选择用于推理的模型;下拉项附带类型 / 维度标注。

Label(标签)

当前模型的第一个非 background 标签

点击提示点作用于此标签;供 DeepEdit / DeepGrow 使用。

Channel(通道)

会话中的第一个 Channel

作为分割输入的图像通道;点 ↻ 刷新列表。

Slice(切片)

加载后为体数据中间层

在层面间滚动;取值范围 0 到 层数-1。

Show mask(显示掩膜)

勾选(开)

是否在切片上红色叠加显示结果掩膜。

Strategy(策略)

服务器返回的第一个策略

主动学习采样策略(如 epistemic)。

前景点(左键)

无(空 = 自动分割)

整数体素坐标 [i, j, k];正向提示。

背景点(右键)

无

整数体素坐标 [i, j, k];负向提示(排除区域)。

8. 输出结果

面板的主要产出是一个 MultiROI(多标签感兴趣区域),通过 Import as MultiROI 发布到源 Channel 的网格上:

  • MultiROI 与源 Channel 逐体素对齐:因为导出与返回的标签共用同一 NIfTI 仿射(基于源 Channel 的间距与原点),掩膜在 Dragonfly 中与原图精确重合。
  • 发布优先经由 CellposeHelper 在通道网格上直接构建 MultiROI;若不可用,则回退为对齐的标签图 Channel 再转换为 MultiROI;若仍不可用,最后以标签图 Channel 形式发布(日志会说明实际走的路径)。
  • 结果 MultiROI 命名形如 MONAI Label: <模型名>。

如何查看:导入后,MultiROI 会出现在 Dragonfly 的对象列表中,可在 2D / 3D 视图中显示、着色,并进入后续测量与分析流程,或作为深度学习训练的标注。

关于几何朝向:体素级对齐可靠;但模型所要求的解剖学朝向(RAS / LPS)为尽力而为,建议先在一个已知体数据上验证结果朝向是否正确。

9. 常见问题与故障排除

问:点击 Connect / Refresh 后提示服务器不可达怎么办?

答:确认 MONAI Label 服务器已启动——在 Prototype Apps ▸ Server Management 里启动 MONAI Label Server;或核对 Server URL 是否正确(默认 http://127.0.0.1:8384)。首次启动服务器需联网下载,请耐心等待其就绪后再连接。

问:日志提示找不到 monailabel_client.py?

答:本插件依赖 Prototype Labs 嵌入式包提供该文件。请确认已通过完整安装包一并安装 Prototype Labs 核心;或设置环境变量 DF_PROTOTYPE_LABS_DIR 指向包含 monailabel_client.py 的目录。

问:模型 / 标签 / 策略下拉框是空的?

答:这些列表来自服务器 /info,只有连接成功后才会填充。先确保连接成功;若仍为空,说明该服务器上未配置相应模型或策略,请检查服务器安装的示例应用(默认 radiology)与模型配置。

问:通道下拉框里没有我的图像?

答:点击 ↻ 刷新通道列表;并确认该图像在当前 Dragonfly 会话中已作为 Channel 打开。加载后若日志报无法读取为 numpy 数组,请确认该 Channel 是常规标量图像。

问:推理返回 "no mask" 或结果为空?

答:检查所选模型是否与操作方式匹配(交互式模型需要点,或允许空点自动分割);日志会显示服务器返回的 result 内容以便定位。对交互式模型,可尝试在目标区域内多补几个前景点、在明显不属于目标处补背景点后重跑。

问:Next best volume 提示没有可标注的卷?

答:主动学习作用于服务器的 studies 数据仓。请先把待标注的扫描上传到服务器的数据仓(或使用其演示数据集)以填充队列,再重试。

10. 注意事项与已知限制

  • 提示点在嵌入的二维切片查看器中采集,为整数体素坐标;暂不支持直接在 Dragonfly 的 2D / 3D 视图中拾取点(未来增强)。
  • 解剖学朝向(RAS / LPS)为尽力而为,首次使用建议在已知体数据上验证。
  • 推理速度取决于服务器算力:有 NVIDIA GPU 时使用 CUDA 加速,纯 CPU 会明显更慢。
  • 主动学习与提交修正需要扫描位于服务器的 studies 数据仓中;仅在面板内加载 Channel 不会自动上传到数据仓。
  • 菜单只在 Dragonfly 启动时扫描,启用 / 停用插件后需重启一次生效。

11. 参考资料

  • MONAI Label 项目主页:https://github.com/Project-MONAI/MONAILabel
  • Project MONAI(Medical Open Network for AI):https://monai.io
  • 本插件面板内的操作提示:"Left-click = foreground · Right-click = background · No clicks = pure auto-segmentation"。
  • 服务器管理与安装 / 启用:参见 Prototype Apps ▸ Server Management,以及完整安装包 README。


Part II English Manual

Contents

1. Overview

2. Use Cases

3. Installation & Enabling

4. Runtime Environment & First-Run Setup

5. User Interface

6. Step-by-Step Usage

7. Parameter Reference

8. Output

9. FAQ & Troubleshooting

10. Notes & Known Limitations

11. References

1. Overview

MONAI Label Segmentation is a native, dockable panel embedded in Dragonfly. It connects to a (local or remote) MONAI Label server to perform interactive AI segmentation of CT / MRI volumes inside Dragonfly: click a few points on the slice viewer (left = foreground, right = background) and the model completes the whole-volume segmentation; with no clicks it falls back to pure auto-segmentation. Once you are satisfied, one click imports the result as a MultiROI back into Dragonfly for downstream measurement and analysis, or as deep-learning training labels.

The underlying engine is the open-source MONAI Label project (Project MONAI) together with its official radiology sample app, which provides DeepEdit, DeepGrow, and standard segmentation models. DeepEdit / DeepGrow are interactive paradigms: a few hint points let the model infer and refine the whole-volume label. Inference runs on the server (PyTorch based); the panel only exports the volume, sends the click points, and receives and displays the result mask.

The panel runs in Dragonfly's own Python and needs no plugin-specific virtual environment: NIfTI volume I/O uses a built-in pure-numpy codec (no SimpleITK / nibabel required). The panel talks to the server over HTTP (REST) via the shared monailabel_client.py.

License note: MONAI Label and the MONAI ecosystem are Apache-2.0 licensed (permissive). This plugin is only a client that calls a MONAI Label server; it does not alter those license terms. Please follow the MONAI Label project's own license and usage guidance.

2. Use Cases

The plugin targets medical, preclinical, and life-science CT / MRI segmentation. Typical scenarios:

  • Fast organ / lesion segmentation: for a single volume, a few foreground / background clicks yield a whole-volume mask, far faster than slice-by-slice manual drawing.
  • Pure auto-segmentation: for trained auto-seg / DeepEdit models, run with no clicks for a one-click fully automatic result.
  • Generating training labels: import the MONAI Label result as a Dragonfly MultiROI to serve as labels for downstream deep learning (e.g. Dragonfly's built-in training) or statistical analysis.
  • Active learning (batch annotation ranking): with many unlabeled scans, the server ranks unlabeled volumes by uncertainty (e.g. epistemic entropy) and tells you which to annotate first, so each manual label maximizes model improvement.

Click hint points are captured in the embedded 2D slice viewer as integer voxel coordinates [i, j, k]. Picking points directly in Dragonfly's own 2D / 3D viewports is not yet supported (a future enhancement).

3. Installation & Enabling

This plugin ships with the Prototype Labs & Apps Full Package. To install:

1. Unzip the package to a short folder (e.g. C:\PL\; avoid very deep paths or a OneDrive-redirected Desktop).

2. Double-click Install_FullPackage.bat.

3. In the dialog, choose the core install mode (Fresh or Compatible) and tick MONAI Label Segmentation in the app list (all plugins are OFF by default and must be ticked).

4. Click Install and wait for the console to finish.

5. Quit Dragonfly completely and restart it (menus are scanned only at startup).

After restart, the plugin appears under Prototype Apps ▸ MONAI Label Segmentation... (in the "Interactive Segmentation" section). Click it to open the dockable segmentation panel.

The plugin depends on the Prototype Labs embedded package, which provides the shared monailabel_client.py (the REST protocol). The panel resolves it from the sibling GenericMenuItems\Prototype_Labs\ folder (or the DF_PROTOTYPE_LABS_DIR environment variable). With the Full Package, the Prototype Labs core and this plugin deploy together, so this usually needs no extra action.

Changing your choices later: inside Dragonfly, open Developer ▸ Prototype Labs... ▸ Menu Item Manager; in the "Prototype Apps (Full Package)" list at the bottom, tick = deploy, untick = remove the menu entry. Restart Dragonfly to apply. Disabling never deletes a downloaded / built environment; re-enabling is instant.

Uninstall: double-click Uninstall_FullPackage.bat from the package to remove all Full-Package menu items and plugins. It keeps the Prototype Labs core and each plugin's environment (e.g. the MONAI Label server venv) and prints those paths at the end so you can delete them manually to reclaim disk space.

4. Runtime Environment & First-Run Setup

The plugin itself needs no environment setup: it runs in Dragonfly's own Python, uses its bundled numpy, and does NIfTI I/O via a built-in pure-numpy codec. There is nothing to pip-install and no "Setup Environment" button to click.

What you do need is a reachable MONAI Label server. Two ways:

1. Open Prototype Apps ▸ Server Management....

2. Find MONAI Label Server in the server list and click Start.

3. First start automatically: creates a dedicated venv → installs a matching torch first (auto CUDA / CPU; falls back to CPU if the GPU driver is too old) → pip install -U monailabel → downloads the radiology sample app (DeepEdit / DeepGrow / segmentation) → writes a ready sentinel → launches monailabel start_server in the background.

4. The server listens by default at http://127.0.0.1:8384. Once ready, connect from the panel.

Download size & internet: the first-time server install requires internet to download torch (the CUDA build can be several GB), monailabel, and the radiology app, and may take a while. Subsequent starts do not re-download. GPU use depends on your machine: an available NVIDIA GPU is used automatically via CUDA; otherwise inference runs on CPU (noticeably slower).

Option 2: point at a running / remote server

If you already have a running MONAI Label server (another local process or a machine on your network), just enter its address in the panel's Server URL field at the top and click Connect / Refresh — no local install needed.

Install location: the MONAI Label server installs by default under %LOCALAPPDATA%\DragonflyPrototypeLabs\MONAILabel (override with MONAILABEL_DIR). The default endpoint, sample app, and models can be overridden via MONAILABEL_URL / MONAILABEL_HOST / MONAILABEL_PORT, MONAILABEL_APP (default radiology), and MONAILABEL_MODELS (default deepedit).

If setup fails: if the local auto-install fails (restricted network, no suitable system Python), run the MONAI Label server on another capable machine and use Option 2 to point the panel at it; or deploy the server manually per MONAI Label's official docs and connect. Active learning / submitting corrections require your scans to be present in the server's studies datastore.

5. User Interface

The panel is a single page laid out top-to-bottom: connection row, model / channel row, slice viewer, slice & mask controls, action buttons, and a status log. The controls are described below.

5.1 Connection row

  • Server URL (text field): the MONAI Label server address, default http://127.0.0.1:8384 (from environment variables or the default port 8384).
  • Connect / Refresh (button): connects to the server and reads /info, populating the model, strategy, and label dropdowns from the response.

5.2 Model & channel row

  • Model (dropdown): lists the server's available models with a type / dimension tag, e.g. deepedit [deepedit/3D]. Switching the model updates its available labels.
  • Label (dropdown): the current model's label names (background is filtered out). Click hint points apply to the label selected here.
  • Channel (dropdown): the image Channels (titles) currently open in the Dragonfly session.
  • ↻ (refresh channels, button): re-enumerates the Channel list in Dragonfly.
  • Load Channel (button): reads the selected Channel into the panel's memory (numpy volume), records its voxel spacing and origin, and shows it in the slice viewer.

5.3 Slice viewer & controls

  • Slice viewer (grayscale image): shows the current slice. Left-click = foreground point, right-click = background point; points are recorded as integer voxel coordinates [i, j, k] and drawn as crosshairs (green = foreground, red = background). Only left / right clicks count; middle and other buttons are ignored.
  • Slice (slider): scrolls through slices; after loading it defaults to the middle slice of the volume.
  • Slice counter label: shows current index / max (format current/max).
  • Show mask (checkbox, on by default): overlays the inference result mask in semi-transparent red on the slice.

5.4 Action buttons

  • Run (auto-seg / clicks) (button): exports the volume to NIfTI and POSTs it with the click params to the server's /infer/{model}; empty clicks = pure auto-segmentation.
  • Clear points (button): removes all current foreground / background points.
  • Import as MultiROI (button): publishes the inference mask as a MultiROI on the source Channel's grid. Disabled until an inference has succeeded.
  • Strategy (dropdown): the active-learning sampling strategy (from the server's /info strategies, e.g. epistemic).
  • Next best volume (button): asks the server which unlabeled volume to annotate next under the chosen strategy.

5.5 Status log

  • A read-only text box at the bottom that shows connection status, load info, recorded clicks, inference progress and result statistics, plus any errors (prefixed with ERROR:).

6. Step-by-Step Usage

6.1 Interactive segmentation (DeepEdit / DeepGrow)

Inputs: a reachable MONAI Label server; an image Channel (CT / MRI volume) already open in Dragonfly.

1. Confirm the Server URL and click Connect / Refresh; the log reports the connected app name, version, model count, and strategy count.

2. Pick an interactive model in Model (e.g. deepedit / deepgrow) and a target label in Label.

3. Pick the image in Channel (click ↻ to refresh if needed) and click Load Channel.

4. Drag the Slice slider to the target slice and left-click foreground, right-click background on the viewer; points appear as crosshairs and the log reports running totals.

5. Click Run (auto-seg / clicks); the model completes the whole-volume segmentation from your points.

6. When inference finishes, the mask overlays in red (toggle with Show mask); review the slices. If unsatisfied, Clear points and re-add, or add / remove points and Run again.

7. When satisfied, click Import as MultiROI to publish the result as a Dragonfly MultiROI.

6.2 Pure auto-segmentation

Inputs: as above, but choose a model that supports auto-segmentation (segmentation / DeepEdit).

1. Connect to the server and pick an auto-seg / DeepEdit model.

2. Select the image and click Load Channel.

3. Without placing any points, click Run; empty points are sent and the server performs full auto-segmentation.

4. Review the overlay and, when satisfied, click Import as MultiROI.

6.3 Active learning: which volume to label next

Inputs: the server's studies datastore already holds the unlabeled scans to process.

1. After connecting, pick a sampling strategy in Strategy (e.g. epistemic).

2. Click Next best volume; the server returns the volume that should be annotated first, ranked by uncertainty.

3. The log reports that volume's id plus its uncertainty / weight; annotate that volume first in the server's datastore.

7. Parameter Reference

Control / Parameter

Default

Description

Server URL

http://127.0.0.1:8384

MONAI Label server address; may point at a local or remote server.

Model

first model returned by the server

The model used for inference; each item is tagged with type / dimension.

Label

first non-background label of the model

Click hint points apply to this label; used by DeepEdit / DeepGrow.

Channel

first Channel in the session

The image Channel used as segmentation input; click ↻ to refresh.

Slice

middle slice after loading

Scrolls through slices; range 0 to (slice count - 1).

Show mask

checked (on)

Whether to overlay the result mask in red on the slice.

Strategy

first strategy returned by the server

Active-learning sampling strategy (e.g. epistemic).

Foreground point (left-click)

none (empty = auto-seg)

Integer voxel coordinates [i, j, k]; a positive hint.

Background point (right-click)

none

Integer voxel coordinates [i, j, k]; a negative hint (exclude region).

8. Output

The panel's main output is a MultiROI (multi-label region of interest), published on the source Channel's grid via Import as MultiROI:

  • The MultiROI is voxel-for-voxel aligned with the source Channel: because export and the returned label share one NIfTI affine (built from the source Channel's spacing and origin), the mask coincides exactly with the original image in Dragonfly.
  • Publishing prefers CellposeHelper to build the MultiROI directly on the channel grid; if unavailable, it falls back to an aligned labelmap Channel converted to a MultiROI; as a last resort it publishes the labelmap as a Channel (the log reports which path was taken).
  • The resulting MultiROI is named like MONAI Label: <model name>.

How to view: after import, the MultiROI appears in Dragonfly's object list; you can display and color it in 2D / 3D views and feed it into downstream measurement and analysis, or use it as deep-learning training labels.

On geometry / orientation: voxel-level alignment is reliable, but the anatomical orientation (RAS / LPS) required by the model is best-effort. Verify the orientation on a known volume before relying on it.

9. FAQ & Troubleshooting

Q: Connect / Refresh says the server is not reachable. What now?

A: Make sure the MONAI Label server is running — start MONAI Label Server under Prototype Apps ▸ Server Management — or check the Server URL (default http://127.0.0.1:8384). The first server start downloads over the internet, so wait for it to become ready before connecting.

Q: The log says it cannot find monailabel_client.py.

A: The plugin relies on the Prototype Labs embedded package for that file. Ensure the Prototype Labs core is installed (it ships with the Full Package), or set DF_PROTOTYPE_LABS_DIR to a folder that contains monailabel_client.py.

Q: The Model / Label / Strategy dropdowns are empty.

A: These lists come from the server's /info and are only filled after a successful connection. Connect first; if still empty, the server has no such models or strategies configured — check its installed sample app (default radiology) and model configuration.

Q: My image is not in the Channel dropdown.

A: Click ↻ to refresh the channel list and confirm the image is open as a Channel in the current Dragonfly session. If the log reports it cannot be read to a numpy array after loading, verify it is a regular scalar image Channel.

Q: Inference returns "no mask" or an empty result.

A: Check that the chosen model matches how you are using it (interactive models expect points, or allow empty points for auto-seg); the log shows the server's returned result for diagnosis. For interactive models, try adding a few more foreground points inside the target and background points on clearly non-target areas, then re-run.

Q: Next best volume says there is nothing to annotate.

A: Active learning operates on the server's studies datastore. Upload the scans to annotate into the server's datastore (or use its demo dataset) to populate the queue, then retry.

10. Notes & Known Limitations

  • Hint points are captured in the embedded 2D slice viewer as integer voxel coordinates; picking directly in Dragonfly's 2D / 3D viewports is not yet supported (a future enhancement).
  • Anatomical orientation (RAS / LPS) is best-effort; verify on a known volume on first use.
  • Inference speed depends on the server's compute: an NVIDIA GPU uses CUDA acceleration, while CPU-only is noticeably slower.
  • Active learning and submitting corrections require scans to live in the server's studies datastore; loading a Channel in the panel does not upload it there automatically.
  • Menus are scanned only at Dragonfly startup, so enabling / disabling the plugin requires one restart to take effect.

11. References

  • MONAI Label project: https://github.com/Project-MONAI/MONAILabel
  • Project MONAI (Medical Open Network for AI): https://monai.io
  • In-panel hint: "Left-click = foreground · Right-click = background · No clicks = pure auto-segmentation".
  • Server management and install / enable: see Prototype Apps ▸ Server Management and the Full Package README.
You’ve reached the end of this manual.Explore the library →