trk_to_annotation
This repository provides utilities for converting .trk tractography files into Neuroglancer precomputed annotation format, and serving them locally with HTTP requests.
Install
python -m build
pip install .
Usage
python -m trk_to_annotation <trk_file> \
--annotation_output_dir ./precomputed_annotations \
--segmentation_output_dir ./precomputed_segmentations \
--grid_densities 1 2 4 8 16
Arguments
| Argument | Required | Default | Description |
|---|---|---|---|
| trk_file | ✅ | — | Path to the input .trk file |
| --annotation_output_dir | ❌ | ./precomputed_annotations | Output directory for precomputed annotations |
| --segmentation_output_dir | ❌ | ./precomputed_annotations/precomputed_segmentations | Output directory for precomputed segmentations |
| --grid_densities | ❌ | [1, 2, 4, 8, 16] | Grid densities (powers of two, ascending order) |
Running server for neuroglancer
Run the following command in the directory with your outputted folders
python -m trk_to_annotation.http_server
You should now be able to access the annotation and segmentation layers on neuroglancer via http://localhost:8000/
Metadata
Release files for trk-to-annotation 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| trk_to_annotation-0.0.2.tar.gz | 15.5 kB | With provenance | Details for trk_to_annotation-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| trk_to_annotation-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for trk_to_annotation-0.0.2-py3-none-any.whl |
Total release size: 34.7 kB
Release files / trk_to_annotation-0.0.2.tar.gz
| Download URL | trk_to_annotation-0.0.2.tar.gz |
|---|---|
| Size | 15.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7d8c55ec829580cfb37c8c7af9bea85aab2ca26eb5dda50be7aab712f82be9b3
|
|
BLAKE2b-256 checksum How to use checksums |
290502dbe3512ea314752051644a71677a52aa011b21145c6baacf5db16efefc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 26, 2026.
Transparency logRelease files / trk_to_annotation-0.0.2-py3-none-any.whl
| Download URL | trk_to_annotation-0.0.2-py3-none-any.whl |
|---|---|
| Size | 19.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
82d77bf898d8b3d7d63c2699e9fa9e582883fcbead0943136e548ee39cf6d142
|
|
BLAKE2b-256 checksum How to use checksums |
8e53df1835e2842f440c44dc79498c20b3cdfa45e78088233a61ab28c3842baf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 26, 2026.
Transparency logSecurity for trk-to-annotation 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for trk_to_annotation-0.0.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 26, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.