FISH image analysis library
Project description
FISH Analysis
A library with the funcionality to prepare and analyze HCR-FISH images. Using this library, you can construct a basic FISH image anlysis pipeline.
Installation
pip install FISH-analysis
Get started
Cell Segmentation
- Separate the color channels in a czi and save as images
- Create mask and outline of cells in FISH image
from FISH_analysis import Segmentation
from FISH_analysis import CZI_Channels
# isolate channels from png and save
czi = CZI_Channels('Images/SOX2_(G)._PAX6_(R)._PAX7_(FR)_40x_Spinal_Cords_Uninjured_001/SOX2_(G)._PAX6_(R)._PAX7_(FR)_40x_Spinal_Cords_Uninjured_001.czi')
# convert all channels of czi to png
for chan in (czi.num_channels()):
czi.channel_to_png(chan)
# list of number of channels
print(czi.num_channels())
# show image of all channels in czi
czi.show_all_channels()
# segmentation of cells -> mask and outline
cells = Segmentation('segmentation_output/C4_SOX2_(G)._PAX6_(R)._PAX7_(FR)_40x_Spinal_Cords_Uninjured_001.png')
# make masks and outlines
cells.make_masks(0.9, -5, None, 'cyto')
cells.make_outlines()
Puncta Thresholding
- Threshold FISH image to isolate puncta (dots) and get rid of noise
- Get centroids of objects (cells or dots) in given image (cells outline or thresholded dots)
from FISH_analysis import Puncta_Thresholding
# centroids
thresholding = Puncta_Thresholding('Images/SOX2_(G)._PAX6_(R)._PAX7_(FR)_40x_Spinal_Cords_Uninjured_001/Input/C2 (Pax6) thresholded dots.tif')
centroids = thresholding.get_centroids(0)
print(len(centroids))
# binary threshold and erosion/dilation
thresholding2 = Puncta_Thresholding('Images/SOX2_(G)._PAX6_(R)._PAX7_(FR)_40x_Spinal_Cords_Uninjured_001/Input/MAX_C3-SOX2_(G)._PAX6_(R)._PAX7_(FR)_40x_Spinal_Cords_Uninjured_001.tif')
thresholding2.binary_threshold(190, 'plot')
thresholding2.erosion_dilation(100)
# watershed and gaussian blur
thresholding3 = Puncta_Thresholding('Images/SOX2_(G)._PAX6_(R)._PAX7_(FR)_40x_Spinal_Cords_Uninjured_001/Input/MAX_C4-SOX2_(G)._PAX6_(R)._PAX7_(FR)_40x_Spinal_Cords_Uninjured_001.tif')
thresholding3.watershed("plot")
thresholding3.gaussian_blur(11, "plot")
Puncta Analysis
- Threshold FISH image to isolate puncta (dots) and get rid of noise
- Get centroids of objects (cells or dots) in given image (cells outline or thresholded dots)
from FISH_analysis import Puncta_Analysis
from FISH_analysis import Puncta_Thresholding
# overlay cells outline onto thresholded dots
analysis = Puncta_Analysis('segmentation_output/C4_SOX2_(G)._PAX6_(R)._PAX7_(FR)_40x_Spinal_Cords_Uninjured_001_outlines.png', 'Images/SOX2_(G)._PAX6_(R)._PAX7_(FR)_40x_Spinal_Cords_Uninjured_001/Input/C3 (SOX2) thrsholded dots.tif')
analysis.overlay()
# create thresholding objects for centroids
cells = Puncta_Thresholding('analysis_output/outline.png')
dots = Puncta_Thresholding('analysis_output/dots.png')
# get centroids of cells and dots
cell_centroids = cells.get_centroids()
dot_centroids = dots.get_centroids()
# get and save all cell centroids
analysis.refine_cell_centroids(cell_centroids)
# get and save all dot centroids
analysis.refine_dot_centroids(dot_centroids)
# save a csv file of dots per cell data for real FISH images of cells and dots
analysis.dots_per_cell()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
FISH-analysis-0.0.1.tar.gz
(10.9 kB
view details)
Built Distribution
File details
Details for the file FISH-analysis-0.0.1.tar.gz
.
File metadata
- Download URL: FISH-analysis-0.0.1.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d11060631c5de297d18c5c861b61f37dd07daf1e846c38c45fe858732bdf4e2b |
|
MD5 | 58dd967118961947331f955f50a1b561 |
|
BLAKE2b-256 | 8f3dc6933b50f219c3cb86b374f0e312b387a266dbb7e0a4f9b6b4b95248347b |
File details
Details for the file FISH_analysis-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: FISH_analysis-0.0.1-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 265a86033cd2fc649d124117692be88f5c709d4a872457dac9e1ff7a1703361d |
|
MD5 | acf2843940bc5d3d7e08e34346eaff27 |
|
BLAKE2b-256 | 779704a9811e422121d0b64c88f8cd51b9448ca8ef3887a1387f679ecee7eedb |