neu_mark.notebook¶
Fetches that return DataFrames and write nothing. The interactive entry point.
neu_mark.ops writes what these return, as tables plus a provenance record; both are
thin over neu_mark.dvid. Everything here is re-exported at the package top level:
>>> from neu_mark import source, select_bodies, points, body_annotations
>>> src = source("dvid://dvid.example.org/93fdbc:main/synapses",
... locked=True)
>>> sel = select_bodies(src, min_synapses=10) # DataFrame: body, pre, post, syn
>>> pts, rels = points(src, sel.head(50)) # DataFrames; nothing written
>>> ann = body_annotations("@bodies", sel.head(50))
A source is a dvid:// URL, an @name config reference (neu_mark.config), an
already-opened source dict, or a bare instance name when a config supplies the server and
uuid.
Functions¶
|
Every record in the property keyvalue instance, as one row per body. |
|
The per-body property records for |
|
Body ids from a DataFrame (its |
|
Point annotations for |
|
An ROI name list from a list, a comma-separated string, or an |
|
Bodies ranked by synapse count. Returns |
|
Resolve a location to an opened source: concrete uuid, validated instance type. |
|
Exact |
Module Contents¶
- neu_mark.notebook.all_body_annotations(location='bodies', *, locked: bool = False, config=None)¶
Every record in the property keyvalue instance, as one row per body.
A different population from a synapse-selected body list: most glia, for instance, sit below any synapse threshold. About a minute for ~58,000 records (see
neu_mark.dvid.fetch_all_body_annotations()).
- neu_mark.notebook.body_annotations(location='bodies', bodies=None, *, locked: bool = False, config=None)¶
The per-body property records for
bodies, as one row per body.
- neu_mark.notebook.body_ids(bodies) list[int]¶
Body ids from a DataFrame (its
body,bodyidorbody_idcolumn), a Series, an iterable, a body-list file path, or a single id.
- neu_mark.notebook.points(location, bodies, *, threads: int = _dvid.DEFAULT_THREADS, locked: bool = False, config=None, connections: bool = False, rois: Sequence[str] | str | None = None, on_roi_overlap: str = 'warn')¶
Point annotations for
bodies. Returns(points, relationships).With
connections=Truereturns(points, relationships, connections), the last being de-duplicated(tbar, psd)pairs; check how much of it resolved withneu_mark.tables.match_rate().rois(ROI names, or"@name"for a set in the config) adds aroicolumn to the points frame only, since a relationship’s two ends may be in different neuropils.neu_mark.tables.body_roi_counts()aggregates it per body.
- neu_mark.notebook.roi_set(rois: Sequence[str] | str, *, config=None) list[str]¶
An ROI name list from a list, a comma-separated string, or an
@nameconfig set.
- neu_mark.notebook.select_bodies(location='counts', *, min_synapses: int = 10, min_pre: int = 0, min_post: int = 0, limit: int | None = None, locked: bool = False, config=None)¶
Bodies ranked by synapse count. Returns
body,pre,post,syn.The query behind
neu-mark select-bodies, without writing anything.
- neu_mark.notebook.source(location: str | Mapping[str, Any], *, kind: str = 'points', locked: bool = False, config=None) dict[str, Any]¶
Resolve a location to an opened source: concrete uuid, validated instance type.
kindis"points"(an annotation instance),"bodies"(keyvalue) or"counts"(a labelsz index, or the annotation instance it indexes). The node is pinned once, so later calls read the same version even if the branch moves.
- neu_mark.notebook.synapse_counts(location='counts', bodies=None, *, locked: bool = False, config=None)¶
Exact
PreSyn/PostSyncounts for specific bodies, ignoring any threshold.select_bodies()finds the bodies above a threshold; this counts a given list.