prfmodel
A modern Python implementation for population receptive field modelling.
Description
A modern Python implementation for population receptive field model fitting.
Getting started
See our online documentation on how to get started with prfmodel.
Installation
Requirements: prfmodel requires Python version >= 3.10 and <= 3.13.
prfmodel is available on PyPI. The package relies on Keras for multi-backend model fitting. At least one backend must be installed to use prfmodel.
To install prfmodel with the Tensorflow backend, run:
python -m pip install "prfmodel[tensorflow]"
To install it with the PyTorch backend, run:
python -m pip install "prfmodel[torch]"
To install it with the JAX backend, run:
python -m pip install "prfmodel[jax]"
The quotes around prfmodel[...] are needed in some shells (e.g., zsh, the default shell on macOS), which would
otherwise interpret the square brackets.
To install the latest development version from GitHub instead, run:
python -m pip install "prfmodel[tensorflow] @ git+https://github.com/popylar-org/prfmodel.git"
The default backend in Keras is Tensorflow, but this can be changed by setting the KERAS_BACKEND environment
variable, for example, at the beginning of a Python script or Jupyter notebook:
import os
os.environ["KERAS_BACKEND"] = "jax"
import prfmodel
Important: The backend must be set before importing prfmodel or keras. See the Keras documentation for details.
Documentation
The online documentation is available at: https://popylar-org.github.io/prfmodel/.
The local documentation can be build as HTML files with:
# In prfmodel directory
cd docs/
make html
The documentation can then be opened in the browser from _build/html/index.html.
Development
Practical information on developing prfmodel can be found in README.dev.md. For more in-depth information
about architecture and implementation decisions, see the Development section in the online documentation.
Credits
This package was created with Copier and the NLeSC/python-template.
The model fitting workflow in prfmodel was inspired by braincoder.
Generative AI usage
Claude Code (Opus version 4.5 - 5.0) was used to partially generate and improve code in prfmodel. All improvements were manually evaluated and approved by the authors.
Copyright
2026, Netherlands eScience Center, Vrije Universiteit Amsterdam, Netherlands Institute for Neuroscience
Participating organisations
Contributors
Contact person
Malte Lüken
Related projects
Popylar
Popularizing Population Receptive Field Modeling in Neuroimaging