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

package roi

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

Package roi implements DVID support for Region-Of-Interest operations.

Index

Package Files

iterator.go roi.go

Constants

const (
    Version  = "0.1"
    RepoURL  = "github.com/janelia-flyem/dvid/datatype/roi"
    TypeName = "roi"

    DefaultBlockSize = 32
)
const HelpMessage = "" /* 4615 byte string literal not displayed */

func Get Uses

func Get(ctx *datastore.VersionedCtx) ([]byte, error)

Get returns a JSON-encoded byte slice of the ROI in the form of 4-Spans, where each Span is [z, y, xstart, xend]

func GetSpans Uses

func GetSpans(ctx *datastore.VersionedCtx) ([]dvid.Span, error)

GetSpans returns all (z, y, x0, x1) Spans in sorted order: z, then y, then x0.

func ParseFilterSpec Uses

func ParseFilterSpec(spec storage.FilterSpec) (name dvid.InstanceName, v dvid.VersionID, found bool, err error)

ParseFilterSpec returns the specified ROI instance name and version within a FilterSpec. Currently, only one ROI can be specified in a FilterSpec. Multiple ROIs should use a different FilterSpec like "intersect" instead of "roi".

func VoxelBoundsInside Uses

func VoxelBoundsInside(e dvid.Extents3d, blocksize dvid.Point3d, spans []dvid.Span) (bool, error)

VoxelBoundsInside returns true if the given voxel extents intersects the spans.

type Data Uses

type Data struct {
    *datastore.Data
    datastore.Updater
    Properties

    sync.RWMutex
}

Data embeds the datastore's Data and extends it with keyvalue properties (none for now).

func DataByFilter Uses

func DataByFilter(spec storage.FilterSpec) (d *Data, v dvid.VersionID, found bool, err error)

DataByFilter returns a ROI Data based on a string specification of the form "roi:<roiname>,<uuid>". If the given string is not parsable, the "found" return value is false.

func DataBySpec Uses

func DataBySpec(spec string) (d *Data, v dvid.VersionID, found bool, err error)

DataBySpec returns a ROI Data based on a string specification of the form "<roiname>,<uuid>". If the given string is not parsable, the "found" return value is false.

func GetByUUIDName Uses

func GetByUUIDName(uuid dvid.UUID, name dvid.InstanceName) (*Data, error)

GetByUUIDName returns a pointer to ROI data given a version (UUID) and data name.

func (*Data) CopyPropertiesFrom Uses

func (d *Data) CopyPropertiesFrom(src datastore.DataService, fs storage.FilterSpec) error

CopyPropertiesFrom copies the data instance-specific properties from a given data instance into the receiver's properties. Fulfills the datastore.PropertyCopier interface.

func (*Data) Delete Uses

func (d *Data) Delete(ctx storage.VersionedCtx) error

Delete removes an ROI.

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(request 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

Equals returns false if any version of the ROI is different

func (*Data) GetMask Uses

func (d *Data) GetMask(ctx *datastore.VersionedCtx, subvol *dvid.Subvolume) ([]byte, error)

GetMask returns a binary volume of subvol size where each element is 1 if inside the ROI and 0 if outside the ROI.

func (*Data) GetSpans Uses

func (d *Data) GetSpans(v dvid.VersionID) ([]dvid.Span, error)

GetSpans returns all (z, y, x0, x1) Spans in sorted order: z, then y, then x0.

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

func (d *Data) IsMutationRequest(action, endpoint string) bool

IsMutationRequest overrides the default behavior to specify POST /ptquery as an immutable request.

func (*Data) MarshalJSON Uses

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

func (*Data) Partition Uses

func (d *Data) Partition(ctx storage.Context, batchsize int32) ([]byte, error)

Partition returns JSON of differently sized subvolumes that attempt to distribute the number of active blocks per subvolume.

func (*Data) PointQuery Uses

func (d *Data) PointQuery(ctx *datastore.VersionedCtx, jsonBytes []byte) ([]byte, error)

PointQuery checks if a JSON-encoded list of voxel points are within an ROI. It returns a JSON list of bools, each corresponding to the original list of points.

func (*Data) PutJSON Uses

func (d *Data) PutJSON(v dvid.VersionID, jsonBytes []byte) error

PutJSON saves JSON-encoded data representing an ROI into the datastore.

func (*Data) PutSpans Uses

func (d *Data) PutSpans(versionID dvid.VersionID, spans []dvid.Span, init bool) error

PutSpans saves a slice of spans representing an ROI into the datastore. If the init parameter is true, all previous spans of this ROI are deleted before writing these spans.

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

func (d *Data) SimplePartition(ctx storage.Context, batchsize int32) ([]byte, error)

SimplePartition returns JSON of identically sized subvolumes arranged over ROI

type Immutable Uses

type Immutable struct {
    // contains filtered or unexported fields
}

Immutable is an ROI fixed to a particular version that you can check voxel coordinates against.

func ImmutableBySpec Uses

func ImmutableBySpec(spec string) (*Immutable, error)

ImmutableBySpec returns an Immutable ROI (or nil if not available) given a name and uuid using string format "<roiname>,<uuid>"

func (Immutable) VoxelWithin Uses

func (i Immutable) VoxelWithin(p dvid.Point3d) bool

type Iterator Uses

type Iterator struct {
    // contains filtered or unexported fields
}

Iterator is optimized for detecting whether given keys are within an ROI. It exploits the key, and in particular IndexZYX, ordering so that checks across a volume can be done quickly.

func NewIterator Uses

func NewIterator(roiName dvid.InstanceName, versionID dvid.VersionID, b dvid.Bounder) (*Iterator, error)

func NewIteratorBySpec Uses

func NewIteratorBySpec(spec storage.FilterSpec, b dvid.Bounder) (it *Iterator, v dvid.VersionID, found bool, err error)

NewIteratorBySpec returns a ROI iterator based on a string specification of the form "roi:<roiname>,<uuid>" where the ROI instance name and uniquely identifying string form of uuid are given. If the given string is not parsable, the "found" return value is false.

func (*Iterator) InsideFast Uses

func (it *Iterator) InsideFast(indexZYX dvid.IndexZYX) bool

Returns true if the index is inside the ROI volume. Note that this optimized function maintains state and is not concurrency safe; it assumes sequential calls where the considered indexZYX is increasing in Z, Y, and X after either NewIterator() or Reset().

func (*Iterator) Reset Uses

func (it *Iterator) Reset()

type Properties Uses

type Properties struct {
    BlockSize dvid.Point3d

    // Minimum Block Coord Z for ROI
    MinZ int32

    // Maximum Block Coord Z for ROI
    MaxZ int32
}

Properties are additional properties for keyvalue data instances beyond those in standard datastore.Data. These will be persisted to metadata storage.

type Type Uses

type Type struct {
    datastore.Type
}

Type embeds the datastore's Type to create a unique type for keyvalue functions.

func NewType Uses

func NewType() *Type

NewType returns a pointer to a new keyvalue Type with default values set.

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)

NewData returns a pointer to new ROI data with default values.

type ZRange Uses

type ZRange struct {
    MinZ, MaxZ int32
}

Package roi imports 17 packages (graph) and is imported by 10 packages. Updated 2019-01-08. Refresh now. Tools for package owners.