voxels

package
v0.0.0-...-2551dc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2013 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

Package voxels implements DVID support for data using voxels as elements. A number of data types will embed this package and customize it using the "NumChannels" and "BytesPerVoxel" fields.

Index

Constants

View Source
const DefaultNumChunkHandlers = 8

DefaultNumChunkHandlers specifies the number of chunk handlers for each dataset of this data type.

View Source
const HelpMessage = `` /* 3107-byte string literal not displayed */
View Source
const RepoUrl = "github.com/janelia-flyem/dvid/datatype/voxels"
View Source
const Version = "0.7"

Variables

View Source
var DefaultBlockMax dvid.Point3d = dvid.Point3d{16, 16, 16}

DefaultBlockMax specifies the default size for each block of this data type.

Functions

This section is empty.

Types

type Dataset

type Dataset struct {
	*datastore.Dataset

	// Block size for this dataset
	BlockSize dvid.Point3d

	// Relative resolution of voxels in volume
	VoxelRes dvid.VoxelResolution

	// Units of resolution, e.g., "nanometers"
	VoxelResUnits dvid.VoxelResolutionUnits
}

Dataset embeds the datastore's Dataset and extends it with voxel-specific properties.

func (*Dataset) BytesPerVoxel

func (dset *Dataset) BytesPerVoxel() int32

Returns total number of bytes across all channels for a voxel.

func (*Dataset) ChunkHandler

func (dset *Dataset) ChunkHandler(chunkOp *datastore.ChunkOp)

ChunkHandler processes a chunk of data as part of a mapped operation. The data may be thinner, wider, and longer than the chunk, depending on the data shape (XY, XZ, etc)

func (*Dataset) DoHTTP

func (dset *Dataset) DoHTTP(w http.ResponseWriter, r *http.Request) error

DoHTTP handles all incoming HTTP requests for this dataset.

func (*Dataset) DoRPC

func (dset *Dataset) DoRPC(request datastore.Request, reply *datastore.Response) error

Do acts as a switchboard for RPC commands.

func (*Dataset) GetImage

func (dset *Dataset) GetImage(versionID dvid.LocalID, slice dvid.Geometry) (img image.Image, err error)

GetImage retrieves a 2d image from a version node given a geometry of voxels.

func (*Dataset) GetVolume

func (dset *Dataset) GetVolume(versionID dvid.LocalID, vol dvid.Geometry) (data []byte, err error)

func (*Dataset) NewIndexIterator

func (dset *Dataset) NewIndexIterator(extents interface{}) datastore.IndexIterator

NewIndexIterator returns an IndexIterator closure. The closure for this voxels data type uses VoxelCoord, BlockCoord, and returns an IndexZYX.

func (*Dataset) NumChunkHandlers

func (dset *Dataset) NumChunkHandlers() int

func (*Dataset) PutImage

func (dset *Dataset) PutImage(versionID dvid.LocalID, img image.Image, slice dvid.Geometry) error

PutImage adds a 2d image within given geometry to a version node.

func (*Dataset) ServerAdd

func (dset *Dataset) ServerAdd(request datastore.Request, reply *datastore.Response) error

ServerAdd adds a sequence of image files to an image version. The request contains arguments as follows:

<dataset name> server-add <uuid> <origin> <image filename glob> [plane=<plane>]

Example request string: "mygrayscale server-add 3f8c 0,0,100 /absolute/path/to/data/*.png"

dataset name: the name of a dataset created using the "dataset" command.
uuid: hexidecimal string with enough characters to uniquely identify a version node.
origin: 3d coordinate in the format "x,y,z".  Gives coordinate of top upper left voxel.
image filename glob: filenames of images, e.g., foo-xy-*.png
plane: xy (default), xz, or yz.

The image filename glob MUST BE absolute file paths that are visible to the server. This function is meant for mass ingestion of large data files, and it is inappropriate to read gigabytes of data just to send it over the network to a local DVID.

func (*Dataset) SliceImage

func (dset *Dataset) SliceImage(v *Voxels, z int) (img image.Image, err error)

SliceImage returns an image.Image for the z-th slice of the volume.

func (*Dataset) TypeService

func (dset *Dataset) TypeService() datastore.TypeService

type Datatype

type Datatype struct {
	datastore.Datatype
	NumChannels   int
	BytesPerVoxel int
}

/ Datatype embeds the datastore's Datatype to create a unique type with voxel functions. Refinements of general voxel types can be implemented by embedding this type, choosing appropriate # of channels and bytes/voxel, overriding functions as needed, and calling datastore.RegisterDatatype().

func NewDatatype

func NewDatatype() (dtype *Datatype)

NewDatatype returns a pointer to a new voxels Datatype with default values set.

func (*Datatype) Help

func (dtype *Datatype) Help() string

func (*Datatype) NewDataset

func (dtype *Datatype) NewDataset(id datastore.DatasetID, config dvid.Config) datastore.DatasetService

NewDataset returns a pointer to a new voxels Dataset with default values.

type OpType

type OpType uint8
const (
	GetOp OpType = iota
	PutOp
)

func (OpType) String

func (op OpType) String() string

type Operation

type Operation struct {
	*Dataset
	// contains filtered or unexported fields
}

Operation holds type-specific data for operations and can be used to map blocks to handlers.

func (*Operation) DatasetService

func (pOp *Operation) DatasetService() datastore.DatasetService

func (*Operation) DatastoreService

func (pOp *Operation) DatastoreService() *datastore.Service

func (*Operation) IndexIterator

func (pOp *Operation) IndexIterator() datastore.IndexIterator

func (*Operation) IsReadOnly

func (pOp *Operation) IsReadOnly() bool

func (*Operation) Map

func (pOp *Operation) Map() error

func (*Operation) VersionLocalID

func (pOp *Operation) VersionLocalID() dvid.LocalID

func (*Operation) Wait

func (pOp *Operation) Wait()

func (*Operation) WaitAdd

func (pOp *Operation) WaitAdd()

type Voxels

type Voxels struct {
	dvid.Geometry
	// contains filtered or unexported fields
}

Voxels represents subvolumes or slices.

func (*Voxels) String

func (v *Voxels) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL