Documentation ¶
Overview ¶
Package labelblk supports only label volumes. See labelvol package for support of sparse labels. The labelblk and labelvol datatypes typically are synced to each other.
Index ¶
- Constants
- Variables
- func DecodeTKey(tk storage.TKey) (*dvid.IndexZYX, error)
- func EncodeFormat() dvid.DataValues
- func NewTKey(idx dvid.Index) storage.TKey
- func NewTKeyByCoord(izyx dvid.IZYXString) storage.TKey
- func ZeroBytes() []byte
- type Block
- type Data
- func GetByDataUUID(dataUUID dvid.UUID) (*Data, error)
- func GetByUUIDName(uuid dvid.UUID, name dvid.InstanceName) (*Data, error)
- func GetByVersionName(v dvid.VersionID, name dvid.InstanceName) (*Data, error)
- func NewData(uuid dvid.UUID, id dvid.InstanceID, name dvid.InstanceName, c dvid.Config) (*Data, error)
- func (d *Data) BlockSize() dvid.Point
- func (d *Data) CopyPropertiesFrom(src datastore.DataService, fs storage.FilterSpec) error
- func (d *Data) CreateComposite(request datastore.Request, reply *datastore.Response) error
- func (d *Data) CreateCompositeChunk(chunk *storage.Chunk) error
- func (d *Data) DescribeTKeyClass(tkc storage.TKeyClass) string
- func (d *Data) DoRPC(req datastore.Request, reply *datastore.Response) error
- func (d *Data) Equals(d2 *Data) bool
- func (d *Data) Extents() *dvid.Extents
- func (d *Data) GetBlocks(v dvid.VersionID, start dvid.ChunkPoint3d, span int) ([]Block, error)
- func (d *Data) GetImage(v dvid.VersionID, vox *Labels, roiname dvid.InstanceName) (*dvid.Image, error)
- func (d *Data) GetLabelAtPoint(v dvid.VersionID, pt dvid.Point) (uint64, error)
- func (d *Data) GetLabelBytes(v dvid.VersionID, bcoord dvid.ChunkPoint3d) ([]byte, error)
- func (d *Data) GetLabelBytesAtPoint(v dvid.VersionID, pt dvid.Point) ([]byte, error)
- func (d *Data) GetLabels(v dvid.VersionID, vox *Labels, r *imageblk.ROI) error
- func (d *Data) GetSyncSubs(synced dvid.Data) (datastore.SyncSubs, error)
- func (d *Data) GetVolume(v dvid.VersionID, vox *Labels, roiname dvid.InstanceName) ([]byte, error)
- func (d *Data) GobDecode(b []byte) error
- func (d *Data) GobEncode() ([]byte, error)
- func (d *Data) InitDataHandlers() error
- func (d *Data) MarshalJSON() ([]byte, error)
- func (d *Data) NewLabels(geom dvid.Geometry, img interface{}) (*Labels, error)
- func (d *Data) PushData(p *datastore.PushSession) error
- func (d *Data) ReadChunk(chunk *storage.Chunk) error
- func (d *Data) SendBlocks(ctx *datastore.VersionedCtx, w http.ResponseWriter, subvol *dvid.Subvolume, ...) error
- func (d *Data) ServeHTTP(uuid dvid.UUID, ctx *datastore.VersionedCtx, w http.ResponseWriter, ...) (activity map[string]interface{})
- func (d *Data) SetResolution(uuid dvid.UUID, jsonBytes []byte) error
- func (d *Data) Shutdown(wg *sync.WaitGroup)
- type Labels
- type Type
Constants ¶
const ( Version = "0.1" RepoURL = "github.com/janelia-flyem/dvid/datatype/labelblk" TypeName = "labelblk" )
const ( DownsizeBlockEvent = "LABELBLK_DOWNSIZE_ADD" DownsizeCommitEvent = "LABELBLK_DOWNSIZE_COMMIT" )
Variables ¶
var ( DefaultBlockSize int32 = imageblk.DefaultBlockSize DefaultRes float32 = imageblk.DefaultRes DefaultUnits = imageblk.DefaultUnits )
Functions ¶
func DecodeTKey ¶
DecodeKey returns a spatial index from a label block key. TODO: Extend this when necessary to allow any form of spatial indexing like CZYX.
func EncodeFormat ¶
func EncodeFormat() dvid.DataValues
func NewTKey ¶
NewTKey returns a TKey for a label block, which is a slice suitable for lexicographical ordering on zyx coordinates.
func NewTKeyByCoord ¶
func NewTKeyByCoord(izyx dvid.IZYXString) storage.TKey
NewTKeyByCoord returns a TKey for a block coord in string format.
Types ¶
type Block ¶
type Block struct { Pos dvid.ChunkPoint3d Data []byte }
type Data ¶
Data of labelblk type is an extended form of imageblk Data
func GetByDataUUID ¶
GetByDataUUID returns a pointer to labelblk data given a data UUID.
func GetByUUIDName ¶
GetByUUIDName returns a pointer to labelblk data given a UUID and data name.
func GetByVersionName ¶
GetByVersionName returns a pointer to labelblk data given a version and data name.
func NewData ¶
func NewData(uuid dvid.UUID, id dvid.InstanceID, name dvid.InstanceName, c dvid.Config) (*Data, error)
NewData returns a pointer to labelblk data.
func (*Data) CopyPropertiesFrom ¶
func (d *Data) CopyPropertiesFrom(src datastore.DataService, fs storage.FilterSpec) error
CopyPropertiesFrom copies the data instance-specific properties from a given data instance into the receiver's properties. Fulfills the datastore.PropertyCopier interface.
func (*Data) CreateComposite ¶
CreateComposite creates a new rgba8 image by combining hash of labels + the grayscale
func (*Data) CreateCompositeChunk ¶
CreateCompositeChunk processes each chunk of labels and grayscale data, saving the composited result into an rgba8. Only some multiple of the # of CPU cores can be used for chunk handling before it waits for chunk processing to abate via the buffered server.HandlerToken channel.
func (*Data) DescribeTKeyClass ¶
DescribeTKeyClass returns a string explanation of what a particular TKeyClass is used for. Implements the datastore.TKeyClassDescriber interface.
func (*Data) GetImage ¶
func (d *Data) GetImage(v dvid.VersionID, vox *Labels, roiname dvid.InstanceName) (*dvid.Image, error)
GetImage retrieves a 2d image from a version node given a geometry of labels.
func (*Data) GetLabelAtPoint ¶
GetLabelAtPoint returns the 64-bit unsigned int label for a given point.
func (*Data) GetLabelBytes ¶
GetLabelBytes returns a slice of little-endian uint64 corresponding to the block coordinate.
func (*Data) GetLabelBytesAtPoint ¶
GetLabelBytesAtPoint returns the 8 byte slice corresponding to a 64-bit label at a point.
func (*Data) GetLabels ¶
GetLabels copies labels from the storage engine to Labels, a requested subvolume or 2d image.
func (*Data) GetSyncSubs ¶
GetSyncSubs implements the datastore.Syncer interface
func (*Data) GetVolume ¶
GetVolume retrieves a n-d volume from a version node given a geometry of labels.
func (*Data) InitDataHandlers ¶
InitDataHandlers launches goroutines to handle each labelblk instance's syncs.
func (*Data) MarshalJSON ¶
func (*Data) NewLabels ¶
NewLabels returns labelblk Labels, a representation of externally usable subvolume or slice data, given some geometry and optional image data. If img is passed in, the function will initialize Voxels with data from the image. Otherwise, it will allocate a zero buffer of appropriate size.
func (*Data) PushData ¶
func (d *Data) PushData(p *datastore.PushSession) error
PushData pushes labelblk data to a remote DVID.
func (*Data) ReadChunk ¶
ReadChunk reads a chunk of data as part of a mapped operation. Only some multiple of the # of CPU cores can be used for chunk handling before it waits for chunk processing to abate via the buffered server.HandlerToken channel.
func (*Data) SendBlocks ¶
func (d *Data) SendBlocks(ctx *datastore.VersionedCtx, w http.ResponseWriter, subvol *dvid.Subvolume, compression string) error
SendBlocks writes all blocks within the given subvolume to the http.ResponseWriter.
func (*Data) ServeHTTP ¶
func (d *Data) ServeHTTP(uuid dvid.UUID, ctx *datastore.VersionedCtx, w http.ResponseWriter, r *http.Request) (activity map[string]interface{})
ServeHTTP handles all incoming HTTP requests for this data.
func (*Data) SetResolution ¶
SetResolution loads JSON data giving Resolution.
type Labels ¶
Labels are voxels that have uint64 labels.
func (*Labels) ComputeTransform ¶
func (v *Labels) ComputeTransform(block *storage.TKeyValue, blockSize dvid.Point) (blockBeg, dataBeg, dataEnd dvid.Point, err error)
ComputeTransform determines the block coordinate and beginning + ending voxel points for the data corresponding to the given Block.
func (*Labels) Interpolable ¶
type Type ¶
Type uses imageblk data type by composition.
func (*Type) NewDataService ¶
func (dtype *Type) NewDataService(uuid dvid.UUID, id dvid.InstanceID, name dvid.InstanceName, c dvid.Config) (datastore.DataService, error)