Skip to content

Commit 421397e

Browse files
committed
Remove mat_py_mat stuff - moved to new repo
1 parent 61911d0 commit 421397e

12 files changed

+39
-448
lines changed

README.md

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
# Matlab Support for Using FOOOF
1+
# FOOOF - Matlab Wrapper
22

3-
This repository offers support materials and utilities for using [FOOOF](https://github.com/voytekresearch/fooof) with Matlab. All [descriptions](https://github.com/voytekresearch/fooof/README.md) and [tutorials](https://github.com/voytekresearch/fooof/tutorial) for FOOOF are in the [main repository](https://github.com/voytekresearch/fooof), and a full description of the method is available in the [paper](https://www.biorxiv.org/content/early/2018/04/11/299859).
3+
This repository offers a Matlab wrapper for [FOOOF](https://github.com/fooof-tools/fooof) with Matlab.
44

5-
There are two approaches offered here for using FOOOF with Matlab - a Matlab Wrapper, and a Matlab->Python->Matlab workflow. Note that these options both still use the Python implementation under the hood, and so do require a working Python install - but that should be easy to do, and instructions are provided below to do so.
5+
All [descriptions](https://github.com/fooof-tools/fooof/README.md) and [tutorials](https://github.com/fooof-tools/fooof/tutorial) for FOOOF are in the [main repository](https://github.com/fooof-tools/fooof), and a full description of the method is available in the [paper](https://www.biorxiv.org/content/early/2018/04/11/299859).
6+
7+
This repository describes the Matlab wrapper, in which you call the Python implemnetation of FOOOF from Matlab, never having to interact directly with Python. An alternative approach is to use a primarily
8+
9+
There are two approaches offered here for using FOOOF with Matlab - a Matlab Wrapper, and a Matlab->Python->Matlab workflow. Note that these options both still use the Python implementation under the hood, and so do require a working Python install - but that should be easy to do, and instructions are provided below to do so.
610

711
### Reference
812

@@ -12,9 +16,9 @@ If you use this code in your project, please cite:
1216
Voytek B (2018) Parameterizing Neural Power Spectra. bioRxiv, 299859.
1317
doi: https://doi.org/10.1101/299859
1418

15-
## Matlab Wrapper
19+
## FOOOF_MAT
1620

17-
The Matlab wrapper, in 'matlab_wrapper' is some Matlab code, that calls the Python implementation of FOOOF. This requires that you have Python & FOOOF installed, but does not require you to ever use or write Python code yourself.
21+
The Matlab wrapper, is Matlab code that calls the Python implementation of FOOOF. This requires that you have Python & FOOOF installed, but does not require you to ever use or write Python code yourself.
1822

1923
To use the wrapper, first install Python & FOOOF - there are instructions to do so below. Then clone or download this repository, and then use the the provided matlab code to run FOOOF. The only function you need to run is 'fooof.m', which has documentation on inputs and outputs.
2024

@@ -30,7 +34,7 @@ Once you have downloaded Python, you shouldn't need to do anything for Matlab to
3034

3135
You can run `pyversion` to see which Python you are using. Note that you must do this _after installing Python and FOOOF_ (instruction to do so below).
3236
```
33-
% Check which python is being used.
37+
% Check which python is being used.
3438
pyversion
3539
3640
% The print out from above should tell you which Python you are calling
@@ -40,18 +44,10 @@ pyversion
4044
4145
% Set python version to use
4246
% Note: you must do this first thing after opening Matlab (relaunch if you need to)
43-
% You should only ever have to run this at most, once.
47+
% You should only ever have to run this at most, once.
4448
pyversion('/anaconda/bin/python')
4549
```
4650

47-
## Matlab -> Python -> Matlab
48-
49-
Since you need to install Python anyways, another potential workflow is to do all of your processing and analysis in Matlab, up to and including calculating power spectra, which you then save out to mat files. You can then load these files in Python, run and explore FOOOF, then save out the model fit results, that can be loaded back into Matlab, if you prefer.
50-
51-
The benefit of this approach, over using the wrapper, is that you have full access to the FOOOF module in Python, which makes it easier to use utilities to plot outputs and see what's happening.
52-
53-
An example / template workflow for using this approach, including matlab and python scriptys, is available in 'mat_py_mat'. With this template, you should be able get working with this workflow without having to write almost any Python code.
54-
5551
## Installing Python & FOOOF
5652

5753
Both workflows above require that Python & FOOOF be installed. The easiest way to do this is as follows:
@@ -70,10 +66,10 @@ FOOOF can be installed through pip, meaning you just have to run the following f
7066

7167
`pip install fooof`
7268

73-
If you're on mac, 'command line' means terminal - after installing anaconda, just copy the above command into the terminal, and it should work. If you're on windows, you will need to run this in 'anaconda command prompt' which is basically a command line specifically for managing Python with Anaconda.
69+
If you're on mac, 'command line' means terminal - after installing anaconda, just copy the above command into the terminal, and it should work. If you're on windows, you will need to run this in 'anaconda command prompt' which is basically a command line specifically for managing Python with Anaconda.
7470

7571
## Potential Matlab Implementation
7672

77-
The above workflows still use the Python implementation of FOOOF. This has some perks, in that running the exact same code means that there are no worries about maintaining and verying the consistency between multiple implementations of the code. However, it does still require this somewhat annoying coordinating between languages, if one wants to use Matlab. The only way to get around this would be to have a re-implemenation of the algorithm in Matlab, in which case it could be used in a stand-alone manner.
73+
The above workflows still use the Python implementation of FOOOF. This has some perks, in that running the exact same code means that there are no worries about maintaining and verying the consistency between multiple implementations of the code. However, it does still require this somewhat annoying coordinating between languages, if one wants to use Matlab. The only way to get around this would be to have a re-implemenation of the algorithm in Matlab, in which case it could be used in a stand-alone manner.
7874

7975
As of right now, there are no plans on our end for a full re-implementation of the algorithm in Matlab - it's non-trivial to re-write, test, confirm equivalence, and then continuously maintain two versions. That said, the code is open, so if want to try and do this yourself, go for it!

mat_py_mat/LonePSD_A_matlab_preprocessing.m

Lines changed: 0 additions & 12 deletions
This file was deleted.

mat_py_mat/LonePSD_B_python_fooofing.ipynb

Lines changed: 0 additions & 152 deletions
This file was deleted.

mat_py_mat/LonePSD_C_matlab_analysis.m

Lines changed: 0 additions & 9 deletions
This file was deleted.

mat_py_mat/MultiPSD_A_matlab_preprocessing.m

Lines changed: 0 additions & 16 deletions
This file was deleted.

mat_py_mat/MultiPSD_B_python_fooofing.ipynb

Lines changed: 0 additions & 166 deletions
This file was deleted.

mat_py_mat/MultiPSD_C_matlab_analysis.m

Lines changed: 0 additions & 33 deletions
This file was deleted.

mat_py_mat/README.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

mat_py_mat/dat/ch_dat_one.mat

-210 KB
Binary file not shown.

mat_py_mat/dat/ch_dat_two.mat

-215 KB
Binary file not shown.

0 commit comments

Comments
 (0)