-
Notifications
You must be signed in to change notification settings - Fork 15
Loading Plexon data into Python
The FHC (intraoperative rig) can export to old-style Plexon files. Unfortunately, Plexon only provides C/C++ and Matlab code to read these files. Some intrepid folks have replicated this functionality in Python, but it's a bit more fragile.
We'll use Neo. More specifically, we'll use our own fork of the code on GitHub. We need to use the GitHub code instead of the package on PyPI (what you get from pip install
) because there's a bug in the 0.4.1 release that's only currently (Feb 2017) fixed on master. We need to use our own fork because the FHC export removes the date from the file but Neo assumes the date information in the plx
file constitutes a valid date-time. I modified the code in our fork to remedy that.
-
Clone the Neo code:
git clone [email protected]:pearsonlab/python-neo
-
Check out my modified branch:
git checkout jmp/nodt
-
Add the
python-neo
directory to your system'sPYTHONPATH
variable. If you're on a Mac, you'll add the following line at the end of the.bash_profile
file in your home directory. If you're on Linux, you'll add it to.profile
in the same place:export PYTHONPATH="$HOME/<path-to>/python-neo:$PYTHONPATH"
where
<path-to>
is replaced by the path topython-neo
. For instance, on my machine, where the path to the library is~/code/python-neo
, I'd haveexport PYTHONPATH="$HOME/code/python-neo:$PYTHONPATH"
-
With the data in
<current directory>/data
, you should then be able to run something like this gist.