Code for Behavioral, Imaging Analysis
Project description
PIEPY : Psychophysical and Imaging Experiments Pypeline
by Sakir Kaan Cetindag
Code to parse, analyse and visualize psychophysical and imaging data.
Getting set up
Clone repository
Create a directory in your desired location, clone the repository on your computer
Environment creation
Navigate into and open the terminal in your piepy directory and create a new environment by:
uv venv --python 3.10
Then activate the newly created environment using:
In MacOS/Linux:
source .venv/bin/activate
In Windows
.venv/bin/activate
4. Module installation
In your piepy directory, in terminal enter:
uv pip install -e .
This will install the module with all the necessary dependencies and you can use various CLI commands to analyse sessions etc.(WIP)
How do I use piepy?
IMPORTANT : A
config.jsonfile is used to point piepy to the behavioral data and other directories. You need to change the paths variable according to your directory structure for piepy to work!
- Stimpy .stimlog and .riglog is in : <path_to_dir>/presentation/your_experiment_name
- Analysed data is saved(and loaded from) : <path_to_dir>/analysis/your_experiment_name
Currently, the code only works for our in-house wheel detection and discrimination tasks and the best way to use/test is through Jupyter Notebooks:
Code Architecture
The analysis pipeline is organised in a modular way where the parsing/analysing of behavioral data is seperate from statistical analysis and plotting.
The data architecture is also set-up in a way to make it easy to pass around between analysis and plotting. For this, there is the RunData class which holds the data in a polars DataFrame, which can be plugged into dedicated statitical analysis/plotting classes.
The behavioral data is divided into four main :
1. Trial
Main parsing of the experiment data happens in the Trial class. piepy uses both .stimlog and .riglog generated by StimPy to calculate basic trial variables such as reaction time, trial outcome, lick counts etc.. The main ingredient in this process is the state machine that is being used in the ExperimentController in StimPy. The parsed rawdata is aggregated in a dictioanry of dataframes and then seperated into trials by using the timings of various software and hardware signals into trials. These trials are then collected into a dataframe, where each row is a trial.
2. Run
The aggregated trials makes up the data of the Run. Run(s) make up a Session.
3. Session
Mostly for convenience, holds one or multiple Run(s) in it.
These are mostly dependent on the behavioural/imaging data that is being analysed so a custom Trial, Run, Session classes need to be implemented to parse the data according to specific needs.
Contribution guidelines
To implement a feature create a new branch (e.g feature_VR_wheel_analysis)
Who do I talk to?
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file piepy_neuro-0.1.1.tar.gz.
File metadata
- Download URL: piepy_neuro-0.1.1.tar.gz
- Upload date:
- Size: 245.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9bc1feca09125932747883f7a33170b87780db229a4a4165482f2093c82c4e0
|
|
| MD5 |
812daf407042c5517639d606374d200e
|
|
| BLAKE2b-256 |
d84b69a4182e2a2c33fa31a0b5db06346461a928c0e4216b518d8d346e5120f6
|
File details
Details for the file piepy_neuro-0.1.1-py3-none-any.whl.
File metadata
- Download URL: piepy_neuro-0.1.1-py3-none-any.whl
- Upload date:
- Size: 284.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8dd0355df3394fb3c68feabed11099024ad331767a3949a39ac2ea2e7583a22
|
|
| MD5 |
97589184ab1d33d0a3cc12b663b13459
|
|
| BLAKE2b-256 |
f46a5f93fb2bb8f3996b33e638e5bff4e5f543ca4989a9f387d74e6a701d6f6a
|