Half-Height Slope Width(半高坡宽度)
Half-Height Slope Width - User Manual
Dragonfly Prototype Apps · Half-Height Slope Width...
版本 Version 1.2 · 2026-08-10
第一部分 中文手册
目录
1. 简介
2. 两种用法
3. 算法
4. 环境需求
1. 简介
Half-Height Slope Width 测量沿标尺灰度剖面的半高坡宽度:在选定通道上沿选定标尺采样灰度剖面(100 点),自动找到剖面内部的峰或谷,在两侧斜坡上分别取“基线与极值的中点”(半高点,线性插值),测量两个半高点之间的宽度(毫米),并可一键在半高点位置生成新标尺。本插件是旧本地插件 CalWidthOfHalfHighSlope(计算半高坡宽度)的 Prototype Apps 移植版。
本功能由第三方(Prototype Labs / Prototype Apps)提供,非 Dragonfly 官方开发或支持。与旧版不同,本版启动时不加载任何重库(旧版在 Dragonfly 启动时导入 numpy 等,拖慢启动)。
2. 两种用法
- 面板:菜单 Prototype Apps ▸ Half-Height Slope Width…,在面板中选择通道与标尺,点“计算”;勾选“生成新标尺”则同时在半高点位置发布一条新标尺(标题为“原标尺名 (half-height)”)。
- 右键(与旧版一致):在对象列表中选中一条标尺 ▸ 右键 ▸ Half-Height Slope Width 半高坡宽度:一键计算并弹出结果,可选择“确定并生成新标尺”。多通道时会先弹出通道选择。
右键菜单上那一项带一个标记 —— 而本手册引用的是不带标记的名称。 在 Dragonfly 自带的右键菜单里,这一项的名称前会显示一个标记,默认是圆点 ●,用来表示它是 Prototype Apps 添加的,而不是 Dragonfly 原生的 —— Dragonfly 自带的菜单项永远不带标记。所以本项的名称是「Half-Height Slope Width 半高坡宽度」,而在默认标记下,它在菜单上显示为 ● Half-Height Slope Width 半高坡宽度。
标记不在本插件里设置。它是整个 Prototype Apps 共用的一个设置,位于另一个插件的面板里:Custom Context Menus(自定义右键菜单) ▸「1 菜单项」页 ▸ 在 Dragonfly 菜单上标记本插件添加的项 分组。在那里可以换成别的标记(•、▪、@),也可以选「不加标记」彻底关掉,改动会同时作用于所有带标记的菜单项。本项由 Dragonfly 在每次右键时重新生成,因此改动在你下次右键时生效,不需要重启。这个设置保存在两个插件之外的共用文件里,因此即使 Custom Context Menus 没有安装、或在 App Store 中被禁用,你选定的标记(包括「不加标记」)仍然对本项生效。那种情况下失去的只是修改入口:此时没有任何面板可供选择;而从未设置过的安装则显示默认标记。
3. 算法
1. 沿标尺在通道上等距采样 100 个点的灰度均值(与 Dragonfly 剖面工具同一 API)。
2. 找内部极值:比较内部最大/最小值相对两端基线均值的偏离,取偏离更大者(峰或谷)。
3. 左侧斜坡:目标幅度 =(左端基线 + 极值)/2,线性插值求穿越点;右侧同理。
4. 宽度 = 两个半高点的间距;结果按两点的世界坐标距离换算为毫米。
极值位于标尺端点、剖面单调或采样点不足 3 个时给出明确错误提示而不是失败。三角形剖面与高斯剖面(对照解析 FWHM)均通过单元测试验证。
4. 环境需求
无需安装/联网/GPU/虚拟环境。需要会话中至少一个通道和一条标尺标注。
Part II English Manual
Contents
1. Introduction
2. Two ways to use it
3. Algorithm
4. Requirements
1. Introduction
Half-Height Slope Width measures the width between the two half-height slope crossings of the intensity profile along a ruler: the profile is sampled on a selected channel along a selected ruler (100 points), the internal peak or valley is found automatically, the half-height point (midpoint between baseline and extremum, linearly interpolated) is located on each slope, and the width between the two points is reported in millimetres — optionally publishing a new ruler spanning them. This is the Prototype Apps port of the legacy local plugin CalWidthOfHalfHighSlope (计算半高坡宽度).
This feature is provided by a third party (Prototype Labs / Apps), not officially developed or supported by Dragonfly. Unlike the legacy plugin, it imports nothing heavy at Dragonfly startup.
2. Two ways to use it
- Panel: menu Prototype Apps > Half-Height Slope Width..., pick a channel and a ruler, click Calculate; tick the publish option to also create a new ruler at the half-height points (titled '<ruler> (half-height)').
- Right-click (legacy flow): select a ruler in the object list > right-click > 'Half-Height Slope Width 半高坡宽度': one click computes and shows the result, with an 'OK + new ruler' option. With multiple channels a picker appears first.
The right-click entry carries a marker - and this manual quotes its name without one. On Dragonfly's own right-click menu the entry is displayed with one glyph in front of its name, ● by default, so you can see at a glance that Prototype Apps added it and Dragonfly did not; Dragonfly's own entries never carry one. So the entry's name is Half-Height Slope Width 半高坡宽度, and with the default marker it reads ● Half-Height Slope Width 半高坡宽度 on the menu.
The marker is not a setting of this plugin. It is one setting shared by all of Prototype Apps, and it lives in a DIFFERENT plugin's panel: Custom Context Menus ▸ the 1 Entries tab ▸ the Mark our entries on Dragonfly's menus group. There you can pick another glyph (•, ▪, @) or choose no marker to switch the feature off completely, and every marked entry across the plugins changes with it. Dragonfly rebuilds this entry on every right-click, so a change shows at your next right-click - no restart. The setting lives in a shared file outside both plugins, so your choice - including no marker - still applies to this entry when Custom Context Menus is not installed or is disabled in the App Store. What you lose in that case is only the place to CHANGE it: there is then no panel offering the choice, and an installation that never made one shows the default marker.
3. Algorithm
1. Sample 100 equidistant mean-intensity points along the ruler (the same API as Dragonfly's profile tool).
2. Find the internal extremum: compare the internal max/min deviation from the mean of the two end baselines; take the larger (peak or valley).
3. Left slope: target amplitude = (left baseline + extremum)/2, crossing found by linear interpolation; right slope likewise.
4. Width = distance between the two half-height points, converted to millimetres from their world coordinates.
An extremum at a ruler end, a monotonic profile, or fewer than 3 samples produce clear error messages instead of failures. Unit-tested against a triangle profile and a Gaussian (matches the analytic FWHM).
4. Requirements
No install/internet/GPU/venv. Needs at least one Channel and one ruler annotation in the session.