biopb.tensor¶
biopb.tensor ¶
Tensor storage framework on Arrow Flight.
This package provides TensorStore-like framework built on Apache Arrow Flight for efficient multi-dimensional array storage and retrieval.
Key components:
- TensorFlightClient: Client for accessing tensors from a TensorFlightServer
- Connection: the data plane this machine's control names, dialed and shared
- Proto messages: TensorTicket, ChunkBounds, TensorDescriptor, SliceHint
- query / resolve hand back sources catalog rows; what you decode
them into is yours (descriptors_from_rows is the deprecated proto form)
- CLI diagnostics: biopb tensor command for inspecting sources and tensors
The CLI module provides the biopb tensor command with four subcommands:
- query: List sources and tensors from a running server
- metadata: Inspect source metadata and tensor descriptors
- get: Download tensor data to file or stdout
- stats: Compute min/max/mean statistics for a tensor
Note: Server components have been moved to the biopb-tensor-server package.
LabelAddress ¶
Bases: NamedTuple
A label set's array_id, taken apart.
descriptor_from_row ¶
One sources row -> DataSourceDescriptor.
.. deprecated:: Use the row. See the module docstring.
Source code in src/main/python/biopb/tensor/_catalog_rows.py
descriptors_from_rows ¶
sources rows -> DataSourceDescriptors.
.. deprecated:: Use the rows. See the module docstring.
Source code in src/main/python/biopb/tensor/_catalog_rows.py
is_reserved_label_name ¶
label_image_axes ¶
For each axis of a set, the index of the image axis it indexes.
[0, 2, 3, 4] for a T Z Y X set of a T C Z Y X image: a set spans
the image's non-channel extent, so every axis after the image's c
sits one place to the left in the set. A client that instead matched axes by
position reads frame 0 of a timelapse where frame 40 was asked for, which is
a picture rather than an error.
Read, not derived, when the server says. biopb.labels.image_axes in
the set's metadata_json is the server's own statement of the mapping;
a descriptor fetched without metadata, or from a server that predates the
field, has none, and the extent rule is re-derived here instead -- the same
answer, from the one place that still has to know the rule.
None when the set does not span the image at all, which leaves the
caller nothing to align and is the server's own answer in that case too.
Source code in src/main/python/biopb/tensor/_labels.py
split_label_array_id ¶
Take a label set's array_id apart, or None if it names no set.
"src0/@labels/nuclei" -> image "src0", name "nuclei". Pass a
stable id: a content-pinned id@token is not one.