Version: v0.0.0-...-e545f54 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2014 License: BSD-3-Clause Imports: 19 Imported by: 0



Package labels64 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.



View Source
const (
	Version = "0.1"
	RepoUrl = ""
View Source
const HelpMessage = `` /* 8077-byte string literal not displayed */


This section is empty.


func RavelerSuperpixelBytes

func RavelerSuperpixelBytes(slice, superpixel32 uint32) []byte


type Data

type Data struct {
	Labeling LabelType
	Ready    bool

Data of labels64 type just uses voxels.Data.

func GetByLocalID

func GetByLocalID(id dvid.DatasetLocalID, name dvid.DataString) (*Data, error)

GetByLocalID returns a pointer to labels64 data given a local dataset ID and data name.

func GetByUUID

func GetByUUID(uuid dvid.UUID, name dvid.DataString) (*Data, error)

GetByUUID returns a pointer to labels64 data given a version (UUID) and data name.

func NewData

func NewData(id *datastore.DataID, config dvid.Config) (*Data, error)

NewData returns a pointer to labels64 data.

func (*Data) CreateComposite

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

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

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) DenormalizeChunk

func (d *Data) DenormalizeChunk(chunk *storage.Chunk)

DenormalizeChunk processes 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) DoHTTP

func (d *Data) DoHTTP(uuid dvid.UUID, w http.ResponseWriter, r *http.Request) error

DoHTTP handles all incoming HTTP requests for this data.

func (*Data) DoRPC

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

DoRPC acts as a switchboard for RPC commands.

func (*Data) GetLabelAtPoint

func (d *Data) GetLabelAtPoint(uuid dvid.UUID, pt dvid.Point) (uint64, error)

GetLabelAtPoint returns a mapped label for a given point.

func (*Data) GetSparseVol

func (d *Data) GetSparseVol(uuid dvid.UUID, label uint64) ([]byte, error)

GetSparseVol returns an encoded sparse volume given a label. The encoding has the following format where integers are little endian:

   byte     Payload descriptor:
              Bit 0 (LSB) - 8-bit grayscale
              Bit 1 - 16-bit grayscale
              Bit 2 - 16-bit normal
   uint8    Number of dimensions
   uint8    Dimension of run (typically 0 = X)
   byte     Reserved (to be used later)
   uint32    # Voxels
   uint32    # Spans
   Repeating unit of:
       int32   Coordinate of run start (dimension 0)
       int32   Coordinate of run start (dimension 1)
       int32   Coordinate of run start (dimension 2)
       int32   Length of run
       bytes   Optional payload dependent on first byte descriptor

func (*Data) GetSurface

func (d *Data) GetSurface(uuid dvid.UUID, label uint64) (s []byte, found bool, err error)

GetSurface returns a gzipped byte array with # voxels and float32 arrays for vertices and normals.

func (*Data) JSONString

func (d *Data) JSONString() (string, error)

JSONString returns the JSON for this Data's configuration

func (*Data) NewExtHandler

func (d *Data) NewExtHandler(geom dvid.Geometry, img interface{}) (voxels.ExtHandler, error)

NewExtHandler returns a labels64 ExtHandler given some geometry and optional image data. If img is passed in, the function will initialize the ExtHandler with data from the image. Otherwise, it will allocate a zero buffer of appropriate size. Unlike the standard voxels NewExtHandler, the labels64 version will modify the labels based on the z-coordinate of the given geometry.

func (*Data) ProcessSpatially

func (d *Data) ProcessSpatially(uuid dvid.UUID)

Iterate through all blocks in the associated label volume, computing the spatial indices for bodies and the mappings for each spatial index.

type Datatype

type Datatype struct {

Datatype just uses voxels data type by composition.

func (*Datatype) Help

func (dtype *Datatype) Help() string

func (*Datatype) NewDataService

func (dtype *Datatype) NewDataService(id *datastore.DataID, config dvid.Config) (datastore.DataService, error)

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.

const (
	Standard64bit LabelType = iota

	// RavelerLabel uses the Z offset as the higher-order 4 bytes and the
	// superpixel label as the lower 4 bytes.

func (LabelType) String

func (lt LabelType) String() string

type Labels

type Labels struct {

Labels is an image volume that fulfills the voxels.ExtHandler interface.

func (*Labels) Interpolable

func (l *Labels) Interpolable() bool

func (*Labels) String

func (l *Labels) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL