LocsetMask#

class braincell.filter.LocsetMask(points=(), display_names=None)[source]#

Resolved ordered locations in read-only columnar storage.

Parameters:
  • points (tuple[tuple[int, float], ...] | list[tuple[int, float]]) – Location rows in (branch_id, branch_x) form. Row order and duplicate rows are preserved.

  • display_names (tuple[str, ...] | list[str] | None) – Human-readable labels aligned with points. Names may be omitted when a mask is constructed independently of a morphology.

property branch_id: ndarray#

Read-only branch identifier column.

property branch_x: ndarray#

Read-only normalized branch-coordinate column.

property display_names: tuple[str, ...] | None#

Optional human-readable names aligned with location rows.

classmethod from_columns(branch_id, branch_x, display_names=None)[source]#

Construct a mask directly from aligned location columns.

Parameters:
  • branch_id (object) – One-dimensional integer branch identifiers.

  • branch_x (object) – One-dimensional normalized branch coordinates in [0, 1].

  • display_names (tuple[str, ...] | list[str] | None) – Human-readable names aligned with the two location columns.

Returns:

A mask whose columns are immutable copies of the input data.

Return type:

LocsetMask

property points: tuple[tuple[int, float], ...]#

Compatibility row view in (branch_id, branch_x) form.

resolved_display_names(morpho)[source]#

Return display names, deriving branch(x) labels when unset.

Locations carry optional author-supplied names; when they are absent every consumer needs the same branch_name(x) fallback, so the label format is defined here rather than at each call site.

Parameters:

morpho (braincell.Morphology) – Morphology used to resolve branch names.

Returns:

One label per location row.

Return type:

tuple[str, ...]

unique()[source]#

Return stable first-occurrence unique location rows.

Return type:

LocsetMask