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

package dvid

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

Package dvid provides types, constants, and functions that have no other dependencies and can be used by all packages within DVID. This includes core data structures, command string handling, and command packaging. Since these elements are used at multiple DVID layers, we separate them here and allow reuse in layer-specific types through embedding.

Index

Package Files

command.go data.go datavalues.go distributed.go doc.go email.go geometry.go graph.go image.go index.go log.go log_local.go point.go serialize.go storage.go system.go ttffont.go utils.go volumes.go

Constants

const (
    LocalIDSize   = 2
    LocalID32Size = 4

    MaxLocalID   = 0xFFFF
    MaxLocalID32 = 0xFFFFFFFF
)
const (
    MaxInstanceID = MaxLocalID32
    MaxRepoID     = MaxLocalID32
    MaxVersionID  = MaxLocalID32
    MaxClientID   = MaxLocalID32

    InstanceIDSize = 4
    RepoIDSize     = 4
    VersionIDSize  = 4
    ClientIDSize   = 4
)
const (
    NoCompression      CompressionLevel = 0
    BestSpeed                           = 1
    BestCompression                     = 9
    DefaultCompression                  = -1
)
const (
    Uncompressed CompressionFormat = 0
    Snappy                         = 1
    Gzip                           = 2 // Gzip stores length and checksum automatically.
    LZ4                            = 4
    JPEG                           = 5
)
const (
    Kilo = 1 << 10
    Mega = 1 << 20
    Giga = 1 << 30
    Tera = 1 << 40
)
const (
    // EncodingBinary denotes no payload bytes since binary sparse volume is
    // defined by just start and run length.
    EncodingBinary byte = 0x00

    // EncodingGrayscale8 denotes an 8-bit grayscale payload.
    EncodingGrayscale8 = 0x01

    // EncodingGrayscale16 denotes a 16-bit grayscale payload.
    EncodingGrayscale16 = 0x02

    // EncodingNormal16 denotes 16-bit encoded normals.
    EncodingNormal16 = 0x04
)

Sparse Volume binary encoding payload descriptors.

const BitsOfInt = 32 << (^uint(0) >> 63)

BitsOfInt is the number of bits used for an int

const ChunkPoint2dSize = 8
const ChunkPoint3dSize = 12
const CoordinateBits = 32
const DataShapeBytes = 7
const DefaultJPEGQuality = 80

DefaultJPEGQuality is the quality of images returned if requesting JPEG images and an explicit Quality amount is omitted.

const IndexZYXSize = ChunkPoint3dSize
const (
    MaxNumberConcurrentCgo = 10000
)
const NilUUID = UUID("")
const VertexIDSize = 8

Variables

var (
    // XY describes a 2d rectangle of voxels that share a z-coord.
    XY  = DataShape{3, []uint8{0, 1}}

    // XZ describes a 2d rectangle of voxels that share a y-coord.
    XZ  = DataShape{3, []uint8{0, 2}}

    // YZ describes a 2d rectangle of voxels that share a x-coord.
    YZ  = DataShape{3, []uint8{1, 2}}

    // Arb describes a 2d rectangle of voxels with arbitrary 3d orientation.
    Arb = DataShape{3, nil}

    // Vol3d describes a 3d volume of voxels
    Vol3d = DataShape{3, []uint8{0, 1, 2}}
)
var (
    MaxIndexZYX = IndexZYX(MaxChunkPoint3d)
    MinIndexZYX = IndexZYX(MinChunkPoint3d)
)
var (
    MaxPoint3d = Point3d{math.MaxInt32, math.MaxInt32, math.MaxInt32}
    MinPoint3d = Point3d{math.MinInt32, math.MinInt32, math.MinInt32}
)
var (
    MaxChunkPoint2d = ChunkPoint2d{math.MaxInt32, math.MaxInt32}
    MinChunkPoint2d = ChunkPoint2d{math.MinInt32, math.MinInt32}
)
var (
    MaxChunkPoint3d = ChunkPoint3d{math.MaxInt32, math.MaxInt32, math.MaxInt32}
    MinChunkPoint3d = ChunkPoint3d{math.MinInt32, math.MinInt32, math.MinInt32}
)
var DefaultChecksum = NoChecksum

DefaultChecksum is the type of checksum employed for all data operations. Note that many database engines already implement some form of corruption test and checksum can be set on each datatype instance.

var (
    Font *truetype.Font
)
var (
    // NumCPU is the number of cores available to this DVID server.
    NumCPU int
)

func AliasByteToUint16 Uses

func AliasByteToUint16(b []byte) ([]uint16, error)

AliasByteToUint16 returns a uint16 slice that reuses the passed byte slice. NOTE: The passed byte slice must be aligned for uint16.

func AliasByteToUint32 Uses

func AliasByteToUint32(b []byte) ([]uint32, error)

AliasByteToUint32 returns a uint32 slice that reuses the passed byte slice. NOTE: The passed byte slice must be aligned for uint32.

func AliasByteToUint64 Uses

func AliasByteToUint64(b []byte) (out []uint64, err error)

AliasByteToUint64 returns a uint64 slice that reuses the passed byte slice. NOTE: The passed byte slice must be aligned for uint64. Use New8ByteAlignBytes() to allocate for guarantee.

func AliasUint16ToByte Uses

func AliasUint16ToByte(in []uint16) []byte

AliasUint16ToByte returns the underlying byte slice for a uint16 slice.

func AliasUint32ToByte Uses

func AliasUint32ToByte(in []uint32) []byte

AliasUint32ToByte returns the underlying byte slice for a uint32 slice.

func AliasUint64ToByte Uses

func AliasUint64ToByte(in []uint64) []byte

AliasUint64ToByte returns the underlying byte slice for a uint64 slice.

func AllowRequests Uses

func AllowRequests()

AllowRequests sets dvid to process requests

func BlockAligned Uses

func BlockAligned(geom Bounder, blockSize Point) bool

BlockAligned returns true if the bounds for a n-d volume are aligned to blocks of the given size. Alignment requires that the start point is the first voxel in a block and the end point is the last voxel in a block.

func BlockOnActiveCgo Uses

func BlockOnActiveCgo()

BlockOnActiveCgo will block until all active cgo routines have been finished or queued for starting. This requires cgo routines to be bracketed by:

dvid.StartCgo()
/* Some cgo code */
dvid.StopCgo()

func ByteToUint64 Uses

func ByteToUint64(b []byte) (out []uint64, err error)

ByteToUint64 copies a properly aligned byte slice into a []uint64.

func ConvertToAbsolute Uses

func ConvertToAbsolute(relativePath string, anchorDir string) (string, error)

Converts the given (possibly) relative path into an absolute path, relative to the given anchor directory, not the current working directory. If the given relativePath is already an absolute path, it is returned unchanged.

func Criticalf Uses

func Criticalf(format string, args ...interface{})

func DataFromPost Uses

func DataFromPost(r *http.Request, key string) ([]byte, error)

DataFromPost returns data submitted in the given key of a POST request.

func DataTypeBytes Uses

func DataTypeBytes(t DataType) int32

DataTypeBytes returns the # of bytes for a given type string. For example, "uint16" is 2 bytes. No error checking is performed to make sure string is valid.

func Debugf Uses

func Debugf(format string, args ...interface{})

func DecodeSerializationFormat Uses

func DecodeSerializationFormat(s SerializationFormat) (CompressionFormat, Checksum)

func DenyRequests Uses

func DenyRequests()

DenyRequests sets dvid to ignore requests

func Deserialize Uses

func Deserialize(s []byte, object interface{}) error

Deserialize a Go object using Gob encoding

func EmptyValue Uses

func EmptyValue() []byte

func Errorf Uses

func Errorf(format string, args ...interface{})

func EstimateGoroutines Uses

func EstimateGoroutines(percentCPUs float64, goroutineMB int32) int

EstimateGoroutines returns the # of goroutines that can be launched given a percentage (up to 1.0) of available CPUs (set by command line option or # cores) and/or the megabytes (MB) of memory needed for each goroutine. A minimum of 1 goroutine is returned. TODO: Actually use the required memory provided in argument. For now,

only returns percentage of maximum # of cores.

func GetNumBlocks Uses

func GetNumBlocks(geom Geometry, blockSize Point) int

GetNumBlocks returns the number of n-d blocks necessary to cover the given geometry.

func GoImageFromData Uses

func GoImageFromData(data []byte, nx, ny int) (image.Image, error)

GoImageFromData returns a go Image given pixel data.

func GoImageFromFile Uses

func GoImageFromFile(filename string) (image.Image, string, error)

GoImageFromFile returns an image and its format name given a file name.

func ImageData Uses

func ImageData(img image.Image) (data []uint8, bytesPerPixel, stride int32, err error)

ImageData returns the underlying pixel data for an image or an error if the image doesn't have the requisite []uint8 pixel data.

func ImageGrayFromData Uses

func ImageGrayFromData(data []uint8, nx, ny int) (img *image.Gray)

ImageGrayFromData returns a Gray image given data and image size.

func ImageNRGBA64FromData Uses

func ImageNRGBA64FromData(data []byte, nx, ny int) (img *image.NRGBA64)

ImageNRGBA64FromData returns a NRGBA64 image given 64-bit data and image size.

func Infof Uses

func Infof(format string, args ...interface{})

func ListDataShapes Uses

func ListDataShapes() (shapes []string)

ListDataShapes returns a slice of shape names

func LogImmediately Uses

func LogImmediately(s string)

LogImmediately writes a message to the log file immediately, bypassing any queue of log messages.

func MakeGzipHandler Uses

func MakeGzipHandler(fn http.HandlerFunc) http.HandlerFunc

func MaxInt32 Uses

func MaxInt32(a, b int32) int32

func MinInt32 Uses

func MinInt32(a, b int32) int32

func New8ByteAlignBytes Uses

func New8ByteAlignBytes(numBytes uint32) ([]byte, []uint64)

New8ByteAlignBytes returns a byte slice that has an 8 byte alignment guarantee based on the Go compiler spec. The source []uint64 must be preserved until the byte slice is no longer needed.

func NumberActiveCGo Uses

func NumberActiveCGo() int

NumberActiveCGo returns the number of active CGo routines, typically involved with database operations.

func PendingLogMessages Uses

func PendingLogMessages() int

PendingLogMessages returns the number of log messages that are in queue to be written.

func PlaceholderImage Uses

func PlaceholderImage(shape DataShape, imageSize Point, message string) (image.Image, error)

PlaceholderImage returns an solid image with a message and text describing the shape.

func PrintNonZero Uses

func PrintNonZero(message string, value []byte)

PrintNonZero prints the number of non-zero bytes in a slice of bytes.

func RandomBytes Uses

func RandomBytes(numBytes int32) []byte

RandomBytes returns a slices of random bytes.

func ReadJSONFile Uses

func ReadJSONFile(filename string) (value map[string]interface{}, err error)

ReadJSONFile returns a map[string]interface{} with decoded JSON from a file. If a file is not organized as a JSON object, an error will be returned.

func ReportPanic Uses

func ReportPanic(msg, sendingServer string)

ReportPanic prints the message and stack trace to stderr, the log, and via email if an email notifier was setup.

func RequestsOK Uses

func RequestsOK() bool

RequestsOK returns true if dvid should respond to requests

func SendEmail Uses

func SendEmail(subject, message string, recipients []string, periodicTopic string) error

SendEmail sends e-mail to the given recipients or the default emails loaded during configuration. If a "periodicTopic" is set, then only one email per ten minutes is sent for that particular topic.

func SendHTTP Uses

func SendHTTP(w http.ResponseWriter, r *http.Request, name string, data []byte)

SendHTTP sends data after setting an appropriate Content-Type by examining the name and also some byte sniffing.

func Serialize Uses

func Serialize(object interface{}, compress Compression, checksum Checksum) ([]byte, error)

Serialize an arbitrary Go object using Gob encoding and optional compression, checksum. If your object is []byte, you should preferentially use SerializeData since the Gob encoding process adds some overhead in performance as well as size of wire format to describe the transmitted types.

func SerializeData Uses

func SerializeData(data []byte, compress Compression, checksum Checksum) ([]byte, error)

SerializeData serializes a slice of bytes using optional compression, checksum. Checksum will be ignored if the underlying compression already employs checksums, e.g., Gzip.

func SerializePrecompressedData Uses

func SerializePrecompressedData(data []byte, compress Compression, checksum Checksum) ([]byte, error)

SerializePrecompressedData serializes a slice of bytes that have already been compressed and adds DVID serialization for discerning optional compression and checksum. Checksum will be ignored if the underlying compression already employs checksums, e.g., Gzip.

func SetEmailServer Uses

func SetEmailServer(e EmailConfig)

SetEmailServer sets the email server used for all subsequent SendEmail calls.

func SetImageHeader Uses

func SetImageHeader(w http.ResponseWriter, formatStr string) error

Sets the header's content type to approrprirate media type. Default is PNG.

func SetLogMode Uses

func SetLogMode(newMode ModeFlag)

SetLogMode sets the severity required for a log message to be printed. For example, SetMode(dvid.WarningMode) will log any calls using Warningf, Errorf, or Criticalf. To turn off all logging, use SilentMode.

func Shutdown Uses

func Shutdown()

Shutdown closes any logging, blocking until the log has been flushed of pending messages.

func StartCgo Uses

func StartCgo()

StartCgo is used to mark the beginning of a cgo routine and blocks if we have requested a BlockOnActiveCgo(). This is used for graceful shutdowns and monitoring.

func StopCgo Uses

func StopCgo()

func SupportsGzipEncoding Uses

func SupportsGzipEncoding(r *http.Request) bool

SupportsGzipEncoding returns true if the http requestor can accept gzip encoding.

func TimeCriticalf Uses

func TimeCriticalf(format string, args ...interface{})

func TimeDebugf Uses

func TimeDebugf(format string, args ...interface{})

func TimeErrorf Uses

func TimeErrorf(format string, args ...interface{})

func TimeInfof Uses

func TimeInfof(format string, args ...interface{})

func TimeWarningf Uses

func TimeWarningf(format string, args ...interface{})

func Warningf Uses

func Warningf(format string, args ...interface{})

func WriteGzip Uses

func WriteGzip(gzipData []byte, w http.ResponseWriter, r *http.Request) error

WriteGzip will write already gzip-encoded data to the ResponseWriter unless the requestor cannot support it. In that case, the gzip data is uncompressed and sent uncompressed.

func WriteImageHttp Uses

func WriteImageHttp(w http.ResponseWriter, img image.Image, formatStr string) error

WriteImageHttp writes an image to a HTTP response writer using a format and optional compression strength specified in a string, e.g., "png", "jpg:80".

func WriteJSONFile Uses

func WriteJSONFile(filename string, value interface{}) error

WriteJSONFile writes an arbitrary but exportable Go object to a JSON file.

type Axis Uses

type Axis uint8

Axis enumerates different types of axis (x, y, z, time, etc)

const (
    XAxis Axis = iota
    YAxis
    ZAxis
    TAxis
)

func (Axis) String Uses

func (a Axis) String() string

type BinaryVolume Uses

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

BinaryVolume holds 3d binary data including a 3d offset.

func NewBinaryVolume Uses

func NewBinaryVolume(offset, size Point3d, res NdFloat32) *BinaryVolume

NewBinaryVolume returns a BinaryVolume with an allocated 3d volume for data.

func (*BinaryVolume) CheckSurface Uses

func (binvol *BinaryVolume) CheckSurface(x, y, z int32) (normx, normy, normz float32, isSurface bool)

CheckSurface checks to see if the given voxel within the BinaryVolume is set, and if so, calculates a normal based on a Zucker-Hummel 3x3x3 convolution.

func (*BinaryVolume) ShiftUp Uses

func (binvol *BinaryVolume) ShiftUp(dz int32)

Shift the buffer up by dz voxels.

type BlockCounts Uses

type BlockCounts struct {
    sync.RWMutex
    // contains filtered or unexported fields
}

BlockCounts is a thread-safe type for counting block references.

func (*BlockCounts) Decr Uses

func (c *BlockCounts) Decr(block IZYXString)

Decr decrements the count for a block.

func (*BlockCounts) Empty Uses

func (c *BlockCounts) Empty() bool

Empty returns true if there are no counts.

func (*BlockCounts) Incr Uses

func (c *BlockCounts) Incr(block IZYXString)

Incr increments the count for a block.

func (*BlockCounts) Value Uses

func (c *BlockCounts) Value(block IZYXString) int

Value returns the count for a block.

type BlockRLEs Uses

type BlockRLEs map[IZYXString]RLEs

BlockRLEs is a single label's map of block coordinates to RLEs for that label. The key is a string of the serialized block coordinate.

func (BlockRLEs) NumVoxels Uses

func (brles BlockRLEs) NumVoxels() uint64

NumVoxels is the number of voxels contained within a label's block RLEs.

func (BlockRLEs) SortedKeys Uses

func (brles BlockRLEs) SortedKeys() IZYXSlice

SortedKeys returns a slice of IZYXString sorted in ascending order.

type Bool Uses

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

Bool is a concurrency-safe bool.

func (*Bool) SetFalse Uses

func (b *Bool) SetFalse()

func (*Bool) SetTrue Uses

func (b *Bool) SetTrue()

func (*Bool) Value Uses

func (b *Bool) Value() bool

type Bounder Uses

type Bounder interface {
    // StartPoint returns the offset to first point of data.
    StartPoint() Point

    // EndPoint returns the last point.
    EndPoint() Point
}

type Bounds Uses

type Bounds struct {
    Voxel *OptionalBounds
    Block *OptionalBounds
    Exact bool // If false, just screen on blocks.
}

Bounding provides two levels of optional bounds (voxel and block) as well as whether bounds must be exact to voxel level.

type ByZYX Uses

type ByZYX ListChunkPoint3d

func (*ByZYX) Len Uses

func (list *ByZYX) Len() int

func (*ByZYX) Less Uses

func (list *ByZYX) Less(i, j int) bool

Points are ordered by Z, then Y, then X.

func (*ByZYX) Swap Uses

func (list *ByZYX) Swap(i, j int)

type Checksum Uses

type Checksum uint8

Checksum is the type of checksum employed for error checking stored data. The maximum number of checksum types is limited to 2 bits (3 types).

const (
    NoChecksum Checksum = 0
    CRC32               = 1
)

func (Checksum) String Uses

func (checksum Checksum) String() string

type ChunkExtents3d Uses

type ChunkExtents3d struct {
    MinChunk ChunkPoint3d
    MaxChunk ChunkPoint3d
}

ChunkExtents3d defines a 3d volume of chunks

func (*ChunkExtents3d) Extend Uses

func (ext *ChunkExtents3d) Extend(pt ChunkPoint3d) bool

func (*ChunkExtents3d) ExtendDim Uses

func (ext *ChunkExtents3d) ExtendDim(dim int, val int32) bool

type ChunkIndexer Uses

type ChunkIndexer interface {
    Index

    ChunkPoint

    // Min returns a ChunkIndexer that is the minimum of its value and the passed one.
    Min(ChunkIndexer) (min ChunkIndexer, changed bool)

    // Max returns a ChunkIndexer that is the maximum of its value and the passed one.
    Max(ChunkIndexer) (max ChunkIndexer, changed bool)

    // DuplicateChunkIndexer returns a duplicate that can act as a ChunkIndexer.
    DuplicateChunkIndexer() ChunkIndexer
}

ChunkIndexer adds chunk point access to an index.

type ChunkPoint Uses

type ChunkPoint interface {
    SimplePoint

    // MinPoint returns the minimum point within a chunk and first in an iteration.
    MinPoint(size Point) Point

    // MaxPoint returns the maximum point within a chunk and last in an iteration.
    MaxPoint(size Point) Point
}

ChunkPoint describes a particular chunk in chunk space.

type ChunkPoint2d Uses

type ChunkPoint2d [2]int32

ChunkPoint2d handles 2d signed chunk coordinates.

func (ChunkPoint2d) MaxPoint Uses

func (c ChunkPoint2d) MaxPoint(size Point) Point

MaxPoint returns the maximum voxel coordinate of the given 2d chunk.

func (ChunkPoint2d) MinPoint Uses

func (c ChunkPoint2d) MinPoint(size Point) Point

MinPoint returns the smallest voxel coordinate of the given 2d chunk.

func (ChunkPoint2d) NumDims Uses

func (c ChunkPoint2d) NumDims() uint8

func (ChunkPoint2d) String Uses

func (c ChunkPoint2d) String() string

func (ChunkPoint2d) Value Uses

func (c ChunkPoint2d) Value(dim uint8) int32

Value returns the value at the specified dimension.

type ChunkPoint3d Uses

type ChunkPoint3d [3]int32

ChunkPoint3d handles 3d signed chunk coordinates.

func StringToChunkPoint3d Uses

func StringToChunkPoint3d(str, separator string) (pt ChunkPoint3d, err error)

Parse a string of format "%d<sep>%d<sep>%d,..." into a ChunkPoint3d

func (ChunkPoint3d) BoundingVoxels Uses

func (c ChunkPoint3d) BoundingVoxels(blockSize Point3d) (minBlockVoxel, maxBlockVoxel Point3d)

BoundingVoxels returns the minimum and maximum voxel coordinates for a given chunk where each chunk is of the given block size.

func (ChunkPoint3d) Equals Uses

func (c ChunkPoint3d) Equals(c2 ChunkPoint3d) bool

func (ChunkPoint3d) MaxPoint Uses

func (c ChunkPoint3d) MaxPoint(size Point) Point

MaxPoint returns the maximum voxel coordinate of the given 3d chunk.

func (ChunkPoint3d) MinPoint Uses

func (c ChunkPoint3d) MinPoint(size Point) Point

MinPoint returns the smallest voxel coordinate of the given 3d chunk.

func (ChunkPoint3d) NumDims Uses

func (c ChunkPoint3d) NumDims() uint8

func (*ChunkPoint3d) SetMaximum Uses

func (p *ChunkPoint3d) SetMaximum(p2 ChunkPoint3d)

SetMaximum sets the point to the maximum elements of current and passed points.

func (*ChunkPoint3d) SetMinimum Uses

func (p *ChunkPoint3d) SetMinimum(p2 ChunkPoint3d)

SetMinimum sets the point to the minimum elements of current and passed points.

func (ChunkPoint3d) String Uses

func (c ChunkPoint3d) String() string

func (ChunkPoint3d) ToIZYXString Uses

func (p ChunkPoint3d) ToIZYXString() IZYXString

func (ChunkPoint3d) Value Uses

func (c ChunkPoint3d) Value(dim uint8) int32

Value returns the value at the specified dimension.

type ChunkPointNd Uses

type ChunkPointNd []int32

ChunkPointNd handles N-dimensional signed chunk coordinates.

func (ChunkPointNd) MaxPoint Uses

func (c ChunkPointNd) MaxPoint(size Point) Point

MaxPoint returns the maximum voxel coordinate of the given 3d chunk.

func (ChunkPointNd) MinPoint Uses

func (c ChunkPointNd) MinPoint(size Point) Point

MinPoint returns the smallest voxel coordinate of the given 3d chunk.

func (ChunkPointNd) NumDims Uses

func (c ChunkPointNd) NumDims() uint8

func (ChunkPointNd) String Uses

func (c ChunkPointNd) String() string

func (ChunkPointNd) Value Uses

func (c ChunkPointNd) Value(dim uint8) int32

Value returns the value at the specified dimension.

type ChunkSizer Uses

type ChunkSizer interface {
    ChunkSize() Point
}

ChunkSizer objects can return their chunk size. In DVID, a Chunk is the unit of storage, for example, the unit of a value in a key-value store.

type Chunkable Uses

type Chunkable interface {
    // Chunk returns a point in chunk space, the partition in which the given point falls.
    // For example, a chunk could be a tile (or a subvolume/block) and this returns the
    // tile's coordinate in tile space.
    Chunk(size Point) ChunkPoint

    // PointInChunk returns a point in a particular chunk's space.  For example, if a chunk
    // is a block of voxels, then the returned point is in that block coordinate space with
    // the first voxel in the block as the origin or zero point.
    PointInChunk(size Point) Point
}

Chunkable is an interface for n-dimensional points that can be partitioned into chunks.

type ClientID Uses

type ClientID LocalID32

ClientID is a DVID server-specific identifier of an authorized client. It is used with data keys to track key-values on a per-client basis.

func ClientIDFromBytes Uses

func ClientIDFromBytes(b []byte) ClientID

ClientIDFromBytes returns a VersionID from the start of the slice and the number of bytes used. Note: No error checking is done to ensure byte slice has sufficient bytes for ClientID.

func (ClientID) Bytes Uses

func (id ClientID) Bytes() []byte

Bytes returns a sequence of bytes encoding this ClientID. Binary representation is big-endian to preserve lexicographic order.

type Command Uses

type Command []string

Command supports command-line interaction with DVID. The first item in the string slice is the command, which may be "help" or the name of DVID data name ("uint8"). If the first item is the name of a data type, the second item will have a type-specific command like "get". The other arguments are command arguments or optional settings of the form "<key>=<value>".

func (Command) Argument Uses

func (cmd Command) Argument(pos int) string

Returns the argument at the given position using zero indexing. Settings are not considered arguments. If no argument is at the given position, this returns the empty string.

func (Command) CommandArgs Uses

func (cmd Command) CommandArgs(startPos int, targets ...*string) []string

CommandArgs sets a variadic argument set of string pointers to data command arguments, ignoring setting arguments of the form "<key>=<value>". If there aren't enough arguments to set a target, the target is set to the empty string. It returns an 'overflow' slice that has all arguments beyond those needed for targets.

Example: Given the command string "add param1 param2 42 data/*.png"

var s1, s2, s3, s4 string
filenames := CommandArgs(0, &s1, &s2, &s3, &s4)
fmt.Println(filenames)
fmt.Println(s1)
fmt.Println(s2, s3)
fmt.Println(s4)

Would print out:
   ["data/foo-1.png", "data/foo-2.png", "data/foo-3.png"]
   add
   param1 param2
   42

func (Command) FilenameArgs Uses

func (cmd Command) FilenameArgs(startPos int, targets ...*string) (filenames []string, err error)

FilenameArgs is similar to CommandArgs except it can take filename glob patterns at the end of the string, and will find matches and return those.

func (Command) Name Uses

func (cmd Command) Name() string

Name returns the first argument of the command (in lower case) which is assumed to be the name of the command.

func (Command) Setting Uses

func (cmd Command) Setting(key string) (value string, found bool)

Setting scans a command for any "key=value" argument and returns the value of the passed 'key'. Key is case sensitive for this function.

func (Command) Settings Uses

func (cmd Command) Settings() Config

Settings scans a command for any "key=value" argument and returns a Config, which is a map of key-value data. All keys are converted to lower case for case-insensitive matching.

func (Command) String Uses

func (cmd Command) String() string

String returns a space-separated command line

func (Command) TypeCommand Uses

func (cmd Command) TypeCommand() string

TypeCommand returns the name of a type-specific command (in lower case).

type Compression Uses

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

Compression is the format of compression for storing data. NOTE: Should be no more than 8 (3 bits) compression types.

func NewCompression Uses

func NewCompression(format CompressionFormat, level CompressionLevel) (Compression, error)

NewCompression returns a Compression struct that maps compression-specific details to a DVID-wide compression.

func (Compression) Format Uses

func (c Compression) Format() CompressionFormat

func (Compression) Level Uses

func (c Compression) Level() CompressionLevel

func (Compression) MarshalBinary Uses

func (c Compression) MarshalBinary() ([]byte, error)

MarshalBinary fulfills the encoding.BinaryMarshaler interface.

func (Compression) MarshalJSON Uses

func (c Compression) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (Compression) String Uses

func (c Compression) String() string

func (*Compression) UnmarshalBinary Uses

func (c *Compression) UnmarshalBinary(data []byte) error

UnmarshalBinary fulfills the encoding.BinaryUnmarshaler interface.

func (*Compression) UnmarshalJSON Uses

func (c *Compression) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

type CompressionFormat Uses

type CompressionFormat uint8

CompressionFormat specifies the compression algorithm and is limited to 3 bits (7 types)

func DeserializeData Uses

func DeserializeData(s []byte, uncompress bool) ([]byte, CompressionFormat, error)

DeserializeData deserializes a slice of bytes using stored compression, checksum. If uncompress parameter is false, the data is not uncompressed.

func (CompressionFormat) String Uses

func (format CompressionFormat) String() string

type CompressionLevel Uses

type CompressionLevel int8

CompressionLevel goes from 1 (fastest) to 9 (highest compression) as in deflate. Default compression is -1 so need signed int8.

type Config Uses

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

Config is a map of keyword to arbitrary data to specify configurations via keyword. Keywords are case-insensitive.

func NewConfig Uses

func NewConfig() Config

func (*Config) Clear Uses

func (c *Config) Clear()

Clear removes all configuration data.

func (*Config) Get Uses

func (c *Config) Get(key string) (interface{}, bool)

func (Config) GetAll Uses

func (c Config) GetAll() map[string]interface{}

func (Config) GetBool Uses

func (c Config) GetBool(key string) (value, found bool, err error)

GetBool returns a bool value of the given key with string value. If setting of key is not parseable as a bool ("false", "true", "0", or "1"), returns an error. If the key is not found, it will also return a false bool (the Go zero value for bool).

func (Config) GetInt Uses

func (c Config) GetInt(key string) (i int, found bool, err error)

GetInt returns an int value of the given key with string value. Returns an error if the key's value is not parsable as int.

func (Config) GetRange Uses

func (c Config) GetRange(key, separator string) (*int32, *int32, error)

GetRange returns two int32 from a string where each integer is delimited by a separator. If the key is not found, nils are returned.

func (Config) GetShapes Uses

func (c Config) GetShapes(key, separator string) ([]DataShape, error)

GetShapes returns DataShapes from a string where each shape specification is delimited by a separator. If the key is not found, nil is returned.

func (Config) GetString Uses

func (c Config) GetString(key string) (s string, found bool, err error)

GetString returns a string value of the given key. If setting of key is not a string, returns an error. Returns zero value string ("") if not found.

func (Config) MarshalJSON Uses

func (c Config) MarshalJSON() ([]byte, error)

func (*Config) Remove Uses

func (c *Config) Remove(keys ...string)

Remove removes the key/value pairs with the given keys.

func (*Config) Set Uses

func (c *Config) Set(key string, value interface{})

func (*Config) SetAll Uses

func (c *Config) SetAll(kv map[string]interface{})

func (*Config) SetByJSON Uses

func (c *Config) SetByJSON(jsonData io.Reader) error

Sets a configuration using valid JSON. Since Config is case-insensitive, JSON object names are converted to lower case.

type Data Uses

type Data interface {
    InstanceID() InstanceID

    DataUUID() UUID
    DataName() InstanceName
    RootUUID() UUID
    RootVersionID() (VersionID, error)
    DAGRootUUID() (UUID, error)

    TypeName() TypeString
    TypeURL() URLString
    TypeVersion() string

    Tags() map[string]string

    // Versioned returns false if this data has only one version for an entire repo.
    Versioned() bool

    // KVStore returns the key-value store used for this data.
    KVStore() (Store, error)

    // Returns a concurrency-friendly unique operations ID for this Data.
    // The ID is monotonically increasing although it is not necessarily sequential.
    NewMutationID() uint64

    DataSetter

    IsDeleted() bool
    SetDeleted(bool) // use true if this data is in process of being deleted
}

Data is the minimal interface for datatype-specific data that is implemented in datatype packages. This interface is defined in the low-level dvid package so it is accessible at all levels of dvid, although the implementation of this interface occurs at the datastore and datatype-level packages.

type DataID Uses

type DataID struct {
    // DataUUID is a globally unique identifier for this particular data instance,
    // whether it gets renamed or a portion of its DAG gets distributed to another
    // server.
    DataUUID UUID

    // Name, which can be changed over time.
    Name InstanceName

    // RootUUID is the root of the subgraph in which this data instance is defined.
    // Because a portion of data can be distributed to other servers, the current
    // DAG might be truncated, so the RootUUID can also be a child of the data
    // instance's original RootUUID.
    RootUUID UUID
}

DataID returns unique identifiers for a data instance. A data instance can be identified by a globally-unique, invariant UUID or a changing two-tuple (name, data root UUID).

type DataSetter Uses

type DataSetter interface {
    SetKVStore(Store)
    SetLogStore(Store)

    SetInstanceID(InstanceID)
    SetDataUUID(UUID)
    SetName(InstanceName)
    SetRootUUID(UUID)

    // SetSync defines a set of data UUIDs for syncing with this data instance.
    // This could be used by higher software layers to implement pub/sub-style syncing.
    SetSync(UUIDSet)
}

DataSetter provides interface for setting main properties of Data during initialization and remote transmission.

type DataShape Uses

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

DataShape describes the number of dimensions and the ordering of the dimensions.

func BytesToDataShape Uses

func BytesToDataShape(b []byte) (s DataShape, err error)

BytesToDataShape recovers a DataShape from a series of bytes.

func (DataShape) AxisName Uses

func (s DataShape) AxisName(axis uint8) string

AxisName returns common axis descriptions like X, Y, and Z for a shapes dimensions.

func (DataShape) Bytes Uses

func (s DataShape) Bytes() []byte

Bytes returns a fixed length byte representation that can be used for keys. Up to 5-d shapes can be used.

func (DataShape) ChunkPoint3d Uses

func (s DataShape) ChunkPoint3d(p, size Point) (ChunkPoint3d, error)

ChunkPoint3d returns a chunk point where the XY is determined by the type of slice orientation of the DataShape, and the Z is the non-chunked coordinate. This is useful for tile generation where you have 2d tiles in a 3d space.

func (DataShape) Duplicate Uses

func (s DataShape) Duplicate() DataShape

Duplicate returns a duplicate of the DataShape.

func (DataShape) Equals Uses

func (s DataShape) Equals(s2 DataShape) bool

Equals returns true if the passed DataShape is identical.

func (DataShape) GetFloat2D Uses

func (s DataShape) GetFloat2D(fslice NdFloat32) (x, y float32, err error)

GetFloat2D returns elements of a N-d float array given a 2d shape.

func (DataShape) GetSize2D Uses

func (s DataShape) GetSize2D(size SimplePoint) (width, height int32, err error)

GetSize2D returns the width and height of a 2D shape given a n-D size.

func (DataShape) PlaneToChunkPoint3d Uses

func (s DataShape) PlaneToChunkPoint3d(x, y int32, offset, size Point) (ChunkPoint3d, error)

PlaneToChunkPoint3d returns a chunk point corresponding to the given point on the DataShape's plane. If DataShape is not a plane, returns an error.

func (DataShape) ShapeDimension Uses

func (s DataShape) ShapeDimension(axis uint8) (uint8, error)

ShapeDimension returns the axis number for a shape dimension.

func (DataShape) ShapeDimensions Uses

func (s DataShape) ShapeDimensions() int8

ShapeDimensions returns the number of dimensions for this shape.

func (DataShape) String Uses

func (s DataShape) String() string

func (DataShape) TotalDimensions Uses

func (s DataShape) TotalDimensions() int8

TotalDimensions returns the full dimensionality of space within which there is this DataShape.

type DataShapeString Uses

type DataShapeString string

String for specifying a slice orientation or subvolume

func (DataShapeString) DataShape Uses

func (s DataShapeString) DataShape() (shape DataShape, err error)

DataShape returns the data shape constant associated with the string.

type DataShapes Uses

type DataShapes []DataShape

DataShapes are a slice of DataShape.

type DataSpecifier Uses

type DataSpecifier string

DataSpecifier is either a TypeString or a (InstanceName, UUID) tuple, allowing an immutable specification of a datatype or data instance. The DataSpecifier can be used as the key of a map, and is useful when configuring which data is stored using different storage engines.

func GetDataSpecifier Uses

func GetDataSpecifier(name InstanceName, uuid UUID) DataSpecifier

GetDataSpecifier returns an DataSpecifier given an instance name and UUID.

func GetDataSpecifierByTag Uses

func GetDataSpecifierByTag(tag, value string) DataSpecifier

GetDataSpecifierByTag returns a DataSpecifier given a tag and its value.

type DataType Uses

type DataType uint8

DataType is a unique ID for each type of data within DVID, e.g., a uint8 or a float32.

const (
    T_uint8 DataType = iota
    T_int8
    T_uint16
    T_int16
    T_uint32
    T_int32
    T_uint64
    T_int64
    T_float32
    T_float64
)

type DataValue Uses

type DataValue struct {
    T     DataType
    Label string
}

DataValue describes the data type and label for each value within an element. Terminology: An "element" is some grouping, e.g., data associated with a voxel. A "value" is one component of the data for an element, or said another way, an element can have many values that may be of differing type and size.

func (DataValue) MarshalJSON Uses

func (dv DataValue) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (*DataValue) UnmarshalJSON Uses

func (dv *DataValue) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

func (DataValue) ValueBytes Uses

func (dv DataValue) ValueBytes() int32

ValueBytes returns the number of bytes for this value

type DataValues Uses

type DataValues []DataValue

DataValues describes the interleaved values within an element.

func (DataValues) AverageData Uses

func (values DataValues) AverageData(src, dst []byte, srcW, dstW, dstH, reduceW, reduceH int32)

AverageData averages the source slice of data and stores the result in the dst slice.

func (DataValues) BytesPerElement Uses

func (values DataValues) BytesPerElement() int32

func (DataValues) BytesPerValue Uses

func (values DataValues) BytesPerValue() (int32, error)

BytesPerValue returns the # bytes for each value of an element if all values have equal size. An error is returned if values are varying sizes for an element. Use ValueBytes(dim) to get bytes/value for elements with varying # of bytes per value.

func (DataValues) MarshalBinary Uses

func (values DataValues) MarshalBinary() ([]byte, error)

MarshalBinary fulfills the encoding.BinaryMarshaler interface.

func (*DataValues) UnmarshalBinary Uses

func (values *DataValues) UnmarshalBinary(b []byte) error

UnmarshalBinary fulfills the encoding.BinaryUnmarshaler interface.

func (DataValues) ValueBytes Uses

func (values DataValues) ValueBytes(n int) int32

ValueBytes returnes the size of the nth value in an element.

func (DataValues) ValueDataType Uses

func (values DataValues) ValueDataType() (DataType, error)

ValueDataType returns the dvid.DataType used for all values in an element. If the data types vary, e.g., an int32 then a float32, this function will return an error.

func (DataValues) ValuesPerElement Uses

func (values DataValues) ValuesPerElement() int32

type Dimension Uses

type Dimension struct {
    Name  string
    Units string
    // contains filtered or unexported fields
}

type DirtyBlocks Uses

type DirtyBlocks struct {
    sync.RWMutex
    // contains filtered or unexported fields
}

DirtyBlocks tracks dirty labels across versions

func (*DirtyBlocks) Decr Uses

func (d *DirtyBlocks) Decr(iv InstanceVersion, block IZYXString)

func (*DirtyBlocks) Empty Uses

func (d *DirtyBlocks) Empty(iv InstanceVersion) bool

func (*DirtyBlocks) Incr Uses

func (d *DirtyBlocks) Incr(iv InstanceVersion, block IZYXString)

func (*DirtyBlocks) IsDirty Uses

func (d *DirtyBlocks) IsDirty(iv InstanceVersion, block IZYXString) bool

type ElementProperties Uses

type ElementProperties map[string]struct{}

ElementProperties is a set of strings corresponding to properties stored at an graph edge or vertex (it might make sense to store some properties with the vertex or edge)

type EmailConfig Uses

type EmailConfig struct {
    Notify   []string
    Username string
    Password string
    Server   string
    Port     int
}

EmailConfig holds information necessary for SMTP use.

func (EmailConfig) Host Uses

func (e EmailConfig) Host() string

Host returns the email server information.

func (EmailConfig) IsAvailable Uses

func (e EmailConfig) IsAvailable() bool

IsAvailable returns true if the server and port are set to non-zero values.

type Extents Uses

type Extents struct {
    MinPoint Point
    MaxPoint Point

    MinIndex ChunkIndexer
    MaxIndex ChunkIndexer
    // contains filtered or unexported fields
}

Extents holds the extents of a volume in both absolute voxel coordinates and lexicographically sorted chunk indices.

func (*Extents) AdjustIndices Uses

func (ext *Extents) AdjustIndices(indexBeg, indexEnd ChunkIndexer) bool

AdjustIndices modifies extents based on new block indices in concurrency-safe manner.

func (*Extents) AdjustPoints Uses

func (ext *Extents) AdjustPoints(pointBeg, pointEnd Point) bool

AdjustPoints modifies extents based on new voxel coordinates in concurrency-safe manner.

func (*Extents) Duplicate Uses

func (ext *Extents) Duplicate() Extents

Duplicate creates a duplicate Extents.

func (*Extents) EndPoint Uses

func (ext *Extents) EndPoint() Point

EndPoint returns the last point.

func (*Extents) StartPoint Uses

func (ext *Extents) StartPoint() Point

StartPoint returns the offset to first point of data.

type Extents3d Uses

type Extents3d struct {
    MinPoint Point3d
    MaxPoint Point3d
}

Extents defines a 3d volume

func GetTileExtents Uses

func GetTileExtents(tileCoord ChunkPoint3d, plane DataShape, tileSize Point3d) (e Extents3d, err error)

GetTileExtents returns the extents of a tile in voxels.

func NewExtents3dFromStrings Uses

func NewExtents3dFromStrings(offsetStr, sizeStr, sep string) (*Extents3d, error)

NewExtents3dFromStrings returns an Extents3d given string representations of offset and size in voxels.

func (*Extents3d) BlockRange Uses

func (ext *Extents3d) BlockRange(size Point3d) (min, max ChunkPoint3d)

BlockRange returns the starting and ending block coordinate for given extents and block size.

func (*Extents3d) BlockWithin Uses

func (ext *Extents3d) BlockWithin(size Point3d, coord ChunkPoint3d) bool

BlockWithin returns true if given block coord is within the extents partitioned using the give block size, or false if it is not given a 3d point size or block coord.

func (*Extents3d) Extend Uses

func (ext *Extents3d) Extend(pt Point3d) bool

func (*Extents3d) ExtendDim Uses

func (ext *Extents3d) ExtendDim(dim int, val int32) bool

func (*Extents3d) VoxelWithin Uses

func (ext *Extents3d) VoxelWithin(pt Point3d) bool

VoxelWithin returns true if given point is within the extents.

type Filename Uses

type Filename string

Filename has a base name + extension.

func (Filename) HasExtensionPrefix Uses

func (fname Filename) HasExtensionPrefix(exts ...string) bool

HasExtensionPrefix returns true if the given string forms a prefix for the filename's extension.

type Geometry Uses

type Geometry interface {
    Bounder

    // DataShape describes the shape of the data.
    DataShape() DataShape

    // Size returns the extent in each dimension.
    Size() Point

    // NumVoxels returns the number of voxels within this space.
    NumVoxels() int64

    String() string
}

Geometry describes the shape, size, and position of data in the DVID volume.

func Isotropy2D Uses

func Isotropy2D(voxelSize NdFloat32, geom Geometry, isotropic bool) (Geometry, error)

Returns the image size necessary to compute an isotropic slice of the given dimensions. If isotropic is false, simply returns the original slice geometry. If isotropic is true, uses the higher resolution dimension.

func NewOrthogSlice Uses

func NewOrthogSlice(s DataShape, offset Point, size Point2d) (Geometry, error)

NewOrthogSlice returns an OrthogSlice of chosen orientation, offset, and size.

func NewSliceFromStrings Uses

func NewSliceFromStrings(str DataShapeString, offsetStr, sizeStr, sep string) (Geometry, error)

NewSliceFromStrings returns a Geometry object for a XY, XZ, or YZ slice given a data shape string, offset ("0,10,20"), and size ("250,250").

type GraphEdge Uses

type GraphEdge struct {
    *GraphElement
    Vertexpair VertexPairID
}

GraphEdge defines an edge in a graph; if a directed edge is desired it must be specified as an edge property

type GraphElement Uses

type GraphElement struct {
    Properties ElementProperties
    Weight     float64
}

GraphElement defines fundamental data common to both vertices and edges

type GraphVertex Uses

type GraphVertex struct {
    *GraphElement
    Id       VertexID
    Vertices []VertexID
}

GraphVertex defines a vertex in a graph; a vertex should have a unique id

type Hashable Uses

type Hashable interface {
    // Hash provides a consistent mapping from an Index to an integer (0,n]
    Hash(n int) int
}

Hashable is a type that provies a function to hash itself to an integer range.

type IZYXSlice Uses

type IZYXSlice []IZYXString

IZYXSlice is a typically sorted slice of IZYXString

func (*IZYXSlice) Delete Uses

func (i *IZYXSlice) Delete(i2 IZYXSlice)

Delete removes the given sorted IZYXSlice from the receiver.

func (IZYXSlice) Downres Uses

func (i IZYXSlice) Downres(scale uint8) (IZYXSlice, error)

Downres returns a down-resolution version of the IZYXSlice where the factor is 2^scale. The receiver IZYXSlice does not have to be sorted.

func (IZYXSlice) FitToBounds Uses

func (i IZYXSlice) FitToBounds(bounds *OptionalBounds) (IZYXSlice, error)

FitToBounds returns a copy IZYXSlice that has been adjusted to fit within the given optional block bounds. The receiver IZYXSlice is assumed to be sorted.

func (IZYXSlice) GetBounds Uses

func (i IZYXSlice) GetBounds() (minPt, maxPt Point3d, err error)

GetBounds returns the minimum and maximum coordinate in the IZYXSlice.

func (IZYXSlice) Len Uses

func (i IZYXSlice) Len() int

func (IZYXSlice) Less Uses

func (i IZYXSlice) Less(a, b int) bool

func (IZYXSlice) MarshalBinary Uses

func (i IZYXSlice) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface

func (*IZYXSlice) Merge Uses

func (i *IZYXSlice) Merge(i2 IZYXSlice)

Merge merges the given sorted IZYXSlice into the receiver.

func (IZYXSlice) MergeCopy Uses

func (i IZYXSlice) MergeCopy(i2 IZYXSlice) IZYXSlice

MergeCopy returns a merge of two sorted IZYXSlice. Both IZYXSlices should be sorted before use of this function and the result is a copy not a reference.

func (IZYXSlice) Split Uses

func (i IZYXSlice) Split(rm IZYXSlice) (IZYXSlice, error)

Split removes the IZYXs from the receiver and returns the remainder as a copy. This assumes both deleted blocks and receiver are sorted.

func (IZYXSlice) String Uses

func (i IZYXSlice) String() string

func (IZYXSlice) Swap Uses

func (i IZYXSlice) Swap(a, b int)

func (*IZYXSlice) UnmarshalBinary Uses

func (i *IZYXSlice) UnmarshalBinary(b []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.

func (IZYXSlice) WriteSerializedRLEs Uses

func (i IZYXSlice) WriteSerializedRLEs(w io.Writer) (spans uint32, err error)

WriteSerializedRLEs writes serialized RLEs and returns the number of spans. Note this function assumes the receiver is already sorted.

type IZYXString Uses

type IZYXString string

IZYXString is the stringified version of IndexZYX.Bytes(), optimized for lexicographic ordering.

func (IZYXString) Halfres Uses

func (i IZYXString) Halfres() (IZYXString, error)

Halfres returns an IZYXString representing a chunk point divided in two.

func (IZYXString) Hash Uses

func (i IZYXString) Hash(n int) int

Hash returns an integer [0, n) where the returned values should be reasonably spread among the range of returned values. This implementation makes sure that any range query along x, y, or z direction will map to different handlers.

func (IZYXString) IndexZYX Uses

func (i IZYXString) IndexZYX() (IndexZYX, error)

IndexZYX returns an index from a string representation of the coordinate.

func (IZYXString) String Uses

func (i IZYXString) String() string

String returns a nicely formatted string of the 3d block coordinate or "corrupted coordinate".

func (IZYXString) ToChunkPoint3d Uses

func (i IZYXString) ToChunkPoint3d() (ChunkPoint3d, error)

func (IZYXString) Unpack Uses

func (i IZYXString) Unpack() (x, y, z int32, err error)

Unpack returns the constituent x, y, and z coordinates of the corresponding index.

func (IZYXString) VoxelOffset Uses

func (i IZYXString) VoxelOffset(chunkSize Point3d) (offset Point3d, err error)

func (IZYXString) Z Uses

func (i IZYXString) Z() (int32, error)

type Image Uses

type Image struct {
    DataFormat   DataValues
    Interpolable bool

    Which   uint8
    Gray    *image.Gray
    Gray16  *image.Gray16
    NRGBA   *image.NRGBA
    NRGBA64 *image.NRGBA64
}

Image contains a standard Go image as well as a data format description so non-standard image values like uint64 labels or uint32 intensities can be handled. A DVID image also knows whether it should be interpolated on resizing or must keep pixel values without interpolation, e.g., when using labels. Better Gob serialization is handled by a union of possible image types compared to a generic image.Image interface: see https://groups.google.com/d/msg/golang-dev/_t4pqoeuflE/DbqSf41wr5EJ

func ImageFromBytes Uses

func ImageFromBytes(data []byte, format DataValues, interpolable bool) (*Image, string, error)

ImageFromBytes returns a DVID Image from binary image data, e.g., a PNG file. Returns a string representing the type of encoding used for the image.

func ImageFromData Uses

func ImageFromData(dstW, dstH int32, data []byte, format DataValues, interpolable bool) (*Image, error)

ImageFromData returns a DVID Image from raw data and dimensions.

func ImageFromGoImage Uses

func ImageFromGoImage(src image.Image, format DataValues, interpolable bool) (*Image, error)

ImageFromGoImage returns a DVID image from a go image and a data format specification. DVID images must have identical data type values within a pixel.

func (*Image) Bounds Uses

func (img *Image) Bounds() image.Rectangle

Bounds returns the size of the image. If an image is not set, it returns the zero recatnagle (image.ZR)

func (*Image) Data Uses

func (img *Image) Data() []uint8

Data returns a slice of bytes corresponding to the image pixels.

func (*Image) DataPtr Uses

func (img *Image) DataPtr(x, y int32) ([]byte, error)

DataPtr returns a slice of bytes corresponding to the value at point (x,y) in image.

func (*Image) Deserialize Uses

func (img *Image) Deserialize(b []byte) error

Deserialze deserializes an Image from a possibly compressioned, checksummed byte slice.

func (Image) Get Uses

func (img Image) Get() image.Image

Get returns an image.Image from the union struct.

func (Image) GetDrawable Uses

func (img Image) GetDrawable() draw.Image

Get returns an image.Image from the union struct.

func (Image) GetJPEG Uses

func (img Image) GetJPEG(quality int) ([]byte, error)

GetJPEG returns bytes in JPEG format where quality is 1-100, higher is better, and quality 0 is DefaultJPEGQuality.

func (Image) GetPNG Uses

func (img Image) GetPNG() ([]byte, error)

GetPNG returns bytes in PNG format.

func (*Image) InterpolateImage Uses

func (img *Image) InterpolateImage(dstW, dstH int) (image.Image, error)

InterpolateImage returns an image scaled to the given geometry using simple nearest-neighbor interpolation.

func (*Image) MarshalBinary Uses

func (img *Image) MarshalBinary() ([]byte, error)

MarshalBinary fulfills the encoding.BinaryMarshaler interface.

func (*Image) NumBytes Uses

func (img *Image) NumBytes() int32

Returns the number of bytes to be expected for this image and data format.

func (*Image) ResizeImage Uses

func (img *Image) ResizeImage(dstW, dstH int) (image.Image, error)

ResizeImage returns an image scaled to the given geometry without doing interpolation.

func (*Image) ScaleImage Uses

func (img *Image) ScaleImage(dstW, dstH int) (*Image, error)

ScaleImage scales a DVID image to the destination geometry size, using nearest-neighbor or interpolation depending on the type of data.

func (*Image) Serialize Uses

func (img *Image) Serialize(compress Compression, checksum Checksum) ([]byte, error)

Serialize writes optional compressed and checksummed bytes representing image data.

func (*Image) SubImage Uses

func (img *Image) SubImage(r image.Rectangle) (*Image, error)

SubImage returns an image representing the portion of the image p visible through r. The returned image shares pixels with the original image.

func (*Image) UnmarshalBinary Uses

func (img *Image) UnmarshalBinary(b []byte) error

UnmarshalBinary fulfills the encoding.BinaryUnmarshaler interface.

type Index Uses

type Index interface {
    // Duplicate returns a duplicate Index
    Duplicate() Index

    // Bytes returns a byte representation of the Index.  Integer components of
    // the Index should probably be serialized in big endian for improved
    // lexicographic ordering.
    Bytes() []byte

    // IndexFromBytes sets the receiver from the given bytes.
    IndexFromBytes([]byte) error

    // Scheme returns a string describing the indexing scheme.
    Scheme() string

    // String returns a human readable description of the Index.
    String() string
}

Index provides partioning of the data, typically in spatiotemporal ways. In the case of voxels, this could be an IndexZYX implementation that uses a 3d coordinate packed into a slice of bytes. It can be used to fill a TKey.

type IndexBytes Uses

type IndexBytes []byte

IndexBytes satisfies an Index interface with a slice of bytes.

func (*IndexBytes) Bytes Uses

func (i *IndexBytes) Bytes() []byte

func (*IndexBytes) Duplicate Uses

func (i *IndexBytes) Duplicate() Index

func (*IndexBytes) Hash Uses

func (i *IndexBytes) Hash(n int) int

func (*IndexBytes) IndexFromBytes Uses

func (i *IndexBytes) IndexFromBytes(b []byte) error

func (*IndexBytes) Scheme Uses

func (i *IndexBytes) Scheme() string

func (*IndexBytes) String Uses

func (i *IndexBytes) String() string

type IndexCZYX Uses

type IndexCZYX struct {
    Channel int32
    IndexZYX
}

IndexCZYX implements the Index interface and provides simple indexing on "channel" C, then Z, then Y, then X. Since IndexZYX is embedded, we get ChunkIndexer interface.

func (*IndexCZYX) Bytes Uses

func (i *IndexCZYX) Bytes() []byte

Bytes returns a byte representation of the Index.

func (*IndexCZYX) Duplicate Uses

func (i *IndexCZYX) Duplicate() Index

func (*IndexCZYX) IndexFromBytes Uses

func (i *IndexCZYX) IndexFromBytes(b []byte) error

IndexFromBytes returns an index from bytes. The passed Index is used just to choose the appropriate byte decoding scheme.

func (*IndexCZYX) Scheme Uses

func (i *IndexCZYX) Scheme() string

func (*IndexCZYX) String Uses

func (i *IndexCZYX) String() string

type IndexCZYXIterator Uses

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

----- IndexIterator implementation ------------

func NewIndexCZYXIterator Uses

func NewIndexCZYXIterator(channel int32, start, end ChunkPoint3d) *IndexCZYXIterator

NewIndexCZYXIterator returns an IndexIterator that iterates over XYZ space for a C.

func (*IndexCZYXIterator) IndexSpan Uses

func (it *IndexCZYXIterator) IndexSpan() (beg, end Index, err error)

func (*IndexCZYXIterator) NextSpan Uses

func (it *IndexCZYXIterator) NextSpan()

func (*IndexCZYXIterator) Valid Uses

func (it *IndexCZYXIterator) Valid() bool

type IndexHilbert Uses

type IndexHilbert []byte

TODO -- Hilbert curve

func (IndexHilbert) Scheme Uses

func (i IndexHilbert) Scheme() string

type IndexIterator Uses

type IndexIterator interface {
    Valid() bool
    IndexSpan() (beg, end Index, err error)
    NextSpan()
}

IndexIterator is an interface that can return a sequence of indices.

type IndexMorton Uses

type IndexMorton []byte

TODO -- Morton (Z-order) curve

func (IndexMorton) Scheme Uses

func (i IndexMorton) Scheme() string

type IndexRange Uses

type IndexRange struct {
    Minimum, Maximum Index
}

IndexRange defines the extent of data via minimum and maximum indices.

type IndexString Uses

type IndexString string

IndexString satisfies an Index interface with a string.

func (*IndexString) Bytes Uses

func (i *IndexString) Bytes() []byte

func (*IndexString) Duplicate Uses

func (i *IndexString) Duplicate() Index

func (*IndexString) Hash Uses

func (i *IndexString) Hash(n int) int

func (*IndexString) IndexFromBytes Uses

func (i *IndexString) IndexFromBytes(b []byte) error

func (*IndexString) Scheme Uses

func (i *IndexString) Scheme() string

func (*IndexString) String Uses

func (i *IndexString) String() string

type IndexUint8 Uses

type IndexUint8 uint8

IndexUint8 satisfies an Index interface with an 8-bit unsigned integer index.

func (*IndexUint8) Bytes Uses

func (i *IndexUint8) Bytes() []byte

Bytes returns a byte representation of the Index.

func (*IndexUint8) Duplicate Uses

func (i *IndexUint8) Duplicate() Index

func (*IndexUint8) Hash Uses

func (i *IndexUint8) Hash(n int) int

Hash returns an integer [0, n)

func (*IndexUint8) IndexFromBytes Uses

func (i *IndexUint8) IndexFromBytes(b []byte) error

func (*IndexUint8) Scheme Uses

func (i *IndexUint8) Scheme() string

func (*IndexUint8) String Uses

func (i *IndexUint8) String() string

type IndexZYX Uses

type IndexZYX ChunkPoint3d

IndexZYX implements the Index interface and provides simple indexing on Z, then Y, then X. Note that index elements are unsigned to better handle sequential access of negative/positive coordinates. The binary representation of an index must behave reasonably for both negative and positive coordinates, e.g., when moving from -1 to 0 the binary representation isn't discontinous so the lexicographical ordering switches. The simplest way to achieve this is to convert to an unsigned (positive) integer space where all coordinates are greater or equal to (0,0,...).

func (*IndexZYX) Bytes Uses

func (i *IndexZYX) Bytes() []byte

Bytes returns a byte representation of the Index. This should layout integer space as consecutive in binary representation so we use bigendian and convert signed integer space to unsigned integer space.

func (*IndexZYX) Duplicate Uses

func (i *IndexZYX) Duplicate() Index

func (*IndexZYX) DuplicateChunkIndexer Uses

func (i *IndexZYX) DuplicateChunkIndexer() ChunkIndexer

DuplicateChunkIndexer returns a duplicate that can act as a ChunkIndexer.

func (*IndexZYX) Hash Uses

func (i *IndexZYX) Hash(n int) int

Hash returns an integer [0, n) where the returned values should be reasonably spread among the range of returned values. This implementation makes sure that any range query along x, y, or z direction will map to different handlers. The underlying algorithm is identical to use of IZYXString so the has for either an IZYXString or IndexZYX representation will return the identical hash.

func (*IndexZYX) IndexFromBytes Uses

func (i *IndexZYX) IndexFromBytes(b []byte) error

IndexFromBytes returns an index from key bytes. The passed Index is used just to choose the appropriate byte decoding scheme.

func (*IndexZYX) MarshalBinary Uses

func (i *IndexZYX) MarshalBinary() ([]byte, error)

MarshalBinary fulfills the encoding.BinaryMarshaler interface and stores index ZYX as X, Y, Z in little endian int32 format. Note that this should NOT be used when creating a DVID key; use Bytes(), which stores big endian for better lexicographic ordering.

func (*IndexZYX) Max Uses

func (i *IndexZYX) Max(idx ChunkIndexer) (ChunkIndexer, bool)

Max returns a ChunkIndexer that is the maximum of its value and the passed one.

func (*IndexZYX) MaxPoint Uses

func (i *IndexZYX) MaxPoint(size Point) Point

MaxPoint returns the maximum voxel coordinate for a chunk.

func (*IndexZYX) Min Uses

func (i *IndexZYX) Min(idx ChunkIndexer) (ChunkIndexer, bool)

Min returns a ChunkIndexer that is the minimum of its value and the passed one.

func (*IndexZYX) MinPoint Uses

func (i *IndexZYX) MinPoint(size Point) Point

MinPoint returns the minimum voxel coordinate for a chunk.

func (*IndexZYX) NumDims Uses

func (i *IndexZYX) NumDims() uint8

func (*IndexZYX) Scheme Uses

func (i *IndexZYX) Scheme() string

func (*IndexZYX) String Uses

func (i *IndexZYX) String() string

String produces a pretty printable string of the index in hex format.

func (*IndexZYX) ToIZYXString Uses

func (i *IndexZYX) ToIZYXString() IZYXString

func (IndexZYX) ToVoxelOffset Uses

func (i IndexZYX) ToVoxelOffset(chunkSize Point3d) Point3d

func (*IndexZYX) UnmarshalBinary Uses

func (i *IndexZYX) UnmarshalBinary(b []byte) error

UnmarshalBinary fulfills the encoding.BinaryUnmarshaler interface and sets index ZYX using little endian int32 format. Note that this should NOT be used when retrieving a DVID key; use IndexFromBytes(), which decodes big endian due to key lexicographic ordering.

func (*IndexZYX) Unpack Uses

func (i *IndexZYX) Unpack() (x, y, z int32)

func (*IndexZYX) Value Uses

func (i *IndexZYX) Value(dim uint8) int32

Value returns the value at the specified dimension for this index.

type IndexZYXIterator Uses

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

----- IndexIterator implementation ------------

func NewIndexZYXIterator Uses

func NewIndexZYXIterator(start, end ChunkPoint3d) *IndexZYXIterator

NewIndexZYXIterator returns an IndexIterator that iterates over XYZ space.

func (*IndexZYXIterator) IndexSpan Uses

func (it *IndexZYXIterator) IndexSpan() (beg, end Index, err error)

func (*IndexZYXIterator) NextSpan Uses

func (it *IndexZYXIterator) NextSpan()

func (*IndexZYXIterator) Valid Uses

func (it *IndexZYXIterator) Valid() bool

type InstanceID Uses

type InstanceID LocalID32

InstanceID is a DVID server-specific identifier for data instances. Each InstanceID is only used within one repo, so all key/values for a repo can be obtained by doing range queries on instances associated with a repo. Valid InstanceIDs should be greater than 0.

func InstanceIDFromBytes Uses

func InstanceIDFromBytes(b []byte) InstanceID

InstanceIDFromBytes returns a LocalID from the start of the slice and the number of bytes used. Note: No error checking is done to ensure byte slice has sufficient bytes for InstanceID.

func (InstanceID) Bytes Uses

func (id InstanceID) Bytes() []byte

Bytes returns a sequence of bytes encoding this InstanceID.

type InstanceMap Uses

type InstanceMap map[InstanceID]InstanceID

type InstanceName Uses

type InstanceName string

InstanceName is a string that is the name of DVID data.

type InstanceNames Uses

type InstanceNames []InstanceName

InstanceNames is a slice of DVID data instance names.

func (InstanceNames) String Uses

func (i InstanceNames) String() string

type InstanceVersion Uses

type InstanceVersion struct {
    Data    UUID
    Version VersionID
}

InstanceVersion identifies a particular version of a data instance.

func (InstanceVersion) String Uses

func (iv InstanceVersion) String() string

type ListChunkPoint3d Uses

type ListChunkPoint3d struct {
    Points  []ChunkPoint3d
    Indices []int
}

func ListChunkPoint3dFromVoxels Uses

func ListChunkPoint3dFromVoxels(jsonBytes []byte, blockSize Point) (*ListChunkPoint3d, error)

ListChunkPoint3dFromVoxels creates a ListChunkPoint3d from JSON of voxel coordinates:

[ [x0, y0, z0], [x1, y1, z1], ... ]

type LocalID Uses

type LocalID uint16

LocalID is a unique id for some data in a DVID instance. This unique id is a much smaller representation than the actual data (e.g., a version UUID or data type url) and can be represented with fewer bytes in keys.

func LocalIDFromBytes Uses

func LocalIDFromBytes(b []byte) (id LocalID, length int)

LocalIDFromBytes returns a LocalID from the start of the slice and the number of bytes used. Note: No error checking is done to ensure byte slice has sufficient bytes for LocalID.

func (LocalID) Bytes Uses

func (id LocalID) Bytes() []byte

Bytes returns a sequence of bytes encoding this LocalID. Binary representation will be big-endian to make integers lexigraphically ordered.

type LocalID32 Uses

type LocalID32 uint32

LocalID32 is a 32-bit unique id within this DVID instance.

func LocalID32FromBytes Uses

func LocalID32FromBytes(b []byte) (id LocalID32, length int)

LocalID32FromBytes returns a LocalID from the start of the slice and the number of bytes used. Note: No error checking is done to ensure byte slice has sufficient bytes for LocalID.

func (LocalID32) Bytes Uses

func (id LocalID32) Bytes() []byte

Bytes returns a sequence of bytes encoding this LocalID32.

type LogConfig Uses

type LogConfig struct {
    Logfile string
    MaxSize int `toml:"max_log_size"`
    MaxAge  int `toml:"max_log_age"`
}

func (*LogConfig) SetLogger Uses

func (c *LogConfig) SetLogger()

SetLogger creates a logger that saves to a rotating log file.

type Logger Uses

type Logger interface {
    // Debug writes a string synchronously without formatting using Debug level.
    Debug(s string)

    // Info writes a string synchronously without formatting using Info level.
    Info(s string)

    // Warning writes a string synchronously without formatting using Warning level.
    Warning(s string)

    // Error writes a string synchronously without formatting using Error level.
    Error(s string)

    // Critical writes a string synchronously without formatting using Critical level.
    Critical(s string)

    // Debugf formats its arguments analogous to fmt.Printf and records the text as a log
    // message at Debug level.  If dvid.Verbose is not true, these logs aren't written.
    // Messages are sent through a buffered channel to make logging more asynchronous.
    Debugf(format string, args ...interface{})

    // Infof is like Debugf, but at Info level and will be written regardless if not in
    // verbose mode.
    Infof(format string, args ...interface{})

    // Warningf is like Debugf, but at Warning level.
    Warningf(format string, args ...interface{})

    // Errorf is like Debugf, but at Error level.
    Errorf(format string, args ...interface{})

    // Criticalf is like Debugf, but at Critical level.
    Criticalf(format string, args ...interface{})

    // Shutdown makes sure logs are closed.
    Shutdown()
}

Logger provides a way for the application to log messages at different severities. Implementations will vary if the app is in the cloud or on a local server.

type ModInfo Uses

type ModInfo struct {
    User string
    App  string
    Time string
}

ModInfo gives a user, app and time for a modification

func GetModInfo Uses

func GetModInfo(r *http.Request) ModInfo

GetModInfo sets and returns a ModInfo using "u" query string.

type ModeFlag Uses

type ModeFlag uint
const (
    DebugMode ModeFlag = iota
    InfoMode
    WarningMode
    ErrorMode
    CriticalMode
    SilentMode
)

type NdFloat32 Uses

type NdFloat32 []float32

NdFloat32 is an N-dimensional slice of float32

func StringToNdFloat32 Uses

func StringToNdFloat32(str, separator string) (nd NdFloat32, err error)

Parse a string of format "%f,%f,%f,..." into a slice of float32.

func (NdFloat32) Equals Uses

func (n NdFloat32) Equals(n2 NdFloat32) bool

Equals returns true if two NdFloat32 are equal for each component.

func (NdFloat32) GetMax Uses

func (n NdFloat32) GetMax() float32

GetMax returns the maximum element of the N-dimensional float.

func (NdFloat32) GetMin Uses

func (n NdFloat32) GetMin() float32

GetMin returns the minimum element of the N-dimensional float.

func (NdFloat32) MultScalar Uses

func (n NdFloat32) MultScalar(x float32) NdFloat32

MultScalar multiples a N-dimensional float by a float32

func (NdFloat32) String Uses

func (n NdFloat32) String() string

type NdString Uses

type NdString []string

NdString is an N-dimensional slice of strings

func StringToNdString Uses

func StringToNdString(str, separator string) (nd NdString, err error)

Parse a string of format "%f,%f,%f,..." into a slice of float32.

func (NdString) ChunkPoint3d Uses

func (n NdString) ChunkPoint3d() (p ChunkPoint3d, err error)

func (NdString) Point2d Uses

func (n NdString) Point2d() (p Point2d, err error)

func (NdString) Point3d Uses

func (n NdString) Point3d() (p Point3d, err error)

func (NdString) PointNd Uses

func (n NdString) PointNd() (PointNd, error)

type OptionalBounds Uses

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

OptionalBounds holds optional bounds in X, Y, and Z. This differs from Extents in allowing optional min and max bounds along each dimension.

func OptionalBoundsFromQueryString Uses

func OptionalBoundsFromQueryString(r *http.Request) (*OptionalBounds, error)

OptionalBoundsFromQueryString returns OptionalBounds from a set of query strings.

func (*OptionalBounds) Adjust Uses

func (b *OptionalBounds) Adjust(minPt, maxPt *Point3d)

Adjust modifies the given minimum and maximum point to reflect additional optional bounds.

func (*OptionalBounds) BeyondZ Uses

func (b *OptionalBounds) BeyondZ(pt ChunkPoint3d) bool

BeyondZ returns true if the given Z is beyond a set max Z bound.

func (*OptionalBounds) BoundedX Uses

func (b *OptionalBounds) BoundedX() bool

BoundedX returns true if there is some bound set in the X dimension

func (*OptionalBounds) BoundedY Uses

func (b *OptionalBounds) BoundedY() bool

BoundedY returns true if there is some bound set in the Y dimension

func (*OptionalBounds) BoundedZ Uses

func (b *OptionalBounds) BoundedZ() bool

BoundedZ returns true if there is some bound set in the Z dimension

func (*OptionalBounds) Divide Uses

func (b *OptionalBounds) Divide(pt Point3d) *OptionalBounds

Divide returns a new bounds that has all optionally set bounds divided by the given point.

func (*OptionalBounds) IsSet Uses

func (b *OptionalBounds) IsSet() bool

IsSet returns true if at least one bound in some dimension has been set.

func (*OptionalBounds) MaxX Uses

func (b *OptionalBounds) MaxX() (x int32, ok bool)

func (*OptionalBounds) MaxY Uses

func (b *OptionalBounds) MaxY() (y int32, ok bool)

func (*OptionalBounds) MaxZ Uses

func (b *OptionalBounds) MaxZ() (z int32, ok bool)

func (*OptionalBounds) MinX Uses

func (b *OptionalBounds) MinX() (x int32, ok bool)

func (*OptionalBounds) MinY Uses

func (b *OptionalBounds) MinY() (y int32, ok bool)

func (*OptionalBounds) MinZ Uses

func (b *OptionalBounds) MinZ() (z int32, ok bool)

func (*OptionalBounds) Outside Uses

func (b *OptionalBounds) Outside(pt ChunkPoint3d) bool

Outside returns true if the given chunk point is outside any set bound.

func (*OptionalBounds) OutsideX Uses

func (b *OptionalBounds) OutsideX(x int32) bool

OutsideX returns true if the given X is outside a set X bound.

func (*OptionalBounds) OutsideY Uses

func (b *OptionalBounds) OutsideY(y int32) bool

OutsideY returns true if the given Y is outside a set Y bound.

func (*OptionalBounds) OutsideZ Uses

func (b *OptionalBounds) OutsideZ(z int32) bool

OutsideZ returns true if the given Z is outside a set Z bound.

func (*OptionalBounds) SetMaxX Uses

func (b *OptionalBounds) SetMaxX(x int32)

func (*OptionalBounds) SetMaxY Uses

func (b *OptionalBounds) SetMaxY(y int32)

func (*OptionalBounds) SetMaxZ Uses

func (b *OptionalBounds) SetMaxZ(z int32)

func (*OptionalBounds) SetMinX Uses

func (b *OptionalBounds) SetMinX(x int32)

func (*OptionalBounds) SetMinY Uses

func (b *OptionalBounds) SetMinY(y int32)

func (*OptionalBounds) SetMinZ Uses

func (b *OptionalBounds) SetMinZ(z int32)

func (*OptionalBounds) String Uses

func (b *OptionalBounds) String() string

type OrthogSlice Uses

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

OrthogSlice is a 2d rectangle orthogonal to two axis of the space that is slices. It fulfills a Geometry interface.

func (OrthogSlice) DataShape Uses

func (s OrthogSlice) DataShape() DataShape

func (OrthogSlice) Duplicate Uses

func (s OrthogSlice) Duplicate() OrthogSlice

func (OrthogSlice) EndPoint Uses

func (s OrthogSlice) EndPoint() Point

func (OrthogSlice) NumVoxels Uses

func (s OrthogSlice) NumVoxels() int64

func (*OrthogSlice) SetSize Uses

func (s *OrthogSlice) SetSize(size Point2d)

func (OrthogSlice) Size Uses

func (s OrthogSlice) Size() Point

func (OrthogSlice) StartPoint Uses

func (s OrthogSlice) StartPoint() Point

func (OrthogSlice) String Uses

func (s OrthogSlice) String() string

type Point Uses

type Point interface {
    SimplePoint

    // CheckedValue returns the point's value for the specified dimension and checks dim bounds.
    CheckedValue(dim uint8) (int32, error)

    // Duplicate returns a copy of the point.
    Duplicate() Point

    // Modify returns a copy of the point with the given (dim, value) components modified.
    Modify(map[uint8]int32) Point

    // AddScalar adds a scalar value to this point.
    AddScalar(int32) Point

    // DivScalar divides this point by a scalar value.
    DivScalar(int32) Point

    // Add returns the addition of two points.
    Add(Point) Point

    // Sub returns the subtraction of the passed point from the receiver.
    Sub(Point) Point

    // Mod returns a point where each component is the receiver modulo the passed point's components.
    Mod(Point) Point

    // Div returns the division of the receiver by the passed point.
    Div(Point) Point

    // Mult returns the multiplication of the receiver by the passed point.
    Mult(Point) Point

    // Max returns a Point where each of its elements are the maximum of two points' elements.
    Max(Point) (Point, bool)

    // Min returns a Point where each of its elements are the minimum of two points' elements.
    Min(Point) (Point, bool)

    // Distance returns the integer distance (rounding down).
    Distance(Point) int32

    // Prod returns the product of the point elements.
    Prod() int64

    String() string
}

Point is an interface for n-dimensional points. Types that implement the interface can optimize for particular dimensionality.

func NewPoint Uses

func NewPoint(values []int32) (Point, error)

NewPoint returns an appropriate Point implementation for the number of dimensions passed in.

func SliceToPoint Uses

func SliceToPoint(coord []int32) (p Point, err error)

Convert a slice of int32 into an appropriate Point implementation.

func StringToPoint Uses

func StringToPoint(str, separator string) (p Point, err error)

StringToPoint parses a string of format "%d<sep>%d<sep>%d..." into a Point

type Point2d Uses

type Point2d [2]int32

Point2d is a 2d point.

func RectSize Uses

func RectSize(rect image.Rectangle) (size Point2d)

RectSize returns the size of a rectangle as a Point2d.

func StringToPoint2d Uses

func StringToPoint2d(str, separator string) (Point2d, error)

StringToPoint2d parses a string of format "%d<sep>%d,..." into a Point2d

func (Point2d) Add Uses

func (p Point2d) Add(x Point) Point

Add returns the addition of two points.

func (Point2d) AddScalar Uses

func (p Point2d) AddScalar(value int32) Point

AddScalar adds a scalar value to this point.

func (Point2d) CheckedValue Uses

func (p Point2d) CheckedValue(dim uint8) (int32, error)

CheckedValue returns the point's value for the specified dimension and checks dim bounds.

func (Point2d) Chunk Uses

func (p Point2d) Chunk(size Point) ChunkPoint

Chunk returns the chunk space coordinate of the chunk containing the point.

func (Point2d) Distance Uses

func (p Point2d) Distance(x Point) int32

Distance returns the integer distance (rounding down).

func (Point2d) Div Uses

func (p Point2d) Div(x Point) (result Point)

Div returns the division of the receiver by the passed point.

func (Point2d) DivScalar Uses

func (p Point2d) DivScalar(value int32) Point

DivScalar divides this point by a scalar value.

func (Point2d) Duplicate Uses

func (p Point2d) Duplicate() Point

Duplicate returns a copy of the point without any pointer references.

func (Point2d) Max Uses

func (p Point2d) Max(x Point) (Point, bool)

Max returns a Point where each of its elements are the maximum of two points' elements.

func (Point2d) Min Uses

func (p Point2d) Min(x Point) (Point, bool)

Min returns a Point where each of its elements are the minimum of two points' elements.

func (Point2d) Mod Uses

func (p Point2d) Mod(x Point) (result Point)

Mod returns a point where each component is the receiver modulo the passed point's components.

func (Point2d) Modify Uses

func (p Point2d) Modify(settings map[uint8]int32) Point

Modify returns a copy of the point with the given (dim, value) components modified.

func (Point2d) Mult Uses

func (p Point2d) Mult(x Point) (result Point)

Mult returns the multiplication of the receiver by the passed point.

func (Point2d) NumDims Uses

func (p Point2d) NumDims() uint8

NumDims returns the dimensionality of this point.

func (Point2d) PointInChunk Uses

func (p Point2d) PointInChunk(size Point) Point

PointInChunk returns a point in containing block (chunk) space for the given point.

func (Point2d) Prod Uses

func (p Point2d) Prod() int64

func (Point2d) String Uses

func (pt Point2d) String() string

func (Point2d) Sub Uses

func (p Point2d) Sub(x Point) Point

Sub returns the subtraction of the passed point from the receiver.

func (Point2d) Value Uses

func (p Point2d) Value(dim uint8) int32

Value returns the point's value for the specified dimension without checking dim bounds.

type Point3d Uses

type Point3d [3]int32

Point3d is an ordered list of three 32-bit signed integers that implements the Point interface.

func GetPoint3dFrom2d Uses

func GetPoint3dFrom2d(plane DataShape, p2d Point2d, fill int32) (Point3d, error)

GetPoint3dFrom2d returns a 3d point from a 2d point in a plane. The fill is used for the dimension not on the plane.

func StringToPoint3d Uses

func StringToPoint3d(str, separator string) (Point3d, error)

StringToPoint3d parses a string of format "%d<sep>%d<sep>%d,..." into a Point3d

func (Point3d) Add Uses

func (p Point3d) Add(x Point) Point

Add returns the addition of two points.

func (Point3d) Add3d Uses

func (p Point3d) Add3d(p2 Point3d) Point3d

Add3d returns the addition of a Point3d.

func (Point3d) AddScalar Uses

func (p Point3d) AddScalar(value int32) Point

AddScalar adds a scalar value to this point.

func (Point3d) Bytes Uses

func (p Point3d) Bytes() []byte

Bytes returns a byte representation of the Point3d in little endian format.

func (Point3d) CheckedValue Uses

func (p Point3d) CheckedValue(dim uint8) (int32, error)

CheckedValue returns the point's value for the specified dimension and checks dim bounds.

func (Point3d) Chunk Uses

func (p Point3d) Chunk(size Point) ChunkPoint

Chunk returns the chunk space coordinate of the chunk containing the point.

func (Point3d) ChunkIndexer Uses

func (p Point3d) ChunkIndexer(size Point3d) ChunkIndexer

ChunkIndexer returns an chunk indexer from a 3d point.

func (Point3d) Distance Uses

func (p Point3d) Distance(x Point) int32

Distance returns the integer distance (rounding down).

func (Point3d) Div Uses

func (p Point3d) Div(x Point) (result Point)

Div returns the division of the receiver by the passed point.

func (Point3d) DivScalar Uses

func (p Point3d) DivScalar(value int32) Point

DivScalar divides this point by a scalar value.

func (Point3d) Duplicate Uses

func (p Point3d) Duplicate() Point

Duplicate returns a copy of the point without any pointer references.

func (Point3d) Equals Uses

func (p Point3d) Equals(p2 Point3d) bool

func (Point3d) Expand2d Uses

func (p Point3d) Expand2d(plane DataShape, size Point2d) (Point3d, error)

Expand2d returns a 3d point increased by given size in the given plane

func (*Point3d) FromZYXBytes Uses

func (p *Point3d) FromZYXBytes(zyx []byte) error

FromZYXBytes sets a point from an encoded slice.

func (Point3d) Less Uses

func (p Point3d) Less(p2 Point3d) bool

func (Point3d) MapKey Uses

func (p Point3d) MapKey() string

func (Point3d) Max Uses

func (p Point3d) Max(x Point) (Point, bool)

Max returns a Point where each of its elements are the maximum of two points' elements.

func (Point3d) Min Uses

func (p Point3d) Min(x Point) (Point, bool)

Min returns a Point where each of its elements are the minimum of two points' elements.

func (Point3d) Mod Uses

func (p Point3d) Mod(x Point) (result Point)

Mod returns a point where each component is the receiver modulo the passed point's components.

func (Point3d) Modify Uses

func (p Point3d) Modify(settings map[uint8]int32) Point

Modify returns a copy of the point with the given (dim, value) components modified.

func (Point3d) Mult Uses

func (p Point3d) Mult(x Point) (result Point)

Div returns the multiplication of the receiver by the passed point.

func (Point3d) NumDims Uses

func (p Point3d) NumDims() uint8

NumDims returns the dimensionality of this point.

func (Point3d) Point3dInChunk Uses

func (p Point3d) Point3dInChunk(size Point3d) Point3d

Point3dInChunk returns a point in containing block (chunk) space for the given point.

func (Point3d) PointFromBytes Uses

func (p Point3d) PointFromBytes(b []byte) (readPt Point3d, err error)

PointFromBytes returns a Point3d from bytes. The passed point is used just to choose the appropriate byte decoding scheme.

func (Point3d) PointInChunk Uses

func (p Point3d) PointInChunk(size Point) Point

PointInChunk returns a point in containing block (chunk) space for the given point.

func (Point3d) Prod Uses

func (p Point3d) Prod() int64

func (*Point3d) SetMaximum Uses

func (p *Point3d) SetMaximum(p2 Point3d)

SetMaximum sets the point to the maximum elements of current and passed points.

func (*Point3d) SetMinimum Uses

func (p *Point3d) SetMinimum(p2 Point3d)

SetMinimum sets the point to the minimum elements of current and passed points.

func (Point3d) String Uses

func (p Point3d) String() string

func (Point3d) Sub Uses

func (p Point3d) Sub(x Point) Point

Sub returns the subtraction of the passed point from the receiver.

func (Point3d) ToBlockIZYXString Uses

func (p Point3d) ToBlockIZYXString(size Point3d) IZYXString

ToBlockIZYXString returns an encoded string for a point's block, suitable for use in maps.

func (Point3d) ToZYXBytes Uses

func (p Point3d) ToZYXBytes() []byte

ToZYXBytes returns the point in a byte slice format suitable for use as a map index, etc.

func (Point3d) Value Uses

func (p Point3d) Value(dim uint8) int32

Value returns the point's value for the specified dimension without checking dim bounds.

type PointNd Uses

type PointNd []int32

PointNd is a slice of N 32-bit signed integers that implements the Point interface.

func StringToPointNd Uses

func StringToPointNd(str, separator string) (nd PointNd, err error)

StringToPointNd parses a string of format "%d,%d,%d,..." into a slice of int32.

func (PointNd) Add Uses

func (p PointNd) Add(x Point) Point

Add returns the addition of two points.

func (PointNd) AddScalar Uses

func (p PointNd) AddScalar(value int32) Point

AddScalar adds a scalar value to this point.

func (PointNd) CheckedValue Uses

func (p PointNd) CheckedValue(dim uint8) (int32, error)

CheckedValue returns the point's value for the specified dimension and checks dim bounds.

func (PointNd) Chunk Uses

func (p PointNd) Chunk(size Point) ChunkPoint

Chunk returns the chunk space coordinate of the chunk containing the point.

func (PointNd) Distance Uses

func (p PointNd) Distance(x Point) int32

Distance returns the integer distance (rounding down).

func (PointNd) Div Uses

func (p PointNd) Div(x Point) Point

Div returns the division of the receiver by the passed point.

func (PointNd) DivScalar Uses

func (p PointNd) DivScalar(value int32) Point

DivScalar divides this point by a scalar value.

func (PointNd) Duplicate Uses

func (p PointNd) Duplicate() Point

Duplicate returns a copy of the point without any pointer references.

func (PointNd) Max Uses

func (p PointNd) Max(x Point) (Point, bool)

Max returns a Point where each of its elements are the maximum of two points' elements.

func (PointNd) Min Uses

func (p PointNd) Min(x Point) (Point, bool)

Min returns a Point where each of its elements are the minimum of two points' elements.

func (PointNd) Mod Uses

func (p PointNd) Mod(x Point) Point

Mod returns a point where each component is the receiver modulo the passed point's components.

func (PointNd) Modify Uses

func (p PointNd) Modify(settings map[uint8]int32) Point

Modify returns a copy of the point with the given (dim, value) components modified.

func (PointNd) Mult Uses

func (p PointNd) Mult(x Point) Point

Div returns the multiplication of the receiver by the passed point.

func (PointNd) NumDims Uses

func (p PointNd) NumDims() uint8

NumDims returns the dimensionality of this point.

func (PointNd) PointInChunk Uses

func (p PointNd) PointInChunk(size Point) Point

PointInChunk returns a point in containing block (chunk) space for the given point.

func (PointNd) Prod Uses

func (p PointNd) Prod() int64

func (PointNd) String Uses

func (p PointNd) String() string

func (PointNd) Sub Uses

func (p PointNd) Sub(x Point) Point

Sub returns the subtraction of the passed point from the receiver.

func (PointNd) Value Uses

func (p PointNd) Value(dim uint8) int32

Value returns the point's value for the specified dimension without checking dim bounds.

type RLE Uses

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

RLE is a single run-length encoded span with a start coordinate and length along a coordinate (typically X).

func NewRLE Uses

func NewRLE(start Point3d, length int32) RLE

func (RLE) Excise Uses

func (rle RLE) Excise(rle2 RLE) RLEs

Excise returns the portion of the receiver that is not in the passed RLE. If the RLEs do not intersect, nil is returned. Up to two fragments can be generated and they will be in sorted in start X.

func (*RLE) Extend Uses

func (rle *RLE) Extend(n int32)

func (RLE) GetRangeIZYXString Uses

func (rle RLE) GetRangeIZYXString() (beg, end IZYXString)

func (RLE) Intersects Uses

func (rle RLE) Intersects(rle2 RLE) bool

func (RLE) Length Uses

func (rle RLE) Length() int32

func (RLE) Less Uses

func (rle RLE) Less(rle2 RLE) bool

func (RLE) MarshalBinary Uses

func (rle RLE) MarshalBinary() ([]byte, error)

MarshalBinary fulfills the encoding.BinaryMarshaler interface.

func (RLE) StartPt Uses

func (rle RLE) StartPt() Point3d

func (RLE) String Uses

func (rle RLE) String() string

func (*RLE) UnmarshalBinary Uses

func (rle *RLE) UnmarshalBinary(b []byte) error

UnmarshalBinary fulfills the encoding.BinaryUnmarshaler interface.

func (RLE) Within Uses

func (rle RLE) Within(pt Point3d) bool

func (RLE) WriteTo Uses

func (rle RLE) WriteTo(w io.Writer) (n int64, err error)

WriteTo fulfills the io.WriterTo interface.

type RLEs Uses

type RLEs []RLE

RLEs are simply a slice of RLE. Sorting only takes into account the start point and not the length.

func ReadRLEs Uses

func ReadRLEs(r io.Reader) (RLEs, error)

func (*RLEs) Add Uses

func (rles *RLEs) Add(rles2 RLEs) (voxelsAdded int64)

Add adds the given RLEs to the receiver when there's a possibility of overlapping RLEs. If you are guaranteed the RLEs are disjoint, e.g., the passed and receiver RLEs are in different subvolumes, then just concatenate the RLEs instead of calling this function. The returned "voxelsAdded" gives the # of non-overlapping voxels added. TODO: If this is a bottleneck, employ better than this brute force insertion method.

func (RLEs) FitToBounds Uses

func (rles RLEs) FitToBounds(bounds *OptionalBounds) RLEs

FitToBounds returns a copy that has been adjusted to fit within the given optional bounds.

func (RLEs) Len Uses

func (rles RLEs) Len() int

func (RLEs) Less Uses

func (rles RLEs) Less(i, j int) bool

func (RLEs) MarshalBinary Uses

func (rles RLEs) MarshalBinary() ([]byte, error)

MarshalBinary fulfills the encoding.BinaryMarshaler interface.

func (RLEs) Normalize Uses

func (rles RLEs) Normalize() RLEs

Normalize returns a sorted slice of RLEs where there are no directly adjacent RLEs along X.

func (RLEs) Offset Uses

func (rles RLEs) Offset(offset Point3d) (out RLEs)

Offset returns RLEs that have been offset by negative of given point.

func (RLEs) Partition Uses

func (rles RLEs) Partition(blockSize Point3d) (BlockRLEs, error)

Partition splits RLEs up into block-sized RLEs using the given block size. The return is a map of RLEs with stringified ZYX block coordinate keys.

func (RLEs) Split Uses

func (rles RLEs) Split(splits RLEs) (RLEs, error)

Split removes RLEs, which must be a subset of current RLEs, from the receiver and returns the remainder.

func (RLEs) Stats Uses

func (rles RLEs) Stats() (numVoxels uint64, numRuns int32)

Stats returns the total number of voxels and runs.

func (RLEs) Swap Uses

func (rles RLEs) Swap(i, j int)

func (*RLEs) UnmarshalBinary Uses

func (rles *RLEs) UnmarshalBinary(b []byte) error

UnmarshalBinary fulfills the encoding.BinaryUnmarshaler interface.

func (*RLEs) UnmarshalBinaryReader Uses

func (rles *RLEs) UnmarshalBinaryReader(r io.Reader, numRLEs uint32) error

UnmarshalBinaryReader reads from a reader instead of a static slice of bytes. This will likely be more efficient for very large RLEs that are being streamed into the server.

func (RLEs) Within Uses

func (rles RLEs) Within(pts []Point3d) (in []int)

Within returns a slice of indices to the given pts that are within the RLEs.

type RepoID Uses

type RepoID LocalID32

RepoID is a DVID server-specific identifier for a particular Repo. Valid RepoIDs should be greater than 0.

func RepoIDFromBytes Uses

func RepoIDFromBytes(b []byte) RepoID

RepoIDFromBytes returns a RepoID from the start of the slice and the number of bytes used. Note: No error checking is done to ensure byte slice has sufficient bytes for RepoID.

func (RepoID) Bytes Uses

func (id RepoID) Bytes() []byte

Bytes returns a sequence of bytes encoding this RepoID. Binary representation is big-endian to preserve lexicographic order.

type Resolution Uses

type Resolution struct {
    // Resolution of voxels in volume
    VoxelSize NdFloat32

    // Units of resolution, e.g., "nanometers"
    VoxelUnits NdString
}

func (Resolution) IsIsotropic Uses

func (r Resolution) IsIsotropic() bool

Returns true if resolution in all dimensions is equal.

type Response Uses

type Response struct {
    ContentType string
    Text        string
    Status      string
}

Response provides a few string fields to pass information back from a remote operation.

type SerializationFormat Uses

type SerializationFormat uint8

SerializationFormat combines both compression and checksum methods. First 3 bits specifies compression, next 2 bits is the checkum, and the final 3 bits is reserved for future use.

func EncodeSerializationFormat Uses

func EncodeSerializationFormat(compress Compression, checksum Checksum) SerializationFormat

type SimplePoint Uses

type SimplePoint interface {
    // NumDims returns the dimensionality of this point.
    NumDims() uint8

    // Value returns the point's value for the specified dimension without checking dim bounds.
    Value(dim uint8) int32
}

type Span Uses

type Span [4]int32

Span is (Z, Y, X0, X1). TODO -- Consolidate with dvid.RLE since both handle run-length encodings in X, although dvid.RLE handles voxel coordinates not block (chunk) coordinates.

func (*Span) Extends Uses

func (s *Span) Extends(x, y, z int32) bool

Extends returns true and modifies the span if the given point is one more in x direction than this span. Else it returns false.

func (Span) Includes Uses

func (s Span) Includes(block ChunkPoint3d) bool

func (Span) Less Uses

func (s Span) Less(s2 Span) bool

func (Span) LessChunkPoint3d Uses

func (s Span) LessChunkPoint3d(block ChunkPoint3d) bool

func (Span) String Uses

func (s Span) String() string

func (Span) Unpack Uses

func (s Span) Unpack() (z, y, x0, x1 int32)

type Spans Uses

type Spans []Span

Spans is a slice of Span

func (Spans) Blocks Uses

func (s Spans) Blocks(size Point3d) IZYXSlice

Blocks returns an unsorted list of blocks spanned by the spans.

func (Spans) Count Uses

func (s Spans) Count() uint64

Count returns the number of elements spanned by the spans.

func (Spans) Extents Uses

func (s Spans) Extents() (offset, size Point3d)

Extents returns the offset and size of the bounding box traversed by the receiver Spans.

func (Spans) Len Uses

func (s Spans) Len() int

func (Spans) Less Uses

func (s Spans) Less(i, j int) bool

func (Spans) MarshalBinary Uses

func (s Spans) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface. It returns a binary serialization of the RLEs for the spans with the first 4 bytes corresponding to the number of spans.

func (Spans) Normalize Uses

func (s Spans) Normalize() Spans

Normalize returns a sorted and merged list of Span. Spans are in z, y, then x order. Any adjacent spans are merged into a larger span.

func (Spans) Swap Uses

func (s Spans) Swap(i, j int)

func (*Spans) UnmarshalBinary Uses

func (s *Spans) UnmarshalBinary(b []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface

func (Spans) VoxelCounts Uses

func (s Spans) VoxelCounts(size Point3d) map[IZYXString]uint32

VoxelCounts returns a map of blocks spanned by the spans and the number of voxels within each block encompassed by spans.

type SparseVol Uses

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

SparseVol represents a collection of voxels that may be in an arbitrary shape and have a label. It is particularly good for storing sparse voxels that may traverse large amounts of space.

func (*SparseVol) AddRLE Uses

func (vol *SparseVol) AddRLE(rles RLEs)

AddRLE adds an RLE to a SparseVol.

func (*SparseVol) AddSerializedRLEs Uses

func (vol *SparseVol) AddSerializedRLEs(encoding []byte) error

AddSerializedRLEs adds binary encoding of RLEs to SparseVol.

func (*SparseVol) Clear Uses

func (vol *SparseVol) Clear()

func (*SparseVol) Label Uses

func (vol *SparseVol) Label() uint64

func (*SparseVol) MaximumPoint3d Uses

func (vol *SparseVol) MaximumPoint3d() Point3d

func (*SparseVol) MinimumPoint3d Uses

func (vol *SparseVol) MinimumPoint3d() Point3d

func (*SparseVol) NumVoxels Uses

func (vol *SparseVol) NumVoxels() uint64

func (*SparseVol) RLEs Uses

func (vol *SparseVol) RLEs() RLEs

func (*SparseVol) SetLabel Uses

func (vol *SparseVol) SetLabel(label uint64)

func (*SparseVol) Size Uses

func (vol *SparseVol) Size() Point3d

func (*SparseVol) SurfaceSerialization Uses

func (vol *SparseVol) SurfaceSerialization(blockNz int32, res NdFloat32) ([]byte, error)

SurfaceSerialization returns binary-encoded surface data with the following format:

First 4 bytes (little-endian) # voxels (N)
Array of N vertices, each with 3 little-endian float32 (x,y,z)
Array of N normals, each with 3 little-endian float32 (nx,ny,nz)

The blockNz parameter is necessary since underlying RLEs in the SparseVol are ordered by blocks in Z but not within a block, so RLEs can have different Z within a block.

type Store Uses

type Store interface {
    fmt.Stringer
    StoreCloser
    StoreIdentifiable
}

Store allows polyglot persistence of data. The Store implementation could be an ordered key-value database, graph store, etc.

type StoreCloser Uses

type StoreCloser interface {
    Close()
}

StoreCloser stores can be closed.

type StoreConfig Uses

type StoreConfig struct {
    Config

    // Engine is a simple name describing the engine, e.g., "basholeveldb"
    Engine string
}

StoreConfig is a store-specific configuration where each store implementation defines the types of parameters it accepts.

type StoreIdentifiable Uses

type StoreIdentifiable interface {
    // Equal returns true if this store matches the given store configuration.
    Equal(StoreConfig) bool
}

StoreIdentifiable stores can say whether they are identified by a given store configuration.

type Subsetter Uses

type Subsetter interface {
    // MaximumExtents returns a range of indices for which data is available at
    // some DVID server.
    MaximumExtents() IndexRange

    // AvailableExtents returns a range of indices for which data is available
    // at this DVID server.  It is the currently available extents.
    AvailableExtents() IndexRange
}

Subsetter can tell us its range of Index and how much it has actually available in this server. It's used to implement limited cloning, e.g., only cloning a quarter of an image volume. TODO: Fulfill implementation for voxels data type.

type Subvolume Uses

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

Subvolume describes a 3d box Geometry. The "Sub" prefix emphasizes that the data is usually a smaller portion of the volume held by the DVID datastore. Note that the 3d coordinate system is assumed to be a Right-Hand system like OpenGL.

func NewSubvolume Uses

func NewSubvolume(offset, size Point) *Subvolume

NewSubvolume returns a Subvolume given a subvolume's origin and size.

func NewSubvolumeFromStrings Uses

func NewSubvolumeFromStrings(offsetStr, sizeStr, sep string) (*Subvolume, error)

NewSubvolumeFromStrings returns a Subvolume given string representations of offset ("0,10,20") and size ("250,250,250").

func (*Subvolume) DataShape Uses

func (s *Subvolume) DataShape() DataShape

func (*Subvolume) EndPoint Uses

func (s *Subvolume) EndPoint() Point

func (*Subvolume) NewIndexZYXIterator Uses

func (s *Subvolume) NewIndexZYXIterator(chunkSize Point) (IndexIterator, error)

NewIndexZYXIterator returns an iterator that can move across subvolume.

func (*Subvolume) NumVoxels Uses

func (s *Subvolume) NumVoxels() int64

func (*Subvolume) Size Uses

func (s *Subvolume) Size() Point

func (*Subvolume) StartPoint Uses

func (s *Subvolume) StartPoint() Point

func (*Subvolume) String Uses

func (s *Subvolume) String() string

type TimeLog Uses

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

TimeLog adds elapsed time to logging. Example:

mylog := NewTimeLog()
...
mylog.Debugf("stuff happened")  // Appends elapsed time from NewTimeLog() to message.

func NewTimeLog Uses

func NewTimeLog() TimeLog

func (TimeLog) Criticalf Uses

func (t TimeLog) Criticalf(format string, args ...interface{})

func (TimeLog) Debugf Uses

func (t TimeLog) Debugf(format string, args ...interface{})

func (TimeLog) Errorf Uses

func (t TimeLog) Errorf(format string, args ...interface{})

func (TimeLog) Infof Uses

func (t TimeLog) Infof(format string, args ...interface{})

func (TimeLog) Shutdown Uses

func (t TimeLog) Shutdown()

func (TimeLog) Warningf Uses

func (t TimeLog) Warningf(format string, args ...interface{})

type TypeString Uses

type TypeString string

TypeString is a string that is the name of a DVID data type.

type URLString Uses

type URLString string

URLString is a string representing a URL.

type UUID Uses

type UUID string

UUID is a 32 character hexidecimal string ("" if invalid) that uniquely identifies nodes in a datastore's DAG. We need universally unique identifiers to prevent collisions during creation of child nodes by distributed DVIDs: http://en.wikipedia.org/wiki/Universally_unique_identifier

func NewUUID Uses

func NewUUID() UUID

NewUUID returns a UUID

func StringToUUID Uses

func StringToUUID(s string) (UUID, error)

StringToUUID converts a string to a UUID, checking to make sure it is a 32 character hex string.

type UUIDSet Uses

type UUIDSet map[UUID]struct{}

UUIDSet is a set of UUIDs.

func (UUIDSet) Add Uses

func (uset UUIDSet) Add(uset2 UUIDSet)

Add adds a given UUIDSet to the receiver.

func (UUIDSet) Equals Uses

func (uset UUIDSet) Equals(uset2 UUIDSet) bool

Equals returns true if the two UUIDSets have the same elements.

type Vector3d Uses

type Vector3d [3]float64

Vector3d is a 3D vector of 64-bit floats, a recommended type for math operations.

func StringToVector3d Uses

func StringToVector3d(str, separator string) (Vector3d, error)

func (Vector3d) Add Uses

func (v Vector3d) Add(x Vector3d) Vector3d

func (Vector3d) Distance Uses

func (v Vector3d) Distance(x Vector3d) float64

Distance returns the distance between two points a and b.

func (Vector3d) DivideScalar Uses

func (v Vector3d) DivideScalar(x float64) Vector3d

func (*Vector3d) Increment Uses

func (v *Vector3d) Increment(x Vector3d)

func (Vector3d) String Uses

func (v Vector3d) String() string

func (Vector3d) Subtract Uses

func (v Vector3d) Subtract(x Vector3d) Vector3d

type VersionID Uses

type VersionID LocalID32

VersionID is a DVID server-specific identifier for a particular version or node of a repo's DAG. Valid VersionIDs should be greater than 0.

func VersionIDFromBytes Uses

func VersionIDFromBytes(b []byte) VersionID

VersionIDFromBytes returns a VersionID from the start of the slice and the number of bytes used. Note: No error checking is done to ensure byte slice has sufficient bytes for VersionID.

func (VersionID) Bytes Uses

func (id VersionID) Bytes() []byte

Bytes returns a sequence of bytes encoding this VersionID. Binary representation is big-endian to preserve lexicographic order.

type VersionMap Uses

type VersionMap map[VersionID]VersionID

type VertexID Uses

type VertexID uint64

VertexID is a 64 bit label ID for vertices in the graph

type VertexPairID Uses

type VertexPairID struct {
    Vertex1 VertexID
    Vertex2 VertexID
}

smaller ID should be first

Package dvid imports 44 packages (graph) and is imported by 71 packages. Updated 2019-06-20. Refresh now. Tools for package owners.