Skeleton format¶
A skeleton representation of some or all segmented objects may be specified as a directory tree consisting of the following files:
info
file in JSON format specifying themetadata
.For each segment ID for which there is a skeleton representation, a segment data file specifying the encoded skeleton for a single segment.
The actual storage of the manifest and mesh fragment data depends on whether the unsharded or sharded format is used.
info
metadata file¶
The info
file is a JSON-format text file with the following schema:
- json PrecomputedSkeleton : object¶
Precomputed skeleton metadata
- Required members:¶
-
@type :
"neuroglancer_skeletons"
¶ Precomputed data kind.
-
transform : array[
12
] of number¶ 4x3 homogeneous coordinate transform matrix in row-major order from the stored model coordinate space to the model coordinate space. The “stored model” coordinate space is arbitrary. The “model” coordinate space should be in nanometers.
-
@type :
- Optional members:¶
- vertex_attributes : array of object¶
Additional per-vertex attributes.
- Optional members:¶
- id : string¶
Unique identifier of the attribute.
-
data_type :
"float32"
|"uint8"
|"int8"
|"uint16"
|"int16"
|"uint32"
|"int32"
¶ Attribute data type.
-
num_components : integer[
1
, +∞)¶ Number of components.
If
num_components
is greater than 1, the attribute is a vector.
- sharding : PrecomputedSharding¶
Sharding parameters.
If specified, indicates that the skeletons are stored in sharded format. If unspecified, the skeletons are stored in unsharded format as separate files.
- segment_properties : string¶
Relative path to the directory containing associated segment properties.
Note
This association does not apply transitively when this skeleton dataset itself is referenced via the precomputed volume
mesh
metadata property. Instead, the associated segment properties must be specified directly in the volume metadata.
Encoded skeleton file format¶
The skeleton representation for a single segment ID is a binary file with the following format:
num_vertices
: uint32le, specifies the number of vertices.num_edges
: uint32le, specifies the number of edges.vertex_positions
:3*num_vertices
float32le, as a C-order[num_vertices, 3]
array specifying thex
,y
, andz
vertex positions in “stored model” coordinates.edges
:2*num_edges
uint32le, as a C-order[num_edges, 2]
array specifying the source and target vertex index in the range[0, num_vertices)
.For each additional attribute in
vertex_attributes
:attribute_data
:num_vertices * num_components
elements of the specifieddata_type
in little-endian format.
Unsharded format¶
In the unsharded format, the encoded skeleton data is stored as a separate file
within the same directory as the info
file under the name
<segment-id>
, where <segment-id>
is the base-10 string
representation of the segment ID.
Sharded format¶
In the sharded format, the encoded skeleton
data is retrieved using the segment ID as the key. The shard files are stored in
the same directory as the info
file.