TractX: pipeline, artifacts and bottleneck-resolution sketch
script → artifact map, otherwise i'm going to lose track of what produced what
FAISS loss sketch detaches to numpy... where are the gradients supposed to go? keep embedding training separate until that is answered
| Stage | Script named in journal | Artifact / purpose |
|---|---|---|
| Preprocessing | pre_proc.py |
denoised/preprocessed/unbiased dMRI |
| FOD estimation | fod_gen.py |
tissue FODs and normalized outputs |
| Template mask | sdTempMask.py |
shared analysis space |
| Density / cross-section | fba.py |
FD, FC, FDC |
| Tracking / SIFT | stream_gen.py |
whole-brain streamlines |
| Bundle segmentation | bundleseg.py |
bundle-specific tract files |
| Bottleneck detection | id_bottle.py |
overlapping fixels and surrounding voxels |
Permanent artifact folders: avgresponse, conversions, bundleseg, tdi_map; plus fixelattributes.txt. The main-file list includes wmfod_norm.mif, gm_norm.mif, csf_norm.mif and the preprocessed dMRI image.
Resolution idea: encode surrounding-voxel density, location and direction into feature vectors; compare candidate continuations using approximate nearest neighbors; fill gaps with local probabilistic tracking. The notes contain both PyNNDescent and FAISS sketches, so do not flatten them into one finalized implementation.
Important code caveat: the “FAISS loss” example detaches tensors into NumPy and leaves calculate_loss_from_neighbors undefined. It is a conceptual sketch, not evidence of an end-to-end differentiable training loop. Open question: what differentiable objective trains the embedding before nearest-neighbor lookup?

