Documentation ¶
Overview ¶
Package multiscale2d implements DVID support for multiscale2ds in XY, XZ, and YZ orientation. All raw tiles are stored as PNG images that are by default gzipped. This allows raw tile gets to be already compressed at the cost of more expensive uncompression to retrieve arbitrary image sizes.
Index ¶
- Constants
- type Data
- func (d *Data) ConstructTiles(uuidStr string, tileSpec TileSpec, config dvid.Config) error
- func (d *Data) DoHTTP(uuid dvid.UUID, w http.ResponseWriter, r *http.Request) error
- func (d *Data) DoRPC(request datastore.Request, reply *datastore.Response) error
- func (d *Data) GetImage(uuid dvid.UUID, geom dvid.Geometry, isotropic bool) (*dvid.Image, error)
- func (d *Data) GetTile(uuid dvid.UUID, shape dvid.DataShape, scaling Scaling, index dvid.IndexZYX) (image.Image, error)
- func (d *Data) JSONString() (jsonStr string, err error)
- func (d *Data) ServeTile(uuid dvid.UUID, w http.ResponseWriter, r *http.Request, ...) error
- type Datatype
- type Format
- type IndexTile
- type LevelSpec
- type Scaling
- type SourceData
- type TileScaleSpec
- type TileSpec
Constants ¶
const ( Version = "0.1" RepoUrl = "github.com/janelia-flyem/dvid/datatype/multiscale2d" )
const HelpMessage = `` /* 6475-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Data ¶
type Data struct { *datastore.Data // Source of the data for these multiscale2d. Source dvid.DataString // Levels describe the resolution and tile sizes at each level of resolution. Levels TileSpec // Placeholder, when true (false by default), will generate fake tile images if a tile cannot // be found. This is useful in testing clients. Placeholder bool // Encoding describes encoding of the stored tile. See multiscale2d.Format Encoding Format // Quality is optional quality of encoding for jpeg, 1-100, higher is better. Quality int }
Data embeds the datastore's Data and extends it with voxel-specific properties.
func (*Data) ConstructTiles ¶
func (*Data) GetImage ¶
GetImage returns an image given a 2d orthogonal image description. Since multiscale2d tiles have precomputed XY, XZ, and YZ orientations, reconstruction of the desired image should be much faster than computing the image from voxel blocks.
func (*Data) GetTile ¶
func (d *Data) GetTile(uuid dvid.UUID, shape dvid.DataShape, scaling Scaling, index dvid.IndexZYX) (image.Image, error)
GetTile returns an 2d tile image
func (*Data) JSONString ¶
JSONString returns the JSON for this Data's configuration
type Datatype ¶
Datatype embeds the datastore's Datatype to create a unique type with tile functions. Refinements of general tile types can be implemented by embedding this type, choosing appropriate # of channels and bytes/voxel, overriding functions as needed, and calling datastore.RegisterDatatype(). Note that these fields are invariant for all instances of this type. Fields that can change depending on the type of data (e.g., resolution) should be in the Data type.
func NewDatatype ¶
func NewDatatype() (dtype *Datatype)
NewDatatype returns a pointer to a new voxels Datatype with default values set.
func (*Datatype) NewDataService ¶
func (dtype *Datatype) NewDataService(id *datastore.DataID, config dvid.Config) ( datastore.DataService, error)
NewData returns a pointer to new tile data with default values.
type IndexTile ¶
IndexTile implements the Index interface and contains tile coordinates where (0,0,...) is at the coordinate (not index) origin. Tile coordinates are converted to unsigned integers when serialized to bytes.
func NewIndexTile ¶
func (IndexTile) IndexFromBytes ¶
IndexFromBytes returns an index from bytes. The passed Index is used just to choose the appropriate byte decoding scheme.
type Scaling ¶
type Scaling uint8
Scaling describes the scale level where 0 = original data resolution and higher levels have been downsampled.
type SourceData ¶
type SourceData interface{}
SourceData is the source of the tile data and should be voxels or voxels-derived data.
type TileScaleSpec ¶
type TileScaleSpec struct { LevelSpec // contains filtered or unexported fields }
TileScaleSpec is a slice of tile resolution & size for each dimensions.
type TileSpec ¶
type TileSpec map[Scaling]TileScaleSpec
TileSpec specifies the resolution & size of each dimension at each scale level.
func LoadTileSpec ¶
LoadTileSpec loads a TileSpec from JSON data. JSON data should look like:
{ "0": { "Resolution": [3.1, 3.1, 40.0], "TileSize": [512, 512, 40] }, "1": { "Resolution": [6.2, 6.2, 40.0], "TileSize": [512, 512, 80] }, ... }
Each line is a scale with a n-D resolution/voxel and a n-D tile size in voxels.
func (TileSpec) MarshalJSON ¶
MarshalJSON returns the JSON of the multiscale2d specifications for each scale level.