dvid: github.com/janelia-flyem/dvid/datatype/labelblk Index | Files

package labelblk

import "github.com/janelia-flyem/dvid/datatype/labelblk"

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

Package Files

composite.go keys.go labelblk.go read.go sync.go

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
)

func DecodeTKey Uses

func DecodeTKey(tk storage.TKey) (*dvid.IndexZYX, error)

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 Uses

func EncodeFormat() dvid.DataValues

func NewTKey Uses

func NewTKey(idx dvid.Index) storage.TKey

NewTKey returns a TKey for a label block, which is a slice suitable for lexicographical ordering on zyx coordinates.

func NewTKeyByCoord Uses

func NewTKeyByCoord(izyx dvid.IZYXString) storage.TKey

NewTKeyByCoord returns a TKey for a block coord in string format.

func ZeroBytes Uses

func ZeroBytes() []byte

ZeroBytes returns a slice of bytes that represents the zero label.

type Block Uses

type Block struct {
    Pos  dvid.ChunkPoint3d
    Data []byte
}

type Data Uses

type Data struct {
    *imageblk.Data
    datastore.Updater
    // contains filtered or unexported fields
}

Data of labelblk type is an extended form of imageblk Data

func GetByDataUUID Uses

func GetByDataUUID(dataUUID dvid.UUID) (*Data, error)

GetByDataUUID returns a pointer to labelblk data given a data UUID.

func GetByUUIDName Uses

func GetByUUIDName(uuid dvid.UUID, name dvid.InstanceName) (*Data, error)

GetByUUIDName returns a pointer to labelblk data given a UUID and data name.

func GetByVersionName Uses

func GetByVersionName(v dvid.VersionID, name dvid.InstanceName) (*Data, error)

GetByVersionName returns a pointer to labelblk data given a version and data name.

func NewData Uses

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) BlockSize Uses

func (d *Data) BlockSize() dvid.Point

func (*Data) CopyPropertiesFrom Uses

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 Uses

func (d *Data) CreateComposite(request datastore.Request, reply *datastore.Response) error

CreateComposite creates a new rgba8 image by combining hash of labels + the grayscale

func (*Data) CreateCompositeChunk Uses

func (d *Data) CreateCompositeChunk(chunk *storage.Chunk) error

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 Uses

func (d *Data) DescribeTKeyClass(tkc storage.TKeyClass) string

DescribeTKeyClass returns a string explanation of what a particular TKeyClass is used for. Implements the datastore.TKeyClassDescriber interface.

func (*Data) DoRPC Uses

func (d *Data) DoRPC(req datastore.Request, reply *datastore.Response) error

DoRPC acts as a switchboard for RPC commands.

func (*Data) Equals Uses

func (d *Data) Equals(d2 *Data) bool

func (*Data) Extents Uses

func (d *Data) Extents() *dvid.Extents

func (*Data) GetBlocks Uses

func (d *Data) GetBlocks(v dvid.VersionID, start dvid.ChunkPoint3d, span int) ([]Block, error)

GetBlocks returns any block data along a span in X

func (*Data) GetImage Uses

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 Uses

func (d *Data) GetLabelAtPoint(v dvid.VersionID, pt dvid.Point) (uint64, error)

GetLabelAtPoint returns the 64-bit unsigned int label for a given point.

func (*Data) GetLabelBytes Uses

func (d *Data) GetLabelBytes(v dvid.VersionID, bcoord dvid.ChunkPoint3d) ([]byte, error)

GetLabelBytes returns a slice of little-endian uint64 corresponding to the block coordinate.

func (*Data) GetLabelBytesAtPoint Uses

func (d *Data) GetLabelBytesAtPoint(v dvid.VersionID, pt dvid.Point) ([]byte, error)

GetLabelBytesAtPoint returns the 8 byte slice corresponding to a 64-bit label at a point.

func (*Data) GetLabels Uses

func (d *Data) GetLabels(v dvid.VersionID, vox *Labels, r *imageblk.ROI) error

GetLabels copies labels from the storage engine to Labels, a requested subvolume or 2d image.

func (*Data) GetSyncSubs Uses

func (d *Data) GetSyncSubs(synced dvid.Data) (datastore.SyncSubs, error)

GetSyncSubs implements the datastore.Syncer interface

func (*Data) GetVolume Uses

func (d *Data) GetVolume(v dvid.VersionID, vox *Labels, roiname dvid.InstanceName) ([]byte, error)

GetVolume retrieves a n-d volume from a version node given a geometry of labels.

func (*Data) GobDecode Uses

func (d *Data) GobDecode(b []byte) error

func (*Data) GobEncode Uses

func (d *Data) GobEncode() ([]byte, error)

func (*Data) InitDataHandlers Uses

func (d *Data) InitDataHandlers() error

InitDataHandlers launches goroutines to handle each labelblk instance's syncs.

func (*Data) MarshalJSON Uses

func (d *Data) MarshalJSON() ([]byte, error)

func (*Data) NewLabels Uses

func (d *Data) NewLabels(geom dvid.Geometry, img interface{}) (*Labels, error)

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 Uses

func (d *Data) PushData(p *datastore.PushSession) error

PushData pushes labelblk data to a remote DVID.

func (*Data) ReadChunk Uses

func (d *Data) ReadChunk(chunk *storage.Chunk) error

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 Uses

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 Uses

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 Uses

func (d *Data) SetResolution(uuid dvid.UUID, jsonBytes []byte) error

SetResolution loads JSON data giving Resolution.

func (*Data) Shutdown Uses

func (d *Data) Shutdown(wg *sync.WaitGroup)

Shutdown terminates blocks until syncs are done then terminates background goroutines processing data.

type Labels Uses

type Labels struct {
    *imageblk.Voxels
}

Labels are voxels that have uint64 labels.

func (*Labels) ComputeTransform Uses

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 Uses

func (l *Labels) Interpolable() bool

func (*Labels) String Uses

func (l *Labels) String() string

type Type Uses

type Type struct {
    imageblk.Type
}

Type uses imageblk data type by composition.

func (*Type) Help Uses

func (dtype *Type) Help() string

func (*Type) NewDataService Uses

func (dtype *Type) NewDataService(uuid dvid.UUID, id dvid.InstanceID, name dvid.InstanceName, c dvid.Config) (datastore.DataService, error)

Package labelblk imports 22 packages (graph) and is imported by 4 packages. Updated 2019-11-12. Refresh now. Tools for package owners.