Documentation ¶
Overview ¶
Package roi implements DVID support for Region-Of-Interest operations.
Index ¶
- Constants
- func Get(ctx *datastore.VersionedCtx) ([]byte, error)
- func GetSpans(ctx *datastore.VersionedCtx) ([]dvid.Span, error)
- func ParseFilterSpec(spec storage.FilterSpec) (name dvid.InstanceName, v dvid.VersionID, found bool, err error)
- func VoxelBoundsInside(e dvid.Extents3d, blocksize dvid.Point3d, spans []dvid.Span) (bool, error)
- type Data
- func (d *Data) CopyPropertiesFrom(src datastore.DataService, fs storage.FilterSpec) error
- func (d *Data) Delete(ctx storage.VersionedCtx) error
- func (d *Data) DoRPC(request datastore.Request, reply *datastore.Response) error
- func (d *Data) Equals(d2 *Data) bool
- func (d *Data) GetMask(ctx *datastore.VersionedCtx, subvol *dvid.Subvolume) ([]byte, error)
- func (d *Data) GetSpans(v dvid.VersionID) ([]dvid.Span, error)
- func (d *Data) GobDecode(b []byte) error
- func (d *Data) GobEncode() ([]byte, error)
- func (d *Data) Help() string
- func (d *Data) IsMutationRequest(action, endpoint string) bool
- func (d *Data) MarshalJSON() ([]byte, error)
- func (d *Data) Partition(ctx storage.Context, batchsize int32) ([]byte, error)
- func (d *Data) PointQuery(ctx *datastore.VersionedCtx, jsonBytes []byte) ([]byte, error)
- func (d *Data) PutJSON(v dvid.VersionID, jsonBytes []byte) error
- func (d *Data) PutSpans(versionID dvid.VersionID, spans []dvid.Span, init bool) error
- func (d *Data) ServeHTTP(uuid dvid.UUID, ctx *datastore.VersionedCtx, w http.ResponseWriter, ...)
- func (d *Data) SimplePartition(ctx storage.Context, batchsize int32) ([]byte, error)
- type Immutable
- type Iterator
- type Properties
- type Type
- type ZRange
Constants ¶
const ( Version = "0.1" RepoURL = "github.com/janelia-flyem/dvid/datatype/roi" TypeName = "roi" DefaultBlockSize = 32 )
const HelpMessage = `` /* 4613-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func Get ¶
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 ¶
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 ¶ added in v0.8.2
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".
Types ¶
type Data ¶
Data embeds the datastore's Data and extends it with keyvalue properties (none for now).
func DataByFilter ¶ added in v0.8.4
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 ¶ added in v0.8.2
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 ¶ added in v0.8.3
GetByUUIDName returns a pointer to ROI data given a version (UUID) and data name.
func (*Data) CopyPropertiesFrom ¶ added in v0.8.2
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) GetMask ¶
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 ¶ added in v0.8.2
GetSpans returns all (z, y, x0, x1) Spans in sorted order: z, then y, then x0.
func (*Data) IsMutationRequest ¶ added in v0.8.5
IsMutationRequest overrides the default behavior to specify POST /ptquery as an immutable request.
func (*Data) MarshalJSON ¶
func (*Data) Partition ¶
Partition returns JSON of differently sized subvolumes that attempt to distribute the number of active blocks per subvolume.
func (*Data) PointQuery ¶
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) PutSpans ¶
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.
type Immutable ¶ added in v0.8.4
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 ¶ added in v0.8.4
ImmutableBySpec returns an Immutable ROI (or nil if not available) given a name and uuid using string format "<roiname>,<uuid>"
type Iterator ¶
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 ¶
func NewIteratorBySpec ¶ added in v0.8.1
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 ¶
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().
type Properties ¶
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 ¶
Type embeds the datastore's Type to create a unique type for keyvalue functions.
func NewType ¶
func NewType() *Type
NewType returns a pointer to a new keyvalue Type with default values set.
func (*Type) NewDataService ¶
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.