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

package labelsz

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

Package labelsz supports ranking labels by # annotations of each type.

Index

Package Files

keys.go labelsz.go sync.go

Constants

const (
    Version  = "0.1"
    RepoURL  = "github.com/janelia-flyem/dvid/datatype/labelsz"
    TypeName = "labelsz"
)
const (
    MaxLabelsReturned = 10000 // Maximum number of labels returned in JSON
)

func NewTypeLabelTKey Uses

func NewTypeLabelTKey(i IndexType, label uint64) storage.TKey

NewTypeLabelTKey returns a type-specific key for the (index type, label) tuple.

func NewTypeSizeLabelTKey Uses

func NewTypeSizeLabelTKey(i IndexType, sz uint32, label uint64) storage.TKey

NewTypeSizeLabelTKey returns a type-specific key for the (index type, size, label) tuple.

type Data Uses

type Data struct {
    *datastore.Data
    Properties

    // Keep track of sync operations that could be updating the data.
    datastore.Updater

    sync.RWMutex
    // contains filtered or unexported fields
}

Data instance of labelvol, label sparse volumes.

func GetByUUIDName Uses

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

GetByUUIDName returns a pointer to annotation data given a version (UUID) 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 labelsz data.

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(request 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) GetCountElementType Uses

func (d *Data) GetCountElementType(ctx *datastore.VersionedCtx, label uint64, i IndexType) (uint32, error)

GetCountElementType returns a count of the given ElementType for a given label.

func (*Data) GetLabelsByThreshold Uses

func (d *Data) GetLabelsByThreshold(ctx *datastore.VersionedCtx, i IndexType, minSize uint32, offset, num int) (LabelSizes, error)

GetLabelsByThreshold returns a sorted list of labels that meet the given minSize threshold. We allow a maximum of MaxLabelsReturned returned labels and start with rank "offset".

func (*Data) GetSyncSubs Uses

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

GetSyncSubs implements the datastore.Syncer interface. Returns a list of subscriptions to the sync data instance that will notify the receiver.

func (*Data) GetSyncedAnnotation Uses

func (d *Data) GetSyncedAnnotation() *annotation.Data

func (*Data) GetTopElementType Uses

func (d *Data) GetTopElementType(ctx *datastore.VersionedCtx, n int, i IndexType) (LabelSizes, error)

GetTopElementType returns a sorted list of the top N labels that have the given ElementType.

func (*Data) GobDecode Uses

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

func (*Data) GobEncode Uses

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

func (*Data) Help Uses

func (d *Data) Help() string

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

func (d *Data) ReloadData(ctx *datastore.VersionedCtx)

func (*Data) SendCountsByElementType Uses

func (d *Data) SendCountsByElementType(w http.ResponseWriter, ctx *datastore.VersionedCtx, labels []uint64, idxType IndexType) error

SendCountsByElementType writes the counts for given index type for a list of labels

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

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

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

type IndexType Uses

type IndexType uint8

IndexType gives the type of index.

const (
    UnknownIndex IndexType = iota
    PostSyn                // Post-synaptic element
    PreSyn                 // Pre-synaptic element
    Gap                    // Gap junction
    Note                   // A note or bookmark with some description
    AllSyn                 // PostSyn, PreSyn, or Gap
    Voxels                 // Number of voxels
)

func DecodeTypeLabelTKey Uses

func DecodeTypeLabelTKey(tk storage.TKey) (i IndexType, label uint64, err error)

DecodeTypeLabelTKey decodes a type-specific key into a (index type, label) tuple.

func DecodeTypeSizeLabelTKey Uses

func DecodeTypeSizeLabelTKey(tk storage.TKey) (i IndexType, sz uint32, label uint64, err error)

DecodeTypeSizeLabelTKey decodes a type-specific key into a (index type, size, label) tuple.

func StringToIndexType Uses

func StringToIndexType(s string) IndexType

StringToIndexType converts a string to an IndexType

func (IndexType) String Uses

func (i IndexType) String() string

type LabelSize Uses

type LabelSize struct {
    Label uint64
    Size  uint32
}

LabelSize is the count for a given label for some metric like # of PreSyn annotations.

type LabelSizes Uses

type LabelSizes []LabelSize

LabelSizes is a sortable slice of LabelSize

func (LabelSizes) Len Uses

func (s LabelSizes) Len() int

func (LabelSizes) Less Uses

func (s LabelSizes) Less(i, j int) bool

func (LabelSizes) Swap Uses

func (s LabelSizes) Swap(i, j int)

type Properties Uses

type Properties struct {
    // StaticROI is an optional static ROI specification of the form "<roiname>,<uuid>"
    // Note that it *cannot* mutate after the labelsz instance is created.
    StaticROI string
}

Properties are additional properties for data beyond those in standard datastore.Data.

type Type Uses

type Type struct {
    datastore.Type
}

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 labelsz imports 20 packages (graph). Updated 2019-08-22. Refresh now. Tools for package owners.