Git Product home page Git Product logo

py-oopsi's Introduction

this is a working document

Py-oopsi: the python implementation of the fast-oopsi algorithm

Fast-oopsi was developed by joshua vogelstein in 2009, which is now widely used to extract neuron spike activities from calcium fluorescence signals. Here, we propose detailed implementation of the fast-oopsi algorithm in python programming language.

Py-oopsi requires numpy, scipy and matplotlib.

Generate Synthetic Calcium Trace

To generate synthetic calcium trace, you can

T = 2000
dt = 0.020
lam = 0.1
tau = 1.5
sigma = 0.2

# signal generator
F,C,N = oopsi.fcn_generate(T, dt=dt, lam=lam, tau=tau, sigma=sigma)

where F is the Fluorescence signal with noise, C is the clean calcium trace, N is the ground truth spikes.

Reconstruct Spikes via py-oopsi

We provide demo.py to illustrate the usage of py-oopsi (as well as wiener filter, discretized binning),

# fast-oopsi,
d,Cz = oopsi.fast(F,dt=dt,iter_max=6)

# wiener filter,
d,Cw = oopsi.wiener(F,dt=dt,iter_max=100)

# descritized binning,
d,v = oopsi.discretize(F,bins=[0.75])

Simulation Results

Tweak py-oopsi

py-oopsi requires

  • F the fluorescence signal, a numpy.ndarray object of 1-D vector;
  • dt the frame interval, 1/(frame rate);
  • iter_max maximum number of iteration;
  • update true if the parameters are updated after each iteration.

when imaging large population of fluorescene signals of multiple neurons, for example, the connectomics challenge at kaggle.com, you need to write a subroutine to process the fluorescence trace per neuron.

Reference

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.