Documentation ¶
Overview ¶
Package labelblk tailors the voxels data type for 64-bit labels and allows loading of NRGBA images (e.g., Raveler superpixel PNG images) that implicitly use slice Z as part of the label index.
Index ¶
- Constants
- Variables
- func BlockOnUpdating(uuid dvid.UUID, name dvid.InstanceName) error
- 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 RavelerSuperpixelBytes(slice, superpixel32 uint32) []byte
- func ZeroBytes() []byte
- type Bounds
- type Data
- func (d *Data) BlockSize() dvid.Point
- func (d *Data) CreateComposite(request datastore.Request, reply *datastore.Response) error
- func (d *Data) CreateCompositeChunk(chunk *storage.Chunk) error
- func (d *Data) DeleteBlocks(ctx *datastore.VersionedCtx, start dvid.ChunkPoint3d, span int) error
- 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) ([]byte, 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) GetLabelBlock(v dvid.VersionID, blockCoord 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(syncData dvid.Data) datastore.SyncSubs
- 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) MarshalJSON() ([]byte, error)
- func (d *Data) NewLabels(geom dvid.Geometry, img interface{}) (*Labels, error)
- func (d *Data) ReadChunk(chunk *storage.Chunk) error
- func (d *Data) Send(s rpc.Session, transmit rpc.Transmit, filter string, ...) error
- func (d *Data) SendBlocks(ctx *datastore.VersionedCtx, w http.ResponseWriter, start dvid.ChunkPoint3d, ...) error
- func (d *Data) ServeHTTP(uuid dvid.UUID, ctx *datastore.VersionedCtx, w http.ResponseWriter, ...)
- type LabelType
- type Labels
- type Type
Constants ¶
const ( Version = "0.1" RepoURL = "github.com/janelia-flyem/dvid/datatype/labelblk" TypeName = "labelblk" )
const HelpMessage = `` /* 16491-byte string literal not displayed */
Variables ¶
var ( DefaultBlockSize int32 = imageblk.DefaultBlockSize DefaultRes float32 = imageblk.DefaultRes DefaultUnits = imageblk.DefaultUnits )
Functions ¶
func BlockOnUpdating ¶ added in v0.7.1
func BlockOnUpdating(uuid dvid.UUID, name dvid.InstanceName) error
BlockOnUpdating blocks until the given data is not updating from syncs. This is primarily used during testing.
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.
func RavelerSuperpixelBytes ¶
RavelerSuperpixelBytes returns an encoded slice for Raveler (slice, superpixel) tuple. TODO -- Move Raveler-specific functions out of DVID.
Types ¶
type Data ¶
Data of labelblk type is an extended form of imageblk Data
func GetByVersion ¶
GetByVersion returns a pointer to labelblk data given a UUID 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) 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) DeleteBlocks ¶
func (d *Data) DeleteBlocks(ctx *datastore.VersionedCtx, start dvid.ChunkPoint3d, span int) error
func (*Data) GetBlocks ¶
GetBlocks returns a slice of bytes corresponding to all the blocks along a span in X
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) GetLabelBlock ¶ added in v0.8.0
GetLabelBlock returns a block of labels 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 ¶ added in v0.8.0
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) 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.
TODO : Unlike the standard imageblk.NewVoxels, the labelblk version can modify the labels based on the z-coordinate of the given geometry for Raveler labeling. This will be removed when Raveler-specific labels are moved outside 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) Send ¶
func (d *Data) Send(s rpc.Session, transmit rpc.Transmit, filter string, versions map[dvid.VersionID]struct{}) error
Send transfers all key-value pairs pertinent to this data type as well as the storage.DataStoreType for them.
func (*Data) SendBlocks ¶ added in v0.8.0
func (d *Data) SendBlocks(ctx *datastore.VersionedCtx, w http.ResponseWriter, start dvid.ChunkPoint3d, span int, compression string) error
GetBlocks returns a slice of bytes corresponding to all the blocks along a span in X
type LabelType ¶
type LabelType uint8
LabelType specifies how the 64-bit label is organized, allowing some bytes to encode particular attributes. For example, the "Raveler" LabelType includes the Z-axis coordinate.
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)