Repository navigation
Unify and elaborate documentation #2
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
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
e6f7594
Starting to work on unifying documentation in one place.
arokem 5d95e85
Fix build folder path in actions.
arokem ffbf400
Adapt gitignore to new build location.
arokem 8102ef7
add bibliography. Fix GHA workflow.
arokem b6fe6dc
Try to mitigate attempts to deploy on PR commits.
arokem ab9268c
Much more content.
arokem 37636b8
More history.
arokem 71ffb03
More information about different software that supports TRX.
arokem d5a689e
More software projects.
arokem 8eff835
Adds side bar with links to all language implementations.
arokem e76733d
Add the template for link side bar.
arokem 2dc9866
More reorganizing. Provide links to spec.
arokem eb14da9
Merge branch 'main' into unify_docs
arokem 25d63d4
Potential fix for pull request finding
arokem e53735c
Potential fix for pull request finding
arokem 9e97765
Potential fix for pull request finding
arokem 1cfd578
Potential fix for pull request finding
arokem 9b4ece7
Potential fix for pull request finding
arokem 953d7b7
Potential fix for pull request finding
arokem e8ec303
Fix some review comments.
arokem fa11edb
Merge branch 'unify_docs' of github.com:tee-ar-ex/tee-ar-ex.github.io…
arokem 987c936
Adds instructions for building the website to README.
arokem b98001c
Simplify this section title.
arokem 3de2569
Make the TOC collapsible.
arokem d0d0e07
Tractography-specific compression + reference.
arokem 23abf40
Add a home link.
arokem a4130db
Make each section it's own dropdown.
arokem dcd7d9b
Adds links to TRX integration PRs across software projects.
arokem File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| .DS_Store | ||
| build/* | ||
| _build/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,56 @@ | ||
| # tee-ar-ex.github.io | ||
|
|
||
| A website for the TRX file format. | ||
| A website for the TRX file format, built with Sphinx and the MyST parser. | ||
|
|
||
| ## Building the documentation | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| - Python 3.9+ | ||
|
|
||
| ### Local build | ||
|
|
||
| 1. Clone the repository: | ||
|
|
||
| ```bash | ||
| git clone https://github.com/tee-ar-ex/tee-ar-ex.github.io.git | ||
| cd tee-ar-ex.github.io | ||
| ``` | ||
|
|
||
| 2. Create and activate a virtual environment (optional but recommended): | ||
|
|
||
| ```bash | ||
| python -m venv venv | ||
| source venv/bin/activate # Windows: venv\Scripts\activate | ||
| ``` | ||
|
|
||
| 3. Install dependencies: | ||
|
|
||
| ```bash | ||
| pip install -r requirements.txt | ||
| ``` | ||
|
|
||
| 4. Build the documentation: | ||
|
|
||
| ```bash | ||
| make html | ||
| ``` | ||
|
|
||
| 5. Open `_build/html/index.html` in your browser. | ||
|
|
||
| ### Development workflow | ||
|
|
||
| To rebuild automatically while editing: | ||
|
|
||
| ```bash | ||
| sphinx-autobuild source _build/html | ||
| ``` | ||
|
|
||
| Note: `sphinx-autobuild` needs to be installed separately | ||
| (`pip install sphinx-autobuild`). | ||
|
|
||
| ### Deployment | ||
|
|
||
| The site is automatically deployed to GitHub Pages via GitHub Actions on | ||
| pushes to `main`. Pull requests trigger a build to validate changes without | ||
| deploying. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| sphinx | ||
| myst-parser | ||
| pydata_sphinx_theme | ||
| pydata_sphinx_theme | ||
| sphinxcontrib-bibtex | ||
| sphinx-design |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| <div class="sidebar-implementation-links"> | ||
| <h3>TRX specification and implementations</h3> | ||
| <ul> | ||
| <li><a href="https://github.com/tee-ar-ex/trx-spec">TRX Specification</a></li> | ||
| <li><a href="https://tee-ar-ex.github.io/trx-python">Python</a></li> | ||
| <li><a href="https://tee-ar-ex.github.io/trx-cpp">C++</a></li> | ||
| <li><a href="https://tee-ar-ex.github.io/trx-rs">Rust</a></li> | ||
| <li><a href="https://tee-ar-ex.github.io/trx-javascript">JavaScript</a></li> | ||
| <li><a href="https://tee-ar-ex.github.io/trx-pascal">Pascal</a></li> | ||
| </ul> | ||
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # Bibliography | ||
|
|
||
|
|
||
| ```{eval-rst} | ||
|
|
||
| .. bibliography:: | ||
| :all: | ||
|
|
||
| ``` |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| # Core Concepts | ||
|
|
||
| This page explains how the TRX format represents tractography data on disk and | ||
| in memory. | ||
|
|
||
| ## The TRX format | ||
|
|
||
| A TRX file is a ZIP archive (or on-disk directory) whose layout directly | ||
| encodes its data model: | ||
|
|
||
| - `header.json` — spatial metadata | ||
| - `positions.<dim>.<dtype>` — all streamline vertices in a single flat array | ||
| - `offsets.<dtype>` — prefix-sum index from streamlines into positions | ||
| - `dpv/<name>.<dtype>` — per-vertex metadata arrays | ||
| - `dps/<name>.<dtype>` — per-streamline metadata arrays | ||
| - `groups/<name>.uint32` — named index sets of streamlines | ||
| - `dpg/<group>/<name>.<dtype>` — per-group metadata arrays | ||
|
|
||
| Coordinates are stored in **RAS+ world space** (millimeters), matching the | ||
| convention used by MRtrix3 `.tck` and NIfTI qform outputs. | ||
|
|
||
| ## Positions array | ||
|
|
||
| All streamline vertices are stored in a single flat matrix of shape | ||
| `(NB_VERTICES, 3)`. Keeping all vertices contiguous enables efficient memory | ||
| mapping and avoids per-streamline allocations. | ||
|
|
||
| ## Offsets and the sentinel | ||
|
|
||
| `offsets` is a prefix-sum index of length `NB_STREAMLINES + 1`. Element *i* is | ||
| the offset in `positions` of the first vertex of streamline *i*. The final | ||
| element is a **sentinel** equal to `NB_VERTICES`, which makes length | ||
| computation trivial without special-casing the last streamline: | ||
|
|
||
| ``` | ||
| length_i = offsets[i + 1] - offsets[i] | ||
| ``` | ||
|
|
||
| This design avoids per-streamline allocations and makes slicing the global | ||
| positions array fast and uniform. | ||
|
|
||
| ## Data per vertex (DPV) | ||
|
|
||
| A DPV array stores one value per vertex in `positions`. It has shape | ||
| `(NB_VERTICES, 1)` for scalar fields or `(NB_VERTICES, N)` for vector-valued | ||
| fields. Typical uses: | ||
|
|
||
| - FA values along the tract | ||
| - Per-point RGB colors | ||
| - Confidence or weight measures per vertex | ||
|
|
||
| DPV arrays live under `dpv/` and are memory-mapped in the same way as | ||
| `positions`. | ||
|
|
||
| ## Data per streamline (DPS) | ||
|
|
||
| A DPS array stores one value per streamline. It has shape | ||
| `(NB_STREAMLINES, 1)` or `(NB_STREAMLINES, N)`. Typical uses: | ||
|
|
||
| - Mean FA or average curvature per tract | ||
| - Per-streamline cluster labels | ||
| - Tractography algorithm weights | ||
|
|
||
| DPS arrays live under `dps/` and are loaded as typed matrix fields. If the | ||
| on-disk dtype differs from the requested typed reader dtype, values are | ||
| converted during load. | ||
|
|
||
| ## Groups | ||
|
|
||
| A group is a named list of streamline indices stored as a `uint32` array under | ||
| `groups/`. Groups enable sparse, overlapping labeling: a streamline can belong | ||
| to multiple groups, and groups can have different sizes. Typical uses: | ||
|
|
||
| - Bundle labels (`CST_L`, `CC`, `SLF_R`, ...) | ||
| - Cluster assignments from QuickBundles or similar algorithms | ||
| - Connectivity subsets (streamlines connecting two ROIs) | ||
|
|
||
| ## Data per group (DPG) | ||
|
|
||
| DPG attaches metadata to a group. Each group folder `dpg/<name>/` can contain | ||
| any number of scalar or vector arrays. Typical uses: | ||
|
|
||
| - Mean FA across the bundle | ||
| - Per-bundle display color | ||
| - Volume or surface-area estimates | ||
|
|
||
| ## Header | ||
|
|
||
| `header.json` stores: | ||
|
|
||
| - `VOXEL_TO_RASMM` — 4x4 affine mapping voxel indices to RAS+ world | ||
| coordinates (mm) | ||
| - `DIMENSIONS` — reference image grid dimensions as three `uint16` values | ||
| - `NB_STREAMLINES` — number of streamlines (`uint32`) | ||
| - `NB_VERTICES` — total number of vertices across all streamlines (`uint64`) | ||
|
|
||
| The header is primarily for human readability and downstream compatibility. The | ||
| authoritative sizes come from the array dimensions themselves. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.