Skip to main content

A python wrapper for the MEM source method

Project description

best-python

The goal of this project is to provide a way to use the best-brainstorm Matlab solvers in Python, compatible with MNE-Python.

For now, the project is using matlab.engine to call the best-brainstorm functions from Python, so you need to have Matlab installed on the computer.

Installation

Matlab and matlabengine package installation

You need to have Matlab installed on your computer. Then, you can install the matlabengine package matching the Matlab version you have installed.

You can run the get_matlab_version.py script to get the version of Matlab installed on your computer.

python get_matlab_version.py

It should return something like:

Getting MATLAB version... Please wait.
MATLAB version found: 24.1.0.123456
Run the following command in the terminal to install the required version:
pip install matlabengine>=24.1.0,<25.0.0

Then, you can install the matlabengine package with the version found:

pip install matlabengine>=24.1.0,<25.0.0

After that, you can install the best-python package:

pip install best-python

Best-brainstorm installation

As the best-python package is using the best-brainstorm functions, you need to have the best-brainstorm toolbox downloaded on your computer.

You can download the best-brainstorm toolbox from the best-brainstorm github.

Usage

You can use the functions from the best-python package like this:

import best_python

# Create a new instance of the wrapper
# You need to provide the path to the best-brainstorm root folder
matlab_wrapper = best_python.MatlabWrapper("C:/PATH/OF/BEST-BRAINSTORM/ROOT/FOLDER")

# Call the solver
stc = matlab_wrapper.mem_solver(evoked, forward, noise_cov, depth=0.8, loose=0.0)

Full example

You can find a full example in the tests/test.py file link.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bestpython-0.0.5.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

bestpython-0.0.5-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file bestpython-0.0.5.tar.gz.

File metadata

  • Download URL: bestpython-0.0.5.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.0

File hashes

Hashes for bestpython-0.0.5.tar.gz
Algorithm Hash digest
SHA256 4a7de5cc3ac5d8bc9dfe56606bddf7c538c6907d58b460ad5823a1dc9db8a51f
MD5 224c54fbfb0fa64974e2053e117db810
BLAKE2b-256 bb97d61884b79346e4e7d1d23fdd0a1b46725993627b8429d7becad53fb16219

See more details on using hashes here.

File details

Details for the file bestpython-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: bestpython-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.0

File hashes

Hashes for bestpython-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8ba850ef0b3205e43beb0705b586e4798043920e8562315490a3a244498eee8b
MD5 8ec3b2242ecb086c8921a1db84075bd9
BLAKE2b-256 a9580c8aac30986948bb57d7da0fbe7164b3c32f4dd615e50c8742db35dad9bc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page