Skip to content

adamh-broad/image_analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python script for blob detection-based image analysis

This repo contains Python code for image analysis based on OpenCV. The program detects local, contiguous regions (blobs) of high signal intensity. Depending on the image modality, these can correspond to cells in immunohistochemistry (IHC) stains, or to individual messenger RNA (mRNA) molecules in single-molecule FISH (smFISH) images. This code was used to quantify images in the study Biton et al., 2017.

Getting Started

Installation (only tested on OS X, but should work on linux)

  • Install OpenCV with Python bindings. There are several blogs with instructions to do so such as this one.
  • For example, using Homebrew on Mac OS X:
brew install opencv3
  • Clone this repo:
git clone https://github.com/adamh-broad/image_analysis.git

Image analysis

  • To run the analysis code on an input image:

    python runQuant.py --input test_input/Control_60X_1_C002.tif

    The output results will be saved a jpg image: processed_output.jpg so the blobs detected and their total number can be visually inspected.

  • There are several parameters to control dot resolution. The first is 'min_pixel', which thresholds the image with all pixels less than min_pixel in brightness being made black. The second is 'min_distance' which controls how much merging is done for nearby dots; higher 'min_distance' give more merging.

Input image Quantification by contour detection and merging

Related Resources

For questions or issues email: ahaber -at- broadinstitute.org

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages