Skip to content

morphonets/pysnt

Repository files navigation

SNT

PySNT

Python wrapper for SNT, the ImageJ framework for Neuroanatomy

⚠️ This project remains experimental. Feedback welcome! ⚠️

Technical Features

  • Complete Java bridge: Access all SNT Java classes from Python
  • Consistent API: 1:1 correspondence with SNT's java API
  • Type hints: Type annotation support with .pyi files
  • IDE support: Auto-completion in IDEs
  • Dynamic loading: Lazy loading of Java classes for better performance
  • Development Tools: Utilities to res

Limitations

  • Headless operations only
  • May require unreleased versions of SNT
  • Mostly untested

Getting Started for Developers

Environment Setup

# 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

IDE Configuration

PyCharm

  1. Open this folder as a project in PyCharm
  2. Go to File → Settings → Project → Python Interpreter
  3. Select the 'pysnt' conda environment

VS Code

  1. Open this folder in VS Code
  2. Install recommended extensions when prompted
  3. Select the 'pysnt' Python interpreter when prompted

Spyder

  1. Make sure Spyder is installed in the 'pysnt' environment:
     conda activate pysnt
     conda install spyder
  2. Launch Spyder from the activated environment
  3. Open this folder as a project: File → Open Project

Project Structure

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)

Need Help?

Releases

No releases published

Packages

No packages published

Languages