Skip to content

cellarium-ai/Optosynth

Repository files navigation

Optosynth

Optosynth

Optosynth is a python package for generating synthetic voltage imaging ("Optopatch") data using empirical morphological reconstructions and paired electrophysiology measurements from Allen Brain single-neuron database.

Optosynth currently simulates the following aspects of voltage imaging data:

  • spatial variability in expression of archaerhodopsin
  • action potential dendritic backpropagation
  • voltage propagation decay
  • lowpass filtering of electrophysiology measurements according to the camera sampling rate
  • conversion of voltage to fluorescence
  • static and dynamic background fluorescence
  • variability in global fluorescence intensity of individual neurons (i.e. tissue depth)
  • Gaussian PSF
  • Poisson-Gaussian camera noise

The synthetic data generated by Optosynth is extremely realistic and can be used for benchmarking denoising, spike detection, and segmentation pipelines.

Future plans include:

  • multi-threading
  • removing redundant parameters
  • camera motion modeling (towards synthetic in vivo data)
  • better reconstruction of soma (currently cicular -- Allen SDK only provides center coordinates and radius)
  • 3D tissue/culture synthesis and 3D point spread function (currently, the reconstruction is purely 2D)

Requirements

Optosynth requires the following python modules:

  • allensdk
  • Pillow>7.0.0 (having the right version is extremely important -- Optosynth produces bad data with older versions of Pillow)
  • boltons
  • tqdm
  • torch
  • numpy
  • scipy
  • pandas

We will eventually package Optosynth into a proper python module. At the moments, the user must install the requirements manually.

Notebooks

  • download_allen_data.ipynb: downloads relevant data from Allen Brain
  • process_allen_morphology.ipynb: processes morphological reconstructions and generates binary masks for each neuron
  • process_allen_elecrophysiology.ipynb: processes electrophysiology data, retains only square pulses, and generates a manifest of retain sweeps along with useful metadata (stimulation current, number of spikes, etc)
  • optosynth_main.ipynb: generates and saves synthetic data, explores some aspect of the generated data

About

Synthetic voltage image (Optopatch) data generator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published