-
Complete Java Bridge: Full programmatic access to SNT's neuroanatomy toolkit from Python (via JPype and ScyJava), enabling integration of advanced tracing, analysis, and visualization capabilities into Python workflows
-
Consistent API: 1:1 correspondence with SNT's Java API while maintaining Python conventions, allowing developers familiar with either language to work efficiently
-
Full Type Annotation: Type hints for all methods and classes, enabling static type checking with mypy and improved code reliability
-
IDE Integration: Autocomplete, inline documentation, and parameter hints in VS Code, PyCharm, Spyder, and Jupyter notebooks through type stubs and docstrings
-
Performant: Lazy class loading minimizes initialization overhead, loading only required SNT components on demand
-
Native Python Converters: Automatic conversion between SNT objects and Python-native types (SNTChart → matplotlib figures; SNTTable → pandas DataFrames; ImageJ ImagePlus → NumPy arrays; Java Collections → Python lists/dicts, etc.)
-
Bleeding Edge: Requires building SNT from the main branch (stable release integration planned for SNT v5.0)
-
Early Stage Software: Limited test coverage and community validation: Expect potential bugs and breaking API changes
# 1. Clone the repository
git clone https://github.com/morphonets/pysnt.git
cd pysnt
# 2. Set up conda/mamba (if not already configured)
mamba config append channels conda-forge
mamba config set channel_priority strict
# 3. Create and activate the development environment
mamba env create -f environment-dev.yml
mamba activate pysnt-dev
# 4. Install PySNT in development mode
pip install -e .[dev]
# 5. Verify the setup
python -c "import pysnt; print('PySNT imported successfully!')"
# 6. Have a look at ./dev/README.md for common workflows
- Open this folder as a project in PyCharm
- Go to File → Settings → Project → Python Interpreter
- Select the 'pysnt' conda environment
- Open this folder in VS Code
- Install recommended extensions when prompted
- Select the 'pysnt' Python interpreter when prompted
- Make sure Spyder is installed in the 'pysnt' environment:
conda activate pysnt conda install spyder
- Launch Spyder from the activated environment
- Open this folder as a project: File → Open Project
pysnt/
├── src/pysnt/ # Main package source
├── tests/ # Test suite
├── scripts/ # Development scripts
├── docs/ # Documentation source
├── dev/ # Development utilities and templates
├── environment.yml # Environment specification (runtime)
└── environment-dev.yml # Environment specification (development)
- install-jdk - Java management
- matplotlib - Used extensively for plotting and figure creation
- numpy - Used throughout for array operations
- pyimagej - ImageJ integration
- scyjava - Core Java integration
- xarray - Dataset operations
- pyobjc-core; sys_platform == 'darwin' - macOS support
- cairosvg - SNTChart SVG to matplotlib conversion
- PyMuPDF - SNTChart PDF to matplotlib conversion
- pandas - DataFrame operations and SNTTable conversion
- pandasgui - Interactive DataFrame display
- 📖 Documentation: pysnt.readthedocs.io
- 💬 Forum: forum.image.sc/tag/snt
- 🐛 Issues: GitHub Issues