Installation¶
Prerequisites¶
Before installing fsatlas, ensure you have:
| Requirement | Version | Notes |
|---|---|---|
| Python | ≥ 3.10 | 3.11 and 3.12 also supported |
| FreeSurfer | 8.x | Must be installed and sourced |
FREESURFER_HOME |
— | Must be set in your environment |
SUBJECTS_DIR |
— | Must point to your subjects directory |
FreeSurfer Setup¶
If FreeSurfer is installed but not yet configured, add these lines to your shell profile (~/.bashrc or ~/.zshrc):
export FREESURFER_HOME=/path/to/freesurfer
source $FREESURFER_HOME/SetUpFreeSurfer.sh
export SUBJECTS_DIR=/path/to/your/subjects
Verify your setup:
freesurfer --version # should print FreeSurfer 8.x
echo $SUBJECTS_DIR # should print your subjects directory path
Install from PyPI¶
Verify the installation:
Install from Source¶
The [dev] extras install testing and linting tools (pytest, ruff, mypy).
Install with uv¶
uv is a fast Python package manager:
Or add to your project:
Atlas Cache¶
Built-in atlases are downloaded on first use and cached to:
This directory is managed automatically via platformdirs. You can pre-download any atlas before running a batch job:
Containers (No Local FreeSurfer Required)¶
If you don't have FreeSurfer installed locally, use a pre-built container image. Apptainer is recommended for HPC/cluster environments; Docker is convenient for local workstations.
Apptainer / Singularity (recommended for HPC)¶
Or build from the definition file in the repository:
Docker¶
See the Containers guide for full usage instructions and examples.
Development Setup¶
git clone https://github.com/GalKepler/fsatlas.git
cd fsatlas
pip install -e ".[dev]"
# Verify code quality tools
pytest --version
ruff --version
mypy --version
Run the test suite:
Lint and format: