annotation

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: 24 Imported by: 0

Documentation

Overview

Package annotation supports point annotation management and queries.

Index

Constants

View Source
const (
	Version  = "0.1"
	RepoURL  = "github.com/janelia-flyem/dvid/datatype/annotation"
	TypeName = "annotation"
)
View Source
const (
	FormatFlatBuffers formatType = iota
	FormatProtobuf3
	FormatJSON
)
View Source
const (
	ModifyElementsEvent = "ANNOTATION_MOD_ELEMENTS"
	SetElementsEvent    = "ANNOTATION_SET_ELEMENTS"
)

Annotation number change event identifiers.

Variables

View Source
var (
	DefaultBlockSize int32   = labelblk.DefaultBlockSize
	DefaultRes       float32 = labelblk.DefaultRes
	DefaultUnits             = labelblk.DefaultUnits
)

Functions

func DecodeBlockTKey

func DecodeBlockTKey(tk storage.TKey) (pt dvid.ChunkPoint3d, err error)

func DecodeLabelTKey

func DecodeLabelTKey(tk storage.TKey) (label uint64, err error)

func NewBlockTKey

func NewBlockTKey(pt dvid.ChunkPoint3d) storage.TKey

func NewLabelTKey

func NewLabelTKey(label uint64) storage.TKey

func NewTagTKey

func NewTagTKey(tag Tag) (storage.TKey, error)

NewTagTKey returns a TKey for a given tag.

Types

type Data

type Data struct {
	*datastore.Data
	Properties

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

	sync.RWMutex // For CAS ops.  TODO: Make more specific (e.g., point locks) for efficiency.
	// contains filtered or unexported fields
}

Data instance of labelvol, label sparse volumes.

func GetByDataUUID added in v0.8.4

func GetByDataUUID(dataUUID dvid.UUID) (*Data, error)

GetByDataUUID returns a pointer to annotation data given a data UUID.

func GetByUUIDName added in v0.8.3

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 annotation data.

func (*Data) DeleteElement

func (d *Data) DeleteElement(ctx *datastore.VersionedCtx, pt dvid.Point3d, kafkaOff bool) error

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

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

func (*Data) GetLabelJSON added in v0.8.4

func (d *Data) GetLabelJSON(ctx *datastore.VersionedCtx, label uint64, addRels bool) ([]byte, error)

GetLabelJSON returns JSON for synapse elements in a given label.

func (*Data) GetLabelSynapses

func (d *Data) GetLabelSynapses(ctx *datastore.VersionedCtx, label uint64) (Elements, error)

GetLabelSynapses returns synapse elements for a given label.

func (*Data) GetROISynapses added in v0.8.13

func (d *Data) GetROISynapses(ctx *datastore.VersionedCtx, roiSpec storage.FilterSpec) (Elements, error)

GetROISynapses returns synapse elements for a given ROI.

func (*Data) GetRegionSynapses

func (d *Data) GetRegionSynapses(ctx *datastore.VersionedCtx, ext *dvid.Extents3d) (Elements, error)

GetRegionSynapses returns synapse elements for a given subvolume of image space.

func (*Data) GetSyncSubs

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

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

func (*Data) GetSyncedLabelvol

func (d *Data) GetSyncedLabelvol() *labelvol.Data

func (*Data) GetTagJSON added in v0.8.4

func (d *Data) GetTagJSON(ctx *datastore.VersionedCtx, tag Tag, addRels bool) (jsonBytes []byte, err error)

GetTagJSON returns JSON for synapse elements in a given tag.

func (*Data) GobDecode

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

func (*Data) GobEncode

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

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

func (*Data) MoveElement

func (d *Data) MoveElement(ctx *datastore.VersionedCtx, from, to dvid.Point3d, kafkaOff bool) error

func (*Data) ProcessLabelAnnotations added in v0.8.7

func (d *Data) ProcessLabelAnnotations(v dvid.VersionID, f func(label uint64, elems ElementsNR)) error

ProcessLabelAnnotations will pass all annotations, label by label, to the given function.

func (*Data) ReloadData added in v0.8.6

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.

func (*Data) StoreSynapses

func (d *Data) StoreSynapses(ctx *datastore.VersionedCtx, r io.Reader, kafkaOff bool) error

StoreSynapses performs a synchronous store of synapses in JSON format, not returning until the data and its denormalizations are complete.

type DeltaModifyElements added in v0.8.4

type DeltaModifyElements struct {
	Add []ElementPos
	Del []ElementPos
}

DeltaModifyElements is a change in the elements assigned to a label. Need positions of elements because subscribers may have ROI filtering.

type DeltaSetElements added in v0.8.4

type DeltaSetElements struct {
	Set []ElementPos
}

DeltaSetElements is a replacement of elements assigned to a label.

type Element

type Element struct {
	ElementNR
	Rels Relationships
}

Element describes a synaptic element's properties, including Relationships.

func (Element) Copy

func (e Element) Copy() *Element

type ElementNR added in v0.8.4

type ElementNR struct {
	Pos  dvid.Point3d
	Kind ElementType
	Tags Tags              // Indexed
	Prop map[string]string // Non-Indexed
}

ElementNR describes a synaptic element's properties with No Relationships (NR), used for label and tag annotations while block-indexed annotations include the relationships.

func (ElementNR) Copy added in v0.8.5

func (e ElementNR) Copy() *ElementNR

func (ElementNR) String added in v0.8.18

func (e ElementNR) String() string

type ElementPos added in v0.8.4

type ElementPos struct {
	Label uint64
	Kind  ElementType
	Pos   dvid.Point3d
}

ElementPos describes the label and kind of an annotation, useful for synchronizing changes in data to other data types like labelsz.

type ElementType

type ElementType uint8

ElementType gives the type of a synaptic element.

const (
	UnknownElem ElementType = iota
	PostSyn                 // Post-synaptic element
	PreSyn                  // Pre-synaptic element
	Gap                     // Gap junction
	Note                    // A note or bookmark with some description
)

func StringToElementType added in v0.8.4

func StringToElementType(s string) ElementType

StringToElementType converts a string

func (ElementType) IsSynaptic added in v0.8.4

func (e ElementType) IsSynaptic() bool

IsSynaptic returns true if the ElementType is some synaptic component.

func (ElementType) MarshalJSON

func (e ElementType) MarshalJSON() ([]byte, error)

func (ElementType) String added in v0.8.4

func (e ElementType) String() string

func (*ElementType) UnmarshalJSON

func (e *ElementType) UnmarshalJSON(b []byte) error

type Elements

type Elements []Element

Elements is a slice of Element, which includes relationships.

func (Elements) Len

func (elems Elements) Len() int

func (Elements) Less

func (elems Elements) Less(i, j int) bool

Less returns true if element[i] < element[j] where ordering is determined by Pos and Kind in that order. Relationships and Tags are not considered in ordering.

func (Elements) Normalize

func (elems Elements) Normalize() Elements

Returns Elements that can be used for DeepEqual because all positions, relationships, and tags are sorted.

func (Elements) Swap

func (elems Elements) Swap(i, j int)

type ElementsNR added in v0.8.4

type ElementsNR []ElementNR

ElementsNR is a slice of elements without relationships.

func (ElementsNR) Len added in v0.8.4

func (elems ElementsNR) Len() int

func (ElementsNR) Less added in v0.8.4

func (elems ElementsNR) Less(i, j int) bool

Less returns true if element[i] < element[j] where ordering is determined by Pos and Kind in that order. Tags are not considered in ordering.

func (ElementsNR) Normalize added in v0.8.4

func (elems ElementsNR) Normalize() ElementsNR

Normalize returns ElementsNR that can be used for DeepEqual because all positions and tags are sorted.

func (ElementsNR) Swap added in v0.8.4

func (elems ElementsNR) Swap(i, j int)

type LabelElements

type LabelElements map[uint64]ElementsNR

type LabelPoints

type LabelPoints map[uint64][]dvid.Point3d

type Properties

type Properties struct {
}

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

type RelationType

type RelationType uint8
const (
	UnknownRel RelationType = iota
	PostSynTo
	PreSynTo
	ConvergentTo
	GroupedWith
)

func (RelationType) MarshalJSON

func (r RelationType) MarshalJSON() ([]byte, error)

func (*RelationType) UnmarshalJSON

func (r *RelationType) UnmarshalJSON(b []byte) error

type Relationship

type Relationship struct {
	Rel RelationType
	To  dvid.Point3d
}

Relationship is a link between two synaptic elements.

type Relationships

type Relationships []Relationship

func (Relationships) Len

func (r Relationships) Len() int

func (Relationships) Less

func (r Relationships) Less(i, j int) bool

func (Relationships) Swap

func (r Relationships) Swap(i, j int)

type Tag

type Tag string

Tag is a string description of a synaptic element grouping, e.g., "convergent".

func DecodeTagTKey

func DecodeTagTKey(tk storage.TKey) (Tag, error)

DecodeTagTKey returns the Tag corresponding to this type-specific key.

type Tags

type Tags []Tag

func (Tags) Len

func (t Tags) Len() int

func (Tags) Less

func (t Tags) Less(i, j int) bool

func (Tags) Swap

func (t Tags) Swap(i, j int)

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