neu_vol.mapped¶
A supervoxel volume read through a lookup table, addressed by a small descriptor file.
A segmentation delivered as supervoxels plus agglomeration views (webknossos’
agglomerate_view_NN) is one volume and N tables; each view is table[supervoxels],
read on the fly. A view is addressed by a descriptor, a JSON file any location-taking
entry point accepts (neu-vol info, read_piece, neu-vol convert --src):
{"neu_vol": "mapped-volume", "version": 1,
"source": "/path/to/supervoxels.precomputed",
"table": "agglomerate_view_80.npy", "mapping": "agglomerate_view_80"}
Relative paths resolve against the descriptor’s directory, so a directory of views moves
whole. Level 0 is exact; coarse levels are approximate, since table[mode(sv)] is not
mode(table[sv]), so measure at level 0 (convert rebuilds the pyramid from it).
Descriptors and tables may be local or on an object store; a table is loaded whole, once
per process.
Attributes¶
Functions¶
|
A local path made absolute; a URL unchanged. Descriptors record locations this way, |
|
|
|
True if |
|
|
|
The |
|
The descriptor at |
|
A table as |
|
Write a descriptor at |
Module Contents¶
- neu_vol.mapped.absolute(location: str) str¶
A local path made absolute; a URL unchanged. Descriptors record locations this way, so they mean the same thing from whatever directory they are read.
- neu_vol.mapped.clear_cache() None¶
- neu_vol.mapped.is_descriptor(location: Any) bool¶
True if
locationis a JSON object (local or remote) carrying this marker.Only
.jsonnames are read, so detection costs nothing for any other location.
- neu_vol.mapped.load_table(path: str) numpy.ndarray¶
- neu_vol.mapped.location_spec(path: str) dict¶
The
mappedspec for a descriptor: the source’s own spec, wrapped.
- neu_vol.mapped.read_descriptor(path: str) dict¶
The descriptor at
path, withsourceandtableresolved.
- neu_vol.mapped.table_bytes(table: numpy.ndarray) bytes¶
A table as
.npybytes, for writing throughlocation.
- neu_vol.mapped.write_descriptor(path: str, *, source: str, table: str, mapping: str, origin: Mapping[str, Any] | None = None) None¶
Write a descriptor at
path(local or remote).tableis stored as given, so pass a bare file name for a table beside the descriptor — that keeps a directory of views movable as a whole.sourceis made absolute if it is a relative local path.
- neu_vol.mapped.MARKER = 'mapped-volume'¶
- neu_vol.mapped.TAG = 'mapped'¶