Skip to content

SPM and PythonΒΆ

PyPI - Python Version PyPI - License PyPI - Version GitHub Actions Workflow Status

We have developed a Python interface that enable performing SPM analyses in Python. The package provides an intuitive Python interface to SPM. Under the hood, the package does not reimplement SPM functions but rather relies on Matlab Runtime to execute the SPM routines - guaranteeing that the results are numerically consistent with established Matlab routines.

This project is supported by the SPM team and hosted on Github here.

  • Installation


    SPM-Python is available on pip and does not require a MATLAB license!

    Installation

  • Getting Started


    We provide a series of short examples to get started with calling SPM functions, work with SPM objects, and write and run SPM batches.

    Getting Started

  • Data types


    SPM-Python implements a Python type system that allows all MATLAB types to be interacted with. Get familiar with them.

    Type System

  • Troubleshooting


    Python and MATLAB have fundamentally different design philosophies; interfacing them can lead to issues and ambiguities. We have compiled a list of common problems encountered when using SPM-Python, and their solutions.

    Troubleshooting

  • Tutorials


    Read our tutorials for applying SPM-Python in different contexts (fMRI, VBM, EEG, MEG, etc.).

    Tutorials

  • API


    The complete SPM API documentation is available. All functions describe here can be accessed from MATLAB or from Python.

    API

Warning

This project is currently under construction and might contain bugs. If you experience any issues, please let us know!