Headers and attributes¶
The format headers each ingest keeps in a store, and the attributes each ingest writes.
Format headers¶
An ingest keeps source metadata that the geometry cannot hold as JSON in the
attributes of headers/<format>/zarr.json. Exports to the same family of
formats read it; they never add a header.
from zarr_vectors_tools.headers import HeaderRegistry
reg = HeaderRegistry("tracts.zv")
reg.available_formats # ['trk']
trk = reg.get("trk") # TRKHeader
trk.space, trk.voxel_size # ('voxmm', (2.0, 2.0, 2.0))
Header |
Written by |
Holds |
Read by |
|---|---|---|---|
|
trk; Python |
|
trk export; trx export (voxmm to RAS, and the reference when there is no |
|
trx |
|
trx export; trk export of a TRX-ingested store |
|
h5ad, table; extended by |
|
h5ad export; csv export (position column names) |
|
gifti, freesurfer; extended by CIFTI attach |
|
gifti export (required); precomputed export |
|
swc |
|
swc export |
|
obj with |
|
precomputed export (segment labels) |
|
csv |
|
csv export (position column names) |
|
Python |
|
nothing |
tck, ply, las, stl, lines, precomputed layers and zvtools synapses write no
header. zvtools merge stores a second header of the same format as
<format>@<source>, such as trk@subject_b (Merge).
Attributes each ingest writes¶
Paths are per level: <level>/vertex_attributes/<name> and
<level>/object_attributes/<name>. ×3 marks three columns per row. “Python”
marks options only the Python function has.
Input |
Vertex attributes |
Object attributes |
|---|---|---|
trk |
the file’s scalars (float32); |
the file’s properties (float32); |
tck |
none |
|
trx |
each |
each |
LINC trk (Python) |
the file’s scalars |
|
swc |
|
|
precomputed skeletons |
the layer’s vertex attributes, in their data types |
|
precomputed meshes |
none |
|
csv |
each non-position column (float32); |
none |
table |
each non-position, non-key column: numbers as read, text and categories as int32 codes (labels in the array’s |
none |
h5ad |
each obs column, as for table; |
none |
ply |
each non-position vertex property (float32); |
none |
las |
|
none |
lines |
none |
each column after the six endpoints (float32); |
edgelist, graphml |
each numeric node column (float32); Python |
none; edge columns go to |
obj |
|
none |
stl |
none |
none |
gifti, freesurfer |
each map (float32), each parcellation (int32 codes), |
none; one object per hemisphere, in a group |
|
|
|
zvtools attach adds vertex attributes encoded as for table and h5ad, or as
for gifti from CIFTI. Coarser levels: Pyramids.
Every store with objects also gets two arrays the viewer reads:
Array |
Type |
Holds |
|---|---|---|
|
uint32 |
The object’s vertex count at that level. Python |
|
uint64 |
One per fragment: the object’s |
Skeleton stores also get fragment_attributes/object_id.