Install & Compatibility
Where this runs
tested against v0.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 106.5MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 5.8s · import 0.000s · 102MB
114MB installed
● package 114MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
TRXFile
✓ from trx import TRXFile
✗ from trx.file import TRXFile
Minimal example: create a TRX file with two streamlines and read them back.
# Create a simple TRX file with two streamlines
import numpy as np
from trx.file import TRXFile
# Create two streamlines as arrays of 3D points
streamlines = [
np.array([[0,0,0], [1,0,0], [2,0,0]], dtype=np.float32),
np.array([[0,1,0], [1,1,0], [2,1,0]], dtype=np.float32)
]
# Write to file
with TRXFile('example.trx', mode='wb') as trx:
trx.write_streamlines(streamlines)
# Read back
with TRXFile('example.trx', mode='rb') as trx:
loaded = list(trx.read_streamlines())
print(f'Loaded {len(loaded)} streamlines')
Upgrade
Version history
0.4.0latest on PyPI · released Mar 5, 2026
Audit
Dependencies
numpyrequiredCore dependency for array operations
dipyoptionalOptional for integration with DIPY tractography workflows