--- id: trx-python version: "0.4.0" license: BSD License license_treatment: permissive maintenance: active --- # trx-python — A community-oriented file format for tractography License: permissive · Maintenance: active · Downloads: 100.1K/mo ## 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 above — verify before relying. Reads, writes, and manipulates TRX tractography files in Python, supporting conversion between TRX and other formats (TRK, TCK, VTK, FIB, DPY) with command-line tools for validation and concatenation. 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 pip install trx-python uv add trx-python poetry add trx-python ## Installing trx-python 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. 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") 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. 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_current - Install friction: low - Maintenance: active - Downloads: 100.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags tractography file format python, trx file reader writer, neuroimaging fiber tract tools, convert tractogram formats, trx cli command line, brain fiber tract processing, tractogram validation concatenation, neuroimaging, tractography, file-format [View on SkillFed](https://skillfed.io/packages/trx-python) · [View on PyPI](https://pypi.org/project/trx-python/)