Documentation
¶
Overview ¶
Package annotation supports point annotation management and queries.
Index ¶
- Constants
- Variables
- func DecodeBlockTKey(tk storage.TKey) (pt dvid.ChunkPoint3d, err error)
- func DecodeLabelTKey(tk storage.TKey) (label uint64, err error)
- func NewBlockTKey(pt dvid.ChunkPoint3d) storage.TKey
- func NewLabelTKey(label uint64) storage.TKey
- func NewTagTKey(tag Tag) (storage.TKey, error)
- type Data
- func (d *Data) DeleteElement(ctx *datastore.VersionedCtx, pt dvid.Point3d, kafkaOff bool) error
- func (d *Data) DoRPC(request datastore.Request, reply *datastore.Response) error
- func (d *Data) Equals(d2 *Data) bool
- func (d *Data) GetLabelJSON(ctx *datastore.VersionedCtx, label uint64, addRels bool) ([]byte, error)
- func (d *Data) GetLabelSynapses(ctx *datastore.VersionedCtx, label uint64) (Elements, error)
- func (d *Data) GetROISynapses(ctx *datastore.VersionedCtx, roiSpec storage.FilterSpec) (Elements, error)
- func (d *Data) GetRegionSynapses(ctx *datastore.VersionedCtx, ext *dvid.Extents3d) (Elements, error)
- func (d *Data) GetSyncSubs(synced dvid.Data) (subs datastore.SyncSubs, err error)
- func (d *Data) GetSyncedLabelvol() *labelvol.Data
- func (d *Data) GetTagJSON(ctx *datastore.VersionedCtx, tag Tag, addRels bool) (jsonBytes []byte, err 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) MoveElement(ctx *datastore.VersionedCtx, from, to dvid.Point3d, kafkaOff bool) error
- func (d *Data) ProcessLabelAnnotations(v dvid.VersionID, f func(label uint64, elems ElementsNR)) 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)
- func (d *Data) StoreSynapses(ctx *datastore.VersionedCtx, r io.Reader, kafkaOff bool) error
- type DeltaModifyElements
- type DeltaSetElements
- type Element
- type ElementNR
- type ElementPos
- type ElementType
- type Elements
- type ElementsNR
- type LabelElements
- type LabelPoints
- type Properties
- type RelationType
- type Relationship
- type Relationships
- type Tag
- type Tags
- type Type
Constants ¶
const ( Version = "0.1" RepoURL = "github.com/janelia-flyem/dvid/datatype/annotation" TypeName = "annotation" )
const ( FormatFlatBuffers formatType = iota FormatProtobuf3 FormatJSON )
const ( ModifyElementsEvent = "ANNOTATION_MOD_ELEMENTS" SetElementsEvent = "ANNOTATION_SET_ELEMENTS" )
Annotation number change event identifiers.
Variables ¶
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 NewBlockTKey ¶
func NewBlockTKey(pt dvid.ChunkPoint3d) storage.TKey
func NewLabelTKey ¶
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
GetByDataUUID returns a pointer to annotation data given a data UUID.
func GetByUUIDName ¶ added in v0.8.3
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 (*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 ¶
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 ¶
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 (*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) InitDataHandlers ¶ added in v0.8.5
InitDataHandlers launches goroutines to handle each labelblk instance's syncs.
func (*Data) MarshalJSON ¶
func (*Data) MoveElement ¶
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
Shutdown terminates blocks until syncs are done then terminates background goroutines processing data.
func (*Data) StoreSynapses ¶
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.
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.
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) Less ¶
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.
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 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".