Documentation ¶
Overview ¶
Package imagetile implements DVID support for imagetiles 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
- Variables
- type Data
- func (d *Data) ConstructTiles(uuidStr string, tileSpec TileSpec, request datastore.Request) error
- func (d *Data) DefaultTileSpec(uuidStr string) (TileSpec, error)
- func (d *Data) DoRPC(request datastore.Request, reply *datastore.Response) error
- func (d *Data) GetImage(ctx storage.Context, src *imageblk.Data, geom dvid.Geometry, isotropic bool) (*dvid.Image, error)
- func (d *Data) GetTile(ctx storage.Context, req tileReq) (image.Image, error)
- func (d *Data) GetTileKey(uuid dvid.UUID, ctx storage.Context, w http.ResponseWriter, r *http.Request, ...) (string, error)
- func (d *Data) GobDecode(b []byte) error
- func (d *Data) GobEncode() ([]byte, error)
- func (d *Data) Help() string
- func (d *Data) MarshalJSON() ([]byte, error)
- func (d *Data) PostTile(uuid dvid.UUID, ctx storage.Context, w http.ResponseWriter, r *http.Request, ...) error
- func (d *Data) Send(s message.Socket, roiname string, uuid dvid.UUID) error
- func (d *Data) ServeHTTP(uuid dvid.UUID, ctx *datastore.VersionedCtx, w http.ResponseWriter, ...)
- func (d *Data) ServeTile(uuid dvid.UUID, ctx storage.Context, w http.ResponseWriter, r *http.Request, ...) error
- type Format
- type IndexTile
- type LevelSpec
- type Properties
- type Scaling
- type SourceData
- type TileScaleSpec
- type TileSpec
- type Type
Constants ¶
const ( Version = "0.1" RepoURL = "github.com/janelia-flyem/dvid/datatype/imagetile" TypeName = "imagetile" )
const HelpMessage = `` /* 9344-byte string literal not displayed */
Variables ¶
var DefaultTileSize = dvid.Point3d{512, 512, 512}
var (
ErrNoMetadataSet = errors.New("Tile metadata has not been POSTed yet. GET requests require metadata to be POST.")
)
Functions ¶
This section is empty.
Types ¶
type Data ¶
type Data struct { *datastore.Data Properties }
Data embeds the datastore's Data and extends it with voxel-specific properties.
func (*Data) ConstructTiles ¶
func (*Data) DefaultTileSpec ¶
Returns the default tile spec that will fully cover the source extents and scaling 0 uses the original voxel resolutions with each subsequent scale causing a 2x zoom out.
func (*Data) GetImage ¶
func (d *Data) GetImage(ctx storage.Context, src *imageblk.Data, geom dvid.Geometry, isotropic bool) (*dvid.Image, error)
GetImage returns an image given a 2d orthogonal image description. Since imagetile 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) GetTileKey ¶
func (d *Data) GetTileKey(uuid dvid.UUID, ctx storage.Context, w http.ResponseWriter, r *http.Request, parts []string) (string, error)
GetTileKey returns the internal key as a hexadecimal string
func (*Data) MarshalJSON ¶
func (*Data) PostTile ¶
func (d *Data) PostTile(uuid dvid.UUID, ctx storage.Context, w http.ResponseWriter, r *http.Request, parts []string) error
PostTile stores a tile.
func (*Data) Send ¶
Send transfers all key-value pairs pertinent to this data type as well as the storage.DataStoreType for them.
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 sets an index from bytes.
type Properties ¶
type Properties struct { // Source of the data for these imagetile. Source dvid.InstanceName // 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 imagetile.Format Encoding Format // Quality is optional quality of encoding for jpeg, 1-100, higher is better. Quality int }
Properties are additional properties for keyvalue data instances beyond those in standard datastore.Data. These will be persisted to metadata storage.
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 imagetile specifications for each scale level.
type Type ¶
Type embeds the datastore's Type 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.Register(). 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 NewType ¶
func NewType() *Type
NewDatatype returns a pointer to a new voxels Datatype with default values set.
func (*Type) NewDataService ¶
func (dtype *Type) NewDataService(uuid dvid.UUID, id dvid.InstanceID, name dvid.InstanceName, c dvid.Config) (datastore.DataService, error)
NewData returns a pointer to new tile data with default values.