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

package annotation

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

Package annotation supports point annotation management and queries.

Index

Package Files

annotation.go keys.go sync.go

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
)

func DecodeBlockTKey Uses

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

func DecodeLabelTKey Uses

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

func NewBlockTKey Uses

func NewBlockTKey(pt dvid.ChunkPoint3d) storage.TKey

func NewLabelTKey Uses

func NewLabelTKey(label uint64) storage.TKey

func NewTagTKey Uses

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

NewTagTKey returns a TKey for a given tag.

type Data Uses

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 Uses

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

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

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

func (*Data) DeleteElement Uses

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

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(req 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) GetLabelJSON Uses

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

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

GetROISynapses returns synapse elements for a given ROI.

func (*Data) GetRegionSynapses Uses

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 Uses

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 Uses

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

func (*Data) GetTagJSON Uses

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

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

func (*Data) ProcessLabelAnnotations Uses

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

func (d *Data) RecreateDenormalizations(ctx *datastore.VersionedCtx, inMemory, check bool)

RecreateDenormalizations will recreate label and tag denormalizations from the block-based elements.

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.

func (*Data) StoreElements Uses

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

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

func (*Data) StreamBlocks Uses

func (d *Data) StreamBlocks(ctx *datastore.VersionedCtx, w http.ResponseWriter, ext *dvid.Extents3d) error

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

type DeltaModifyElements Uses

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 Uses

type DeltaSetElements struct {
    Set []ElementPos
}

DeltaSetElements is a replacement of elements assigned to a label.

type Element Uses

type Element struct {
    ElementNR
    Rels Relationships
}

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

func (Element) Copy Uses

func (e Element) Copy() *Element

type ElementNR Uses

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 Uses

func (e ElementNR) Copy() *ElementNR

func (ElementNR) String Uses

func (e ElementNR) String() string

type ElementPos Uses

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 Uses

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 Uses

func StringToElementType(s string) ElementType

StringToElementType converts a string

func (ElementType) IsSynaptic Uses

func (e ElementType) IsSynaptic() bool

IsSynaptic returns true if the ElementType is some synaptic component.

func (ElementType) MarshalJSON Uses

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

func (ElementType) String Uses

func (e ElementType) String() string

func (*ElementType) UnmarshalJSON Uses

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

type Elements Uses

type Elements []Element

Elements is a slice of Element, which includes relationships.

func (Elements) Len Uses

func (elems Elements) Len() int

func (Elements) Less Uses

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 Uses

func (elems Elements) Normalize() Elements

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

func (Elements) Swap Uses

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

type ElementsNR Uses

type ElementsNR []ElementNR

ElementsNR is a slice of elements without relationships.

func (ElementsNR) Len Uses

func (elems ElementsNR) Len() int

func (ElementsNR) Less Uses

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 Uses

func (elems ElementsNR) Normalize() ElementsNR

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

func (ElementsNR) Swap Uses

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

type LabelElements Uses

type LabelElements map[uint64]ElementsNR

type LabelPoints Uses

type LabelPoints map[uint64][]dvid.Point3d

type Properties Uses

type Properties struct {
}

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

type RelationType Uses

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

func (RelationType) MarshalJSON Uses

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

func (*RelationType) UnmarshalJSON Uses

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

type Relationship Uses

type Relationship struct {
    Rel RelationType
    To  dvid.Point3d
}

Relationship is a link between two synaptic elements.

type Relationships Uses

type Relationships []Relationship

func (Relationships) Len Uses

func (r Relationships) Len() int

func (Relationships) Less Uses

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

func (Relationships) Swap Uses

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

type Tag Uses

type Tag string

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

func DecodeTagTKey Uses

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

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

type Tags Uses

type Tags []Tag

func (Tags) Changes Uses

func (t Tags) Changes(t2 Tags) (removed, added Tags)

Changes returns tags removed or added from the receiver.

func (Tags) Len Uses

func (t Tags) Len() int

func (Tags) Less Uses

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

func (Tags) Removed Uses

func (t Tags) Removed(t2 Tags) Tags

Removed returns tags removed from the receiver.

func (Tags) Swap Uses

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

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 annotation imports 26 packages (graph) and is imported by 2 packages. Updated 2019-09-23. Refresh now. Tools for package owners.