neu_mark.bodies

Reading the body list, which every command here requires.

DVID can list the elements in a body but cannot cheaply say which bodies are worth asking about (most label ids are single-voxel fragments), so the caller supplies the set, normally a curated list of traced neurons. Accepted forms:

  • an iterable of ints;

  • a path to .csv / .parquet / .feather: a body-id column, or the only column;

  • a path to anything else: one id per line, # comments allowed;

  • otherwise an inline list, 123,456,789, comma or whitespace separated.

The tables this package writes are valid inputs.

Functions

load(source, *[, column]) → list[int]

Resolve source to a de-duplicated, sorted list of body ids.

summarise(bodies) → str

One line for the log: how many, and the range they span.

Module Contents

neu_mark.bodies.load(source: str | Iterable[int], *, column: str | None = None) → list[int]

Resolve source to a de-duplicated, sorted list of body ids.

Sorted, so output order depends only on the set requested; de-duplicated, so no body is fetched or written twice.

neu_mark.bodies.summarise(bodies: Sequence[int]) → str

One line for the log: how many, and the range they span.