Giter VIP home page Giter VIP logo

cell-tracking's Introduction

Cell Tracking

Python scripts for tracking cells in fluorescent microscopy, for Ed Munro's group.

Prerequisites

  • Python 3.6
  • Python scientific stack (numpy, scipy, matplotlib)
  • scikit-image
  • pykalman
  • ffmpeg or avconv command line tools for creating movies

Everything is pure python except for the function write_movie in BKlib.py, which uses ffmpeg/avconv. One of these will probably be installed on Linux machines; it can be installed on Mac using the binaries here. The scripts should work on Windows, except for the function write_movie, which depends on avconv.

Scripts

All of the scripts take a tiff movie as input. You can see help instructions by typing the script name without any arguments. I've included a sample movie, cell_membranes.tiff.

track_cell.py must be run first. It takes a tiff file as input, does a simple watershed-based segmentation, and presents a GUI to the user to select a region of interest (i.e., a single segmented cell). This region is then tracked across subsequent frames using an active contour/snakes model. Finally, the control points from the contours are saved to an npy file for futher analysis. This output npy file is the main output; take note of its name, since it is a required argument for the other scripts.

visualize_tracking.py shows the movie with the tracking results overlaid. Use the -o flag to specify an output avi filename in order to save the visualization as a movie.

create_cell_movie.py extracts a small window around the cell of interest and saves it to a movie, so that the motion of the cell is "frozen". Note that the tiff can be a different channel from that used for cell tracking, i.e., you can use a channel that displays cell boundaries in track_cell.py, but another channel with this script.

plot_cell_trajectory.py computes the centroids of the cell boundaries, smooths the trajectory with a Kalman filter, and creates a few plots to quantify motion.

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.