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.
- 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
-
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 |
---|---|
For questions or issues email: ahaber -at- broadinstitute.org