Documentation ¶
Overview ¶
Package labels provides various indexing options for labels and label maps. It defines interfaces that can be used by other packages implementing 64-bit labels and label maps.
Index ¶
- func ComputeSizes(labeler Labeler, sizeCh chan *storage.Chunk, db storage.OrderedKeyValueSetter, ...)
- func GetSizeRange(labeler Labeler, uuid dvid.UUID, minSize, maxSize uint64) (string, error)
- func NewForwardMapKey(labeler Labeler, vID dvid.VersionLocalID, label []byte, mapping uint64) *datastore.DataKey
- func NewLabelSizesKey(labeler Labeler, vID dvid.VersionLocalID, size, label uint64) *datastore.DataKey
- func NewLabelSpatialMapKey(labeler Labeler, vID dvid.VersionLocalID, label uint64, block dvid.IndexZYX) *datastore.DataKey
- func NewLabelSurfaceKey(labeler Labeler, vID dvid.VersionLocalID, label uint64) *datastore.DataKey
- func NewSpatialMapKey(labeler Labeler, vID dvid.VersionLocalID, blockIndex dvid.Index, label []byte, ...) *datastore.DataKey
- func StoreKeyLabelSpatialMap(labeler Labeler, batcher storage.Batcher, versionID dvid.VersionLocalID, ...)
- func ZeroBytes() []byte
- type KeyType
- type Labeler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeSizes ¶
func ComputeSizes(labeler Labeler, sizeCh chan *storage.Chunk, db storage.OrderedKeyValueSetter, versionID dvid.VersionLocalID, wg *sync.WaitGroup)
Runs asynchronously and assumes that sparse volumes per spatial indices are ordered by mapped label, i.e., we will get all data for body N before body N+1. Exits when receives a nil in channel.
func GetSizeRange ¶
GetSizeRange returns a JSON list of mapped labels that have volumes within the given range. If maxSize is 0, all mapped labels are returned >= minSize.
func NewForwardMapKey ¶
func NewForwardMapKey(labeler Labeler, vID dvid.VersionLocalID, label []byte, mapping uint64) *datastore.DataKey
NewForwardMapKey returns a datastore.DataKey that encodes a "label + mapping", where the label and mapping are both uint64.
func NewLabelSizesKey ¶
func NewLabelSizesKey(labeler Labeler, vID dvid.VersionLocalID, size, label uint64) *datastore.DataKey
NewLabelSizesKey returns a datastore.DataKey that encodes a "size + mapped label".
func NewLabelSpatialMapKey ¶
func NewLabelSpatialMapKey(labeler Labeler, vID dvid.VersionLocalID, label uint64, block dvid.IndexZYX) *datastore.DataKey
NewLabelSpatialMapKey returns a datastore.DataKey that encodes a "label + spatial index", where the spatial index references a block that contains a voxel with the given label.
func NewLabelSurfaceKey ¶
NewLabelSurfaceKey returns a datastore.DataKey that provides a surface for a given label.
func NewSpatialMapKey ¶
func NewSpatialMapKey(labeler Labeler, vID dvid.VersionLocalID, blockIndex dvid.Index, label []byte, mapping uint64) *datastore.DataKey
NewSpatialMapKey returns a datastore.DataKey that encodes a "spatial index + label + mapping".
Types ¶
type KeyType ¶
type KeyType byte
const ( // KeyInverseMap have keys of form 'b+a' KeyInverseMap KeyType = iota // KeyForwardMap have keys of form 'a+b' // For superpixel->body maps, this key would be superpixel+body. KeyForwardMap // KeySpatialMap have keys of form 's+a+b' // They are useful for composing label maps for a spatial index. KeySpatialMap // KeyLabelSpatialMap have keys of form 'b+s' and have a sparse volume // encoding for its value. They are useful for returning all blocks // intersected by a label. KeyLabelSpatialMap // KeyLabelSizes have keys of form 'v+b'. // They allow rapid size range queries. KeyLabelSizes )
Label indexing is handled through a variety of key spaces that optimize throughput for access patterns required by our API. For dcumentation purposes, consider the following key components:
a: original label b: mapped label s: spatial index (coordinate of a block) v: # of voxels for a label