clone this repo to a directory.
git clone https://github.com/Nondairy-Creamer/tmac_on_heatdata
Create a virtual environment
cd tmac_on_heatdata
python3 -m venv venv
Upgrade pip and install tmac into the virtual environment
source venv/bin/activate
pip install --upgrade pip
git clone https://github.com/Nondairy-Creamer/tmac
cd tmac
pip install -e .
In a new terminal run
cd <path_to_this_repo>
source venv/bin/activate
python3 tmac_on_heatdata.py <brainscanner folder>
The script will
- linearly interpolate over nans. Make sure your data does not have so many nans that linear interpolation is innaccurate
- correct for photobleaching by dividing by an exponential
- output tmac_output.mat (MATLAB) and tmac_output.pkl (python) which contains a dictionary of the outputs
The output dictionary contains
- a: The neural activity (time, neurons)
- a_nan: The neural activity where values that were NaN in either the raw green or red fluorescence are set to NaN
- m: The motion artifact (time, neurons)
- g_raw, r_raw: the green and red fluorescence input (time, neurons)
- g_corrected, r_corrected: the green and red fluorescence after interpolation and photobleach correction (time, neurons)
- length_scale_a, length_scale_m: the timescale of the gaussian process for a and m in units of time indicies (neurons,)
- variance_a, variance_m: the amplitude of a and m (neurons,)
- variance_g_noise, variance_r_noise: the amplitude of the channel noise for r and g (neurons,)