neuroglancer_precomputed
Driver¶
The neuroglancer_precomputed
driver provides access to Neuroglancer Precomputed format volumes backed by any supported Key-Value Storage Layer. It supports reading, writing, and creating new volumes.
Multiscale volumes are supported, but each scale must be opened individually.
JSON Schema¶
object
with members:
driver
Required
|
“neuroglancer_precomputed” |
||||||||||||||||||
context |
Specifies context resources that augment/override the parent context. |
||||||||||||||||||
dtype |
Specifies the data type. |
||||||||||||||||||
rank |
integer [0, ∞)
|
||||||||||||||||||
transform |
Specifies a transform. |
||||||||||||||||||
kvstore
Required
|
Specifies the underlying storage mechanism. |
||||||||||||||||||
path |
string (default is
“” )Path within the Key-Value Store specified by Example¶
"path/to/array"
|
||||||||||||||||||
open |
boolean Open an existing TensorStore. If neither |
||||||||||||||||||
create |
boolean (default is false )Create a new TensorStore. Specify |
||||||||||||||||||
delete_existing |
boolean (default is false )Delete any existing data at the specified path before creating a new TensorStore. Requires that |
||||||||||||||||||
allow_metadata_mismatch |
boolean (default is false )Allow a mismatch between the existing metadata and the metadata specified for creating a new TensorStore. Requires that |
||||||||||||||||||
cache_pool |
Context resource (default is
“cache_pool” )Specifies or references a previously defined cache_pool context resource. It is normally more convenient to specify a default |
||||||||||||||||||
data_copy_concurrency |
Context resource (default is
“data_copy_concurrency” )Specifies or references a previously defined data_copy_concurrency context resource. It is normally more convenient to specify a default |
||||||||||||||||||
recheck_cached_metadata |
Cache revalidation bound (default is
“open” )Time after which cached metadata is assumed to be fresh. Cached metadata older than the specified time is revalidated prior to use. The metadata is used to check the bounds of every read or write operation. Specifying |
||||||||||||||||||
recheck_cached_data |
Cache revalidation bound (default is
true )Time after which cached data is assumed to be fresh. Cached data older than the specified time is revalidated prior to being returned from a read operation. Partial chunk writes are always consistent regardless of the value of this option. The default value of |
||||||||||||||||||
scale_index |
integer [0, ∞)
Zero-based index of the scale to open or create. When opening an existing volume, this member may be specified to explicitly indicate the scale to open. Otherwise, the first scale matching the |
||||||||||||||||||
multiscale_metadata |
Scale-independent metadata. Specifies the scale-independent metadata of a new volume exactly as in the info file, except that not all members are required. Required when creating a new multiscale volume. When opening an existing volume or creating a new scale within an existing multiscale volume, specifies constraints on the existing metadata.
|
||||||||||||||||||
scale_metadata |
Per-scale metadata. Specifies the per-scale metadata of a new volume as in the info file, except that not all members are required, and the
|
Sharding JSON Schema¶
Specifies the sharded format within the scale_metadata
property.
object
with members:
@type
Required
|
“neuroglancer_uint64_sharded_v1” |
preshift_bits
Required
|
integer [0, 64]
Number of low-order bits of the chunk ID that do not contribute to the hashed chunk ID. |
hash
Required
|
“identity” | “murmurhash3_x86_128” |
minishard_bits
Required
|
integer [0, 64]
Number of bits of the hashed chunk ID that determine the minishard number. The number of minishards within each shard is equal to \(2^{\mathrm{minishard\_bits}}\). The minishard number is equal to bits |
shard_bits
Required
|
integer [0, 64]
Number of bits of the hashed chunk ID that determine the shard number. The number of shards is equal to \(2^{\mathrm{shard\_bits}}\). The shard number is equal to bits |
minishard_index_encoding |
“raw” | “gzip” (default is “raw” )Normally |
data_index_encoding |
“raw” | “gzip” (default is “raw” )Normally |
Example JSON specifications¶
{
"driver": "neuroglancer_precomputed",
"kvstore": {"driver": "gcs", "bucket": "my-bucket"},
"path": "path/to/volume"
}
{
"driver": "neuroglancer_precomputed",
"kvstore": {"driver": "gcs", "bucket": "my-bucket"},
"path": "path/to/volume",
"scale_index": 1
}
{
"driver": "neuroglancer_precomputed",
"kvstore": {"driver": "gcs", "bucket": "my-bucket"},
"path": "path/to/volume",
"scale_metadata": {
"resolution": [4, 4, 40]
}
}
{
"driver": "neuroglancer_precomputed",
"kvstore": {"driver": "gcs", "bucket": "my-bucket"},
"path": "path/to/volume",
"scale_metadata": {
"key": "4_4_40"
}
}
{
"driver": "neuroglancer_precomputed",
"kvstore": {"driver": "gcs", "bucket": "my-bucket"},
"path": "path/to/volume",
"scale_metadata": {
"size": [40000, 50000, 10000],
"encoding": "compressed_segmentation",
"compressed_segmentation_block_size": [8, 8, 8],
"chunk_size": [64, 64, 64],
"resolution": [8, 8, 40]
}
}
{
"driver": "neuroglancer_precomputed",
"kvstore": {"driver": "gcs", "bucket": "my-bucket"},
"path": "path/to/volume",
"multiscale_metadata": {
"type": "segmentation",
"data_type": "uint64",
"num_channels": 1
},
"scale_metadata": {
"size": [40000, 50000, 10000],
"encoding": "compressed_segmentation",
"compressed_segmentation_block_size": [8, 8, 8],
"chunk_size": [64, 64, 64],
"resolution": [8, 8, 40]
}
}
Limitations¶
Resizing is not supported.
Warning
Writing to volumes in the sharded format is supported, but because updating a shard requires rewriting it entirely, write operations may be very inefficient unless special care is taken:
It is most efficient to group writes by shard.
The temporary memory required to write a shard is 2 to 3 times the size of the shard. It is therefore advised that the shards be kept as small as possible (while still avoiding an excess number of objects in the underlying Key-Value Store).