trx-python
A community-oriented file format for tractography
Decision gist · record as of 2026-08-14
Yes. trx-python is worth installing if you work with tractography data in neuroimaging. It has low install friction, active maintenance, no known vulnerabilities, a permissive license, and fills a clear need for TRX format support. The CLI tools are convenient for one-off conversions and validation; the Python API integrates well into larger pipelines. The Alpha status reflects the format's maturity, not instability.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.11 or later.
- Large tractography files use memory-mapped temporary storage; ensure adequate disk space (several gigabytes possible) and set TRX_TMPDIR if default temp location is insufficient.
- Low friction: pure Python wheel with four runtime dependencies (deepdiff, nibabel, numpy, typer).
License · maintenance · safety
BSD License (permissive) — BSD License (permissive) — you can use, modify, and distribute this package freely in both open and closed projects with minimal restrictions.
last release 2026-03-05 (162 days) · last repo commit 2026-08-11 · 26 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 100,126 downloads/mo, #13,000 on PyPI
Alternatives
Verify before relying
pip install trx-python
from trx.io import load, save
trx = load("tractogram.trx")
save(trx, "output.trk")- Whether nibabel and numpy versions have known compatibility constraints with the supported Python versions.
- Performance characteristics and memory overhead when processing very large tractography files.
- Completeness of format support across all advertised file types (TRK, TCK, VTK, FIB, DPY) in practice.
What it is and what it does
trx-python is a Python library for working with TRX, a community-oriented file format for tractography data used in neuroimaging research. It provides both a programmatic API and a unified command-line interface for loading, saving, converting, validating, and concatenating tractography files. The library supports multiple input formats (TRX, TRK, TCK, VTK, FIB, DPY) and can export to any of these formats, making it useful for interoperability across neuroimaging pipelines.
The package depends on numpy for numerical operations, nibabel for neuroimaging file I/O, deepdiff for data comparison, and typer for CLI argument parsing. It uses memory-mapped files to handle large tractography datasets efficiently without loading entire files into RAM. The project is actively maintained, supports Python 3.11–3.13, and is licensed under the permissive BSD License.
Use it for
- Convert brain fiber tract data between TRX and legacy formats (TRK, TCK, VTK) in neuroimaging pipelines.
- Validate TRX tractography files for data integrity before processing or sharing with collaborators.
- Merge multiple tractography datasets into a single file using the concatenate command.
- Inspect TRX file metadata, headers, groups, and archive contents via the CLI info command.
- Integrate tractography I/O into Python-based neuroimaging analysis workflows.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
trx-python is worth installing if you work with tractography data in neuroimaging. It has low install friction, active maintenance, no known vulnerabilities, a permissive license, and fills a clear need for TRX format support. The CLI tools are convenient for one-off conversions and validation; the Python API integrates well into larger pipelines. The Alpha status reflects the format's maturity, not instability.
Install
trx-python on PyPI
Before you install
Low friction: pure Python wheel with four runtime dependencies (deepdiff, nibabel, numpy, typer). Active maintenance with a recent commit on 2026-08-11 and a release on 2026-03-05.
Requires Python 3.11 or later. Large tractography files use memory-mapped temporary storage; ensure adequate disk space (several gigabytes possible) and set TRX_TMPDIR if default temp location is insufficient.
License in practice
BSD License (permissive) — you can use, modify, and distribute this package freely in both open and closed projects with minimal restrictions.
Quickstart
pip install trx-python
from trx.io import load, save
trx = load("tractogram.trx")
save(trx, "output.trk")
Verify before relying
- Whether nibabel and numpy versions have known compatibility constraints with the supported Python versions.
- Performance characteristics and memory overhead when processing very large tractography files.
- Completeness of format support across all advertised file types (TRK, TCK, VTK, FIB, DPY) in practice.
Package facts
| License | BSD License permissive |
| Python support | Supports the current Python release >=3.11 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 4 packagesdeepdiffnibabelnumpytyper |
| Maintenance | Actively maintained 162 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 100,126 / month, #13,000 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 3 - AlphaEnvironment :: ConsoleIntended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Scientific/Engineering |
Evidence: trx_python-0.4.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “tractography file format python”
- trx-pythonReads, writes, and manipulates TRX tractography files in Python,…
- dipyDIPY is a Python library for analyzing diffusion MRI data, providing…
- RoffIORoffio reads and writes Roxar Open File Format (ROFF) files in both…
Give your agent the search over MCP, or paste the wish link into any chat.
More Scientific/Engineering packages
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
pandas provides fast, flexible data structures (Series and DataFrame) for loading, cleaning, transforming, and analyzing labeled or relational data in Python.
scipy provides numerical algorithms for mathematics, science, and engineering—including optimization, integration, linear algebra, Fourier transforms, signal and image processing, and ODE solvers—built on numpy arrays.
scikit-learn provides a comprehensive Python library for supervised and unsupervised machine learning, including classification, regression, clustering, dimensionality reduction, and model evaluation tools built on NumPy and SciPy.
Install it if you need to train, evaluate, or deploy supervised or unsupervised learning models.
dill extends Python's pickle module to serialize and deserialize a much wider range of Python objects, including functions, lambdas, classes, and interpreter sessions, to byte streams for storage or network transmission.
Multiprocess is an enhanced fork of Python's standard multiprocessing library that uses dill for better serialization, allowing you to spawn processes with a threading-like API and share complex objects between them.
Install it if you use multiprocessing and encounter pickle serialization limits with lambdas or complex objects.
See also dipy · pynrrd · mne-bids · hdx-python-utilities · bidsschematools · meshio · pyevtk · segyio · nibabel · pybids