Skip to content

marcotag93/TractView

Repository files navigation

TractView Logo

TractView

A VS Code Extension for 3D Tractography Visualization

VS Code License TypeScript Three.js

View tractography files (.trk, .tck, .trx) directly in VS Code with interactive 3D visualization powered by Three.js.

FeaturesInstallationConfigurationAuthor


👤 Author

Marco TagliaferriPhD Candidate in Neuroscience 🏛️ Center for Mind/Brain Sciences (CIMeC), University of Trento, Italy

Email Email GitHub


✨ Features

Multi-Format Support

  • TRK — TrackVis format
  • TCK — MRtrix format
  • TRX — Modern ZIP-based format

Interactive Visualization

  • WebGL-powered 3D rendering
  • Orbit, zoom, and pan controls
  • Real-time brightness adjustment
  • Dark/light background toggle
  • 3D orientation cube with anatomical labels (R/L, A/P, S/I)

Rendering Modes

  • Lines — Fast wireframe rendering
  • Tubes — High-quality 3D tubes

Coloring Modes

  • Direction — RGB based on orientation (X=red, Y=green, Z=blue)
  • Length — Color gradient by streamline length
  • Scalar — Color by per-point scalar values (TRK only)

Smart Performance

  • Automatic skip sampling for large datasets
  • Configurable streamline limits
  • Optimized GPU rendering

Export Options

  • Screenshot — Save current view as PNG
  • Download — Export original file to new location

📦 Installation

From Source

# Clone the repository
git clone https://github.com/marcotag93/tractview.git
cd tractview

# Install dependencies
npm install

# Compile the extension
npm run compile

Press F5 in VS Code to launch the Extension Development Host.

From VSIX

  1. Download the .vsix release file
  2. Open VS Code → Extensions (Ctrl+Shift+X)
  3. Click ...Install from VSIX...
  4. Select the downloaded file

⚙️ Configuration

Access settings via File → Preferences → Settings → Extensions → TractView

Setting Default Description
tractview.maxStreamlines 100000 Maximum streamlines to render
tractview.skipThreshold 15000 Threshold for enabling skip sampling
tractview.backgroundColor #2d2d2d Default background color
tractview.defaultRenderMode lines Initial render mode
tractview.tubeRadius 0.3 Tube radius in tube mode

📂 Supported Formats

Format Extension Description
TrackVis .trk Binary format with 1000-byte header
MRtrix .tck Text header + binary float triplets
TRX .trx ZIP archive with JSON metadata

📄 License

This project is licensed under the MIT License — see the LICENSE file for details.


🙏 Acknowledgments


About

A VS Code Extension for 3D Tractography Visualization. View tractography files (`.trk`, `.tck`, `.trx`) directly in VS Code with interactive 3D visualization

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors