-
Notifications
You must be signed in to change notification settings - Fork 2
feat: create ostd format #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
At least for attributes, it might make more sense to represent units as a 7-tuple of fundamental physical values with their exponents. This could be packed into a uint32. The advantage is that this scheme would allow the user to represent almost any arbitrary unit within a certain range of exponent values (but I think values greater than 4 are pretty rare). For simplicity, it would be good to use a unified system, but for the header, only a length unit makes sense. A downside with this system is representing non-metric units is tricky, though how many people would be using imperial units that would be annoyed at having to convert them? |
Adds the
ostdfile format.Adds
Skeleton.to_osdtandSkeleton.from_osdt.Adds
osdtcommand line tool for converting, viewing, and printing info from skeleton files.Why osdt
The
ostdfile format fills a gap in existing skeleton file formats by offering a self-contained, high performance, bit-rot safe, binary format that supports optional vertex attributes for the serialization of skeletal structures. Incorporating metadata is not a design goal, as this core file is intended to be wrapped in a container file format for that purpose.Typically skeleton file formats represent the geometry in either text, JSON, or XML which uses excess space and requires a comparatively slow parser. Examples include SWC, CSV/TSV, NML, OBJ. In the case of SWC, it is not easily extensible with additional attributes. Other file formats are designed to handle multiple kinds of objects. SWC only supports trees, when some skeletons may include loops. Other formats, e.g. TRK, only support paths. Precomputed only supports a fully general (and space hungry) edge list.
Precomputed has most of the features one would desire, but is inflexible on the vertex and edge data types and also requires a separate info file to interpret the binary, so is not stand-alone. Furthermore, there is no indication of which physical scale to use (nanometers? micrometers?) which is a weakness of most of the other formats too. Precomputed also only supports an edge list representation, which is space inefficient. Precomputed smartly includes a 3x4 transform matrix for affine transforms to map from, e.g. voxel to physical space, but a fully forward-compatible design would use a 4x4 matrix capable of transforms using homogeneous coordinates, perspective transforms, and is more broadly compatible with graphics pipelines, especially since the matrix remains square.
Another design issue in Precomputed is that it specifies edges lists must be uint32 le, which on its face is a sensible tradeoff between space and maximum representable size, but many years later, we are finally encountering skeletons that are > 2^32 vertices (at least at certain stages of processing).
Run Time Information
Some vital statistics based on a flywire SWC.