Skip to content
 
 

Repository files navigation

                          --------------------------
                        /                            \
                     ------------------------------------
                    /                                    \
        -------------------------------------------------
        /                            /\/\/\/\/\ 
        ---------------------------------------------------
                  |        F  i  e  l  d  T  r  i  p       |
                  ------------------------------------------
                   \                                      /
                     ------------------------------------
                          \            /
                            ----------

The Python interface to FieldTrip

Warning

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

Installation instructions

Important - Windows

Python installation made from Microsoft Store on Windows will not work (raises DeclarativeService.dll not found), install it from Python website.

Important - Python/MATLAB compatibility

Specific versions of MATLAB are compatible with specific versions of Python.

By default, fieldtrip-python uses R2025b, which is compatible with Python 3.10-3.13.

Option 1 - Install the MATLAB runtime on first use

  1. Install FieldTrip-Python
    pip install https://github.com/johmedr/fieldtrip-python/releases/latest/download/fieldtrip_python-20241219b1-py3-none-any.whl
  2. Start Python
    python
  3. Calling a FieldTrip function will try to locate or install MATLAB Runtime.
    import fieldtrip
    ft_info('Hello, world')
  4. Follow the instructions to install the runtime
  • Advantages
    • Installs the runtime that is required for your python version
    • Does not resintall anything if a compatible runtime already exists
  • Drawbacks
    • May need to be run in proviledged mode (e.g., sudo)
    • May be fiddly on Windows

Option 2 - Install the MATLAB runtime manually

  1. Install the appropriate MATLAB Runtime
  2. Install FieldTrip:
    pip install https://github.com/johmedr/fieldtrip-python/releases/latest/download/fieldtrip_python-20241219b1-py3-none-any.whl
  • Advantages
    • Graphical interface for installing the runtime
  • Drawbacks
    • The correct runtime must be selected for your python version

Option 3 - Install the MATLAB runtime using an installation script

  1. Install FieldTrip-Python
    pip install https://github.com/johmedr/fieldtrip-python/releases/latest/download/fieldtrip_python-20241219b1-py3-none-any.whl
  2. Run the installer
    install_matlab_runtime --version R2025b --yes
  • Advantages
    • Exposes installation options (install_matlab_runtime --help)
  • Drawbacks
    • For advanced users

About

The Python interface to FieldTrip

Resources

Code of conduct

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages