Documentation ¶
Overview ¶
Package labelsz supports ranking labels by # annotations of each type.
Index ¶
- Constants
- func NewTypeLabelTKey(i IndexType, label uint64) storage.TKey
- func NewTypeSizeLabelTKey(i IndexType, sz uint32, label uint64) storage.TKey
- type Data
- func (d *Data) DoRPC(request datastore.Request, reply *datastore.Response) error
- func (d *Data) Equals(d2 *Data) bool
- func (d *Data) GetCountElementType(ctx *datastore.VersionedCtx, label uint64, i IndexType) (uint32, error)
- func (d *Data) GetLabelsByThreshold(ctx *datastore.VersionedCtx, i IndexType, minSize uint32, offset, num int) (LabelSizes, error)
- func (d *Data) GetSyncSubs(synced dvid.Data) (datastore.SyncSubs, error)
- func (d *Data) GetSyncedAnnotation() *annotation.Data
- func (d *Data) GetTopElementType(ctx *datastore.VersionedCtx, n int, i IndexType) (LabelSizes, error)
- func (d *Data) GobDecode(b []byte) error
- func (d *Data) GobEncode() ([]byte, error)
- func (d *Data) Help() string
- func (d *Data) InitDataHandlers() error
- func (d *Data) MarshalJSON() ([]byte, error)
- func (d *Data) ReloadData(ctx *datastore.VersionedCtx)
- func (d *Data) ServeHTTP(uuid dvid.UUID, ctx *datastore.VersionedCtx, w http.ResponseWriter, ...)
- func (d *Data) Shutdown(wg *sync.WaitGroup)
- type IndexType
- type LabelSize
- type LabelSizes
- type Properties
- type Type
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
)
Variables ¶
This section is empty.
Functions ¶
func NewTypeLabelTKey ¶ added in v0.8.4
NewTypeLabelTKey returns a type-specific key for the (index type, 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
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) 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
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) InitDataHandlers ¶ added in v0.8.5
InitDataHandlers launches goroutines to handle each labelblk instance's syncs.
func (*Data) MarshalJSON ¶ added in v0.8.4
func (*Data) ReloadData ¶ added in v0.8.7
func (d *Data) ReloadData(ctx *datastore.VersionedCtx)
type IndexType ¶ added in v0.8.4
type IndexType uint8
IndexType gives the type of index.
func DecodeTypeLabelTKey ¶ added in v0.8.4
DecodeTypeLabelTKey decodes a type-specific key into a (index type, label) tuple.
func DecodeTypeSizeLabelTKey ¶ added in v0.8.4
DecodeTypeSizeLabelTKey decodes a type-specific key into a (index type, size, label) tuple.
func StringToIndexType ¶ added in v0.8.4
StringToIndexType converts a string to an IndexType
type LabelSize ¶ added in v0.8.4
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.