GithubHelp home page GithubHelp logo

tmac_on_heatdata's Introduction

Two-channel motion artifact correction (TMAC)

Installation:

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 .

Usage:

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,)

tmac_on_heatdata's People

Contributors

nondairy-creamer avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.