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
Built Distribution
File details
Details for the file bestpython-0.0.4.tar.gz
.
File metadata
- Download URL: bestpython-0.0.4.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3693475151eaeed7a492ffa08b7f6ff48d35ad784d5232df3e03d9549b6d7ee |
|
MD5 | 9f7f66d73e56263b845762319b818b3d |
|
BLAKE2b-256 | 58540da549afbf9e9e082761b4eac3bf1fb57c54ef47926c58627bd8df2380be |
File details
Details for the file bestpython-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: bestpython-0.0.4-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10baf44ba9b7c1118c6cf3de794150624cc91a98f2410af24e3bac4c4c054081 |
|
MD5 | 0c15eb2c35905909ecb3be5c6a5d8454 |
|
BLAKE2b-256 | b046fcb2a488e79fecdd4c5e93346e7845e0a46d322843707dd0c085068b152a |