tree_run_length — GRAPH tree op

• 数据种类:table × signal → table

• 调用: import fullseye as fs; fs.ledger.tree_run_length(tree, labels, background=0, zero_labels=None)(要直接调用实现,import treemorph; treemorph.tree_run_length(tree, labels, background=0, zero_labels=None);从台账取用则 opsgraph.get("tree_run_length"))

用法

> 该算子的说明尚无译文,以下照原文给出。

Expected run length (ERL) of a skeleton under a candidate labelling of its nodes.

`labels` gives, for every node of the tree table, the candidate object it falls in.

A run is a maximal connected piece of the tree whose nodes all carry the same

label and that holds at least one edge; its length is the cable inside it (an edge

belongs to a run only if both ends share the label; a lone node between two cuts is

no run). Edges touching `background` belong to no run. Runs whose label is

in `zero_labels` (objects that also cover another skeleton — a merge) count as length

0, as in Januszewski et al. 2018: a merged run is not trustworthy anywhere.

`erl = sum(l_i^2) / L with L` the whole cable — the run length a point drawn

uniformly along the skeleton finds itself in (points on cut or background edges find

length 0). Also returns `run_lengths` (one per run, merged runs already zeroed),

`runs, max_run, cable_length, cut_edges` (both ends labelled, differently),

`background_edges and merged_runs`.

Identities: `erl == L` when every node carries one non-background label;

`sum(run_lengths) + cut cable + background cable == L`; for any labelling with

`k runs and no lost cable, erl >= L / k (Cauchy-Schwarz) and erl <= max_run`;

a path of length `L cut at m equally spaced points gives exactly L / (m + 1)`;

cut at `m uniformly random points, E[erl] = 2L / (m + 2)` (Dirichlet(1, .., 1)).

Raises `ValueError: not a tree table; labels` not one integer per node,

non-finite or non-integer.

参考(示例数据・文献)

• 示例数据目录(下载 URL / 许可证) —— 2-D 用 skimage.data(BSD/公有领域)加合成图,3-D 给出真实数据源(Stanford/PDS 等)的下载 URL。

• 算子来历与参考文献 —— 该算子族所依据的研究/方法出处。

• 算法的正典(作者・年份)与用途见上面的族使用指南。

可运行的示例(实际调用该算子并已验证的样例)

• poc_skeleton_run_length_vs_voi — py -3.11 examples/poc_skeleton_run_length_vs_voi.py

类型可衔接的下一个算子(可接受 table 作为输入)

graph_edge_consensus · graph_core_persistence · tree_morphometry · tree_sholl

同类别(tree)

tree_from_swc · tree_morphometry · tree_sholl


*Provenance: treemorph.py — GRAPH 算子登记表。本条目由 tools/opdocs.py md 自动生成(请勿手工编辑)。*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.