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
- Variables
- type Dataset
- func (dset *Dataset) BytesPerVoxel() int32
- func (dset *Dataset) ChunkHandler(chunkOp *datastore.ChunkOp)
- func (dset *Dataset) DoHTTP(w http.ResponseWriter, r *http.Request) error
- func (dset *Dataset) DoRPC(request datastore.Request, reply *datastore.Response) error
- func (dset *Dataset) GetImage(versionID dvid.LocalID, slice dvid.Geometry) (img image.Image, err error)
- func (dset *Dataset) GetVolume(versionID dvid.LocalID, vol dvid.Geometry) (data []byte, err error)
- func (dset *Dataset) NewIndexIterator(extents interface{}) datastore.IndexIterator
- func (dset *Dataset) NumChunkHandlers() int
- func (dset *Dataset) PutImage(versionID dvid.LocalID, img image.Image, slice dvid.Geometry) error
- func (dset *Dataset) ServerAdd(request datastore.Request, reply *datastore.Response) error
- func (dset *Dataset) SliceImage(v *Voxels, z int) (img image.Image, err error)
- func (dset *Dataset) TypeService() datastore.TypeService
- type Datatype
- type OpType
- type Operation
- func (pOp *Operation) DatasetService() datastore.DatasetService
- func (pOp *Operation) DatastoreService() *datastore.Service
- func (pOp *Operation) IndexIterator() datastore.IndexIterator
- func (pOp *Operation) IsReadOnly() bool
- func (pOp *Operation) Map() error
- func (pOp *Operation) VersionLocalID() dvid.LocalID
- func (pOp *Operation) Wait()
- func (pOp *Operation) WaitAdd()
- type Voxels
Constants ¶
const DefaultNumChunkHandlers = 8
DefaultNumChunkHandlers specifies the number of chunk handlers for each dataset of this data type.
const HelpMessage = `` /* 3107-byte string literal not displayed */
const RepoUrl = "github.com/janelia-flyem/dvid/datatype/voxels"
const Version = "0.7"
Variables ¶
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 ¶
Returns total number of bytes across all channels for a voxel.
func (*Dataset) ChunkHandler ¶
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) 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) 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 (*Dataset) ServerAdd ¶
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 ¶
SliceImage returns an image.Image for the z-th slice of the volume.
func (*Dataset) TypeService ¶
func (dset *Dataset) TypeService() datastore.TypeService
type Datatype ¶
/ 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) 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 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 (*Operation) IndexIterator ¶
func (pOp *Operation) IndexIterator() datastore.IndexIterator