labelsz

package
v0.8.18 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2018 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Overview

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

Index

Constants

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

Variables

This section is empty.

Functions

func NewTypeLabelTKey added in v0.8.4

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

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

func NewTypeSizeLabelTKey added in v0.8.4

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

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

Types

type Data

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 added in v0.8.4

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

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

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

DoRPC acts as a switchboard for RPC commands.

func (*Data) Equals added in v0.8.4

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

func (*Data) GetCountElementType added in v0.8.5

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 added in v0.8.5

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 added in v0.8.0

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 added in v0.8.4

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

func (*Data) GetTopElementType added in v0.8.4

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 added in v0.8.4

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

func (*Data) GobEncode added in v0.8.4

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

func (*Data) Help

func (d *Data) Help() string

func (*Data) InitDataHandlers added in v0.8.5

func (d *Data) InitDataHandlers() error

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

func (*Data) MarshalJSON added in v0.8.4

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

func (*Data) ReloadData added in v0.8.7

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

func (*Data) ServeHTTP

func (d *Data) ServeHTTP(uuid dvid.UUID, ctx *datastore.VersionedCtx, w http.ResponseWriter, r *http.Request)

ServeHTTP handles all incoming HTTP requests for this data.

func (*Data) Shutdown added in v0.8.5

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

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

type IndexType added in v0.8.4

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 added in v0.8.4

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 added in v0.8.4

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 added in v0.8.4

func StringToIndexType(s string) IndexType

StringToIndexType converts a string to an IndexType

func (IndexType) String added in v0.8.4

func (i IndexType) String() string

type LabelSize added in v0.8.4

type LabelSize struct {
	Label uint64
	Size  uint32
}

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

type LabelSizes added in v0.8.4

type LabelSizes []LabelSize

LabelSizes is a sortable slice of LabelSize

func (LabelSizes) Len added in v0.8.4

func (s LabelSizes) Len() int

func (LabelSizes) Less added in v0.8.4

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

func (LabelSizes) Swap added in v0.8.4

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

type Properties added in v0.8.4

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

type Type struct {
	datastore.Type
}

func (*Type) Help

func (dtype *Type) Help() string

func (*Type) NewDataService

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL