GithubHelp home page GithubHelp logo

lengyuner / fdnc_neuron_id Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dysprague/fdnc_neuron_id

0.0 0.0 0.0 180.8 MB

A new approach to tracking and identifying neurons both within and across individual C. elegans.

Python 3.31% Jupyter Notebook 96.69%

fdnc_neuron_id's Introduction

fDNC: fast Deep Neural Correspondence

This tool was developed for automatically predicting neuron correspondence between two point clouds of neurons. User can freely choose their favorite segmentation algorithm to detect neurons(point cloud) from fluorescence images. This algorithm does not require straightening or axis-alignment of the worm head as preprocessing step.

Installation

The code was run and tested in a python 3.7 environment. The packages and their version can be found in requirements.txt

Usage

The code can be run with or without an Nvidia GPU. The default setting is to run with GPU, and set the argument cuda=False makes the model be run with CPU. The running speed with a Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz is 0.05s/worm.

The model requires two inputs:

A template worm with labels already assigned is required. In the example code, the template worm input is a python dictionary with the following keys:

  1. pts: a NumPy array of dimension N*3 as the XYZ position of neurons(unit: micrometer)
  2. fluo: a NumPy array of dimension N*num_channel as the fluorescent signals.(Set to be None if not available)
  3. name: a list of neuron names of length N as the name assigned to each neuron.

A test worm is also a python dictionary. This dictionary contains 2 keys:

  1. pts: a NumPy array of dimension M*3 as the XYZ position of neurons(unit: micrometer)
  2. fluo: a NumPy array of dimension M*num_channel as the fluorescent signals. (Set to be None if not available)

Each recorded worm is unstraightened and the head direction is arbitrary. The recorded worms tested in this work lie on their right sides.(For a worm that lies on its left side, we can simply rotate 180 degrees by inverting the sign of x and z coordinates).

An example of input data of a template and a test worm is provided in folder Data/Example

Example Code

To run the ID prediction, use the predict function in src/DNC_predict.py. An example of how to use it is provided in src/example.ipynb

Pretrain model

We provide a pretrained model and recommend our user to download the pretrained model and save it in the model folder as model/model.bin. The model can be found at Data And Pretrained Model

We also provide the code for training the model with synthetic data. An example for training with your own train and validation set is as follows:

python ./src/fDNC_train.py --train_path ./Data/train --eval_path ./Data/val

We also provide our training data at Data And Pretrained Model

fdnc_neuron_id's People

Contributors

dysprague 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.