neu_eval.tables¶
Writing results out, and reading a reviewed disagreement table back in.
Metrics go to parquet, which round-trips nullable integer columns. The disagreement table
goes to csv, because a reviewer edits its verdict column. Spreadsheets parse long integers
as float64 and round 19-digit body ids, so ids are written as text and pair_key is the
join key on the way back in.
pandas and pyarrow (neu-eval[report]) are imported inside functions, so
import neu_eval does not load them.
Attributes¶
Functions¶
|
The located rows as a point list |
Per-label VOI contributions and sizes, one row per label on each side. |
|
|
|
|
The located shapes as the CSVs |
|
The ranked disagreements as csv, with a |
|
One parquet file of metric rows. Accepts a single row or many. |
|
A DataFrame to parquet, matching |
Module Contents¶
- neu_eval.tables.annotation_csv(rows: Iterable[Mapping], path: str | pathlib.Path, *, labels: Sequence[str] = ('gt', 'seg')) str¶
The located rows as a point list
neu-glance annotate --pointscan read.Columns
z,y,x(required by neu-glance),description,segments. Coordinates are nm, so the command needs--nmand a frame (--volumeor--voxel-size).segmentsholds both ids of the pair; only the one in the linked segmentation layer is found, which is harmless.They become local annotations, which, unlike a precomputed annotation source, are listed in neuroglancer’s Annotations tab, so the worst-first list can be stepped with
[and].
- neu_eval.tables.per_label_frame(c: neu_eval.overlap.Contingency)¶
Per-label VOI contributions and sizes, one row per label on each side.
One long frame with a
sidecolumn.
- neu_eval.tables.read_disagreements(path: str | pathlib.Path) tuple[list[dict], dict[str, str]]¶
(rows, verdicts)from a csv written bywrite_disagreements().verdictsmapspair_keyto the verdict text, ready forneu_eval.adjudicate.apply(). Rows come back as strings; numeric columns in a hand-edited file are not re-parsed.
- neu_eval.tables.shape_csvs(rows: Iterable[Mapping], out_dir: str | pathlib.Path, prefix: str, *, labels: Sequence[str] = ('gt', 'seg'), relationships: Sequence[str] = ()) dict[str, dict[str, str]]¶
The located shapes as the CSVs
neu-glance annotatereads, one set per kind.Returns
{"merges": {"lines": path, "points": path}, "splits": {"ellipsoids": ...}, "tangles": {"lines": ..., "ellipsoids": ...}}, only for files with rows, so each kind becomes its own toggleable layer.Coordinates are nm (use
annotate --nm). Each row has asegments:<name>column per entry ofrelationships, holding the idsneu_eval.disagree.sample_ids()found at the shape’s anchors, forannotate --link <name>=<layer>. An empty one is written empty, not left out, because the viewer matches id lists by position. A row with no seam is written as a point, so every row gets an annotation.
- neu_eval.tables.write_disagreements(rows: Iterable[Mapping], path: str | pathlib.Path, *, labels: Sequence[str] = ('gt', 'seg'), verdicts: Mapping[str, str] | None = None) str¶
The ranked disagreements as csv, with a
verdictcolumn to fill in.Uses the stdlib
csvmodule, so it needs no optional extra.verdictspre-fills the column, so re-running a comparison keeps an existing review. Also writes a.README.txtlegend beside it for the reviewer.
- neu_eval.tables.write_summary(rows: Mapping | Sequence[Mapping], path: str | pathlib.Path) str¶
One parquet file of metric rows. Accepts a single row or many.
- neu_eval.tables.write_table(frame, path: str | pathlib.Path) str¶
A DataFrame to parquet, matching
neu_morpho.measure.tables.write_table.
- neu_eval.tables.SHAPE_OF¶