Documentation ¶
Overview ¶
Package googlevoxels implements DVID support for multi-scale tiles and volumes in XY, XZ, and YZ orientation using the Google BrainMaps API.
Index ¶
- Constants
- Variables
- type Data
- func (d *Data) CopyPropertiesFrom(src datastore.DataService, fs storage.FilterSpec) error
- func (d *Data) DoRPC(request datastore.Request, reply *datastore.Response) error
- func (d *Data) GetClient() (*http.Client, error)
- func (d *Data) GetGoogleSubvolGeom(scaling Scaling, shape dvid.DataShape, offset dvid.Point3d, size dvid.Point) (*GoogleSubvolGeom, error)
- func (d *Data) GetVoxelSize(ts *GSpec) (dvid.NdFloat32, 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) ServeHTTP(uuid dvid.UUID, ctx *datastore.VersionedCtx, w http.ResponseWriter, ...) (activity map[string]interface{})
- type GSpec
- type Geometries
- type Geometry
- type GeometryIndex
- type GeometryMap
- type GoogleSubvolGeom
- type Properties
- type Scaling
- type Shape
- type Type
Constants ¶
const ( Version = "0.1" RepoURL = "github.com/janelia-flyem/dvid/datatype/googlevoxels" TypeName = "googlevoxels" )
Variables ¶
var ( DefaultTileSize int32 = 512 DefaultTileFormat string = "png" )
Functions ¶
This section is empty.
Types ¶
type Data ¶
type Data struct { *datastore.Data Properties // contains filtered or unexported fields }
Data embeds the datastore's Data and extends it with voxel-specific properties.
func (*Data) CopyPropertiesFrom ¶
func (d *Data) CopyPropertiesFrom(src datastore.DataService, fs storage.FilterSpec) error
CopyPropertiesFrom copies the data instance-specific properties from a given data instance into the receiver's properties. Fulfills the datastore.PropertyCopier interface.
func (*Data) GetClient ¶
GetClient returns a potentially cached client that handles authorization to Google. Assumes a JSON Web Token has been loaded into Data or else returns an error.
func (*Data) GetGoogleSubvolGeom ¶
func (d *Data) GetGoogleSubvolGeom(scaling Scaling, shape dvid.DataShape, offset dvid.Point3d, size dvid.Point) (*GoogleSubvolGeom, error)
GetGoogleSubvolGeom returns a google-specific voxel spec, which includes how the data is positioned relative to scaled volume boundaries. Not that the size parameter is the desired size and not what is required to fit within a scaled volume.
func (*Data) MarshalJSON ¶
type GSpec ¶
type GSpec struct {
// contains filtered or unexported fields
}
GSpec encapsulates the scale and orientation of a tile.
func (GSpec) MarshalBinary ¶
func (*GSpec) UnmarshalBinary ¶
type Geometries ¶
type Geometries []Geometry
type Geometry ¶
type Geometry struct { VolumeSize dvid.Point3d `json:"volumeSize"` ChannelCount uint32 `json:"channelCount"` ChannelType string `json:"channelType"` PixelSize dvid.NdFloat32 `json:"pixelSize"` }
Geometry corresponds to a Volume Geometry in Google BrainMaps API
func (*Geometry) UnmarshalJSON ¶
type GeometryIndex ¶
type GeometryIndex int
type GeometryMap ¶
type GeometryMap map[GSpec]GeometryIndex
GeometryMap provides a mapping from DVID scale (0 is highest res) and tile orientation to the specific geometry (Google "scale" value) that supports it.
func (GeometryMap) MarshalJSON ¶
func (gm GeometryMap) MarshalJSON() ([]byte, error)
type GoogleSubvolGeom ¶
type GoogleSubvolGeom struct {
// contains filtered or unexported fields
}
GoogleSubvolGeom encapsulates all information needed for voxel retrieval (aside from authentication) from the Google BrainMaps API, as well as processing the returned data.
func (GoogleSubvolGeom) GetURL ¶
func (gsg GoogleSubvolGeom) GetURL(volumeid, formatStr string) (url string, opts io.Reader, err error)
GetURL returns the base API URL for retrieving an image. Note that the authentication key or token needs to be added to the returned string to form a valid URL. The formatStr parameter is of the form "jpeg" or "jpeg:80" or "png:8" where an optional compression level follows the image format and a colon. Leave formatStr empty for default.
type Properties ¶
type Properties struct { // Necessary information to select data from Google BrainMaps API. VolumeID string JWT string // Default size in pixels along one dimension of square tile. TileSize int32 // GeomMap provides mapping between scale and various image shapes to Google scaling index. GeomMap GeometryMap // Scales is the list of available precomputed scales ("geometries" in Google terms) for this data. Scales Geometries // HighResIndex is the geometry that is the highest resolution among the available scaled volumes. HighResIndex GeometryIndex // contains filtered or unexported fields }
Properties are additional properties for keyvalue data instances beyond those in standard datastore.Data. These will be persisted to metadata storage.
func (Properties) MarshalJSON ¶
func (p Properties) MarshalJSON() ([]byte, error)
MarshalJSON handles JSON serialization for googlevoxels Data. It adds "Levels" metadata equivalent to imagetile's tile specification so clients can treat googlevoxels tile API identically to imagetile. Sensitive information like AuthKey are withheld.
type Scaling ¶
type Scaling uint8
Scaling describes the resolution where 0 is the highest resolution
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 googlevoxels data with default values.