API for datatypes derived from googlevoxels (github.com/janelia-flyem/dvid/datatype/googlevoxels) ================================================================================================= Command-line: $ dvid repo new googlevoxels Adds voxel support using Google BrainMaps API. Example: $ dvid repo 3f8c new googlevoxels grayscale volumeid=281930192:stanford jwtfile=/foo/myname-319.json Arguments: UUID Hexadecimal string with enough characters to uniquely identify a version node. data name Name of data to create, e.g., "mygrayscale" settings Configuration settings in "key=value" format separated by spaces. Required Configuration Settings (case-insensitive keys) volumeid The globally unique identifier of the volume within Google BrainMaps API. jwtfile Path to JSON Web Token file downloaded from http://console.developers.google.com. Under the BrainMaps API, visit the Credentials area, create credentials for a service account key, then download that JWT file. Optional Configuration Settings (case-insensitive keys) tilesize Default size in pixels along one dimension of square tile. If unspecified, 512. $ dvid googlevoxels volumes Contacts Google BrainMaps API and returns the available volume ids for a user identified by a JSON Web Token (JWT) file. Example: $ dvid googlevoxels volumes /foo/myname-319.json Arguments: jwtfile Path to JSON Web Token file downloaded from http://console.developers.google.com. Under the BrainMaps API, visit the Credentials area, create credentials for a service account key, then download that JWT file. ------------------ HTTP API (Level 2 REST): GET /node///help Returns data-specific help message. GET /node///info Retrieves characteristics of this data in JSON format. Example: GET /node/3f8c/grayscale/info Arguments: UUID Hexadecimal string with enough characters to uniquely identify a version node. data name Name of googlevoxels data. GET /node///tile///[?options] Retrieves a tile of named data within a version node. The default tile size is used unless the query string "tilesize" is provided. Example: GET /node/3f8c/grayscale/tile/xy/0/10_10_20 Arguments: UUID Hexadecimal string with enough characters to uniquely identify a version node. data name Name of data to add. dims The axes of data extraction in form "i_j_k,..." Example: "0_2" can be XZ. Slice strings ("xy", "xz", or "yz") are also accepted. scaling Value from 0 (original resolution) to N where each step is downres by 2. tile coord The tile coordinate in "x_y_z" format. See discussion of scaling above. Query-string options: tilesize Size in pixels along one dimension of square tile. noblanks If true, any tile request for tiles outside the currently stored extents will return a placeholder. format "png", "jpeg" (default: "png") jpeg allows lossy quality setting, e.g., "jpeg:80" (0 <= quality <= 100) png allows compression levels, e.g., "png:7" (0 <= level <= 9) GET /node///raw///[/][?queryopts] Retrieves either 2d images (PNG by default) or 3d binary data, depending on the dims parameter. The 3d binary data response has "Content-type" set to "application/octet-stream" and is an array of voxel values in ZYX order (X iterates most rapidly). Example: GET /node/3f8c/segmentation/raw/0_1/512_256/0_0_100/jpg:80 Returns a raw XY slice (0th and 1st dimensions) with width (x) of 512 voxels and height (y) of 256 voxels with offset (0,0,100) in JPG format with quality 80. By "raw", we mean that no additional processing is applied based on voxel resolutions to make sure the retrieved image has isotropic pixels. The example offset assumes the "grayscale" data in version node "3f8c" is 3d. The "Content-type" of the HTTP response should agree with the requested format. For example, returned PNGs will have "Content-type" of "image/png", and returned nD data will be "application/octet-stream". Arguments: UUID Hexadecimal string with enough characters to uniquely identify a version node. data name Name of data to add. dims The axes of data extraction in form "i_j_k,..." Slice strings ("xy", "xz", or "yz") are also accepted. Example: "0_2" is XZ, and "0_1_2" is a 3d subvolume. size Size in voxels along each dimension specified in . offset Gives coordinate of first voxel using dimensionality of data. format Valid formats depend on the dimensionality of the request and formats available in server implementation. 2D: "png", "jpg" (default: "png") jpg allows lossy quality setting, e.g., "jpg:80" nD: uses default "octet-stream". Query-string Options: compression Allows retrieval or submission of 3d data in "raw" (default) or "lz4" format. The 2d data will ignore this and use the image-based codec. scale Default is 0. For scale N, returns an image down-sampled by a factor of 2^N. throttle Only works for 3d data requests. If "true", makes sure only N compute-intense operation (all API calls that can be throttled) are handled. If the server can't initiate the API call right away, a 503 (Service Unavailable) status code is returned.