Skip to content

tehahn/quantpunc

Repository files navigation

 ________  ___  ___  ________  ________   _________  ________  ___  ___  ________   ________     
|\   __  \|\  \|\  \|\   __  \|\   ___  \|\___   ___\\   __  \|\  \|\  \|\   ___  \|\   ____\    
\ \  \|\  \ \  \\\  \ \  \|\  \ \  \\ \  \|___ \  \_\ \  \|\  \ \  \\\  \ \  \\ \  \ \  \___|    
 \ \  \\\  \ \  \\\  \ \   __  \ \  \\ \  \   \ \  \ \ \   ____\ \  \\\  \ \  \\ \  \ \  \       
  \ \  \\\  \ \  \\\  \ \  \ \  \ \  \\ \  \   \ \  \ \ \  \___|\ \  \\\  \ \  \\ \  \ \  \____  
   \ \_____  \ \_______\ \__\ \__\ \__\\ \__\   \ \__\ \ \__\    \ \_______\ \__\\ \__\ \_______\
    \|___| \__\|_______|\|__|\|__|\|__| \|__|    \|__|  \|__|     \|_______|\|__| \|__|\|_______|
          \|__|                                                                                  

PyPI Python Version License BSD-3

QuantPunc is a Napari plugin for puncta analysis and quantification in 2D microscopy images. You can also find QuantPunc on Napari hub.

QuantPunc is currently in beta. Please report any problems to the issues page.

Features

  1. Automated puncta labeling and counting
  2. Watershed segmentation
  3. Colocalization analysis
  4. Exportable counts and stats

Installation

You can install quantpunc via Napari's plugin manager:

  1. Click on "Plugins" in the toolbar.
  2. Click on "Install/Uninstall Plugins..." in the context menu.
  3. Type "quantpunc" in the searchbar.
  4. Click install.

You can also install quantpunc via pip:

pip install quantpunc

Puncta Quantification and Workflow

Here’s an ideal, high-level workflow for puncta segmentation and quantification. This is the recommended way of using QuantPunc. However, QuantPunc’s widgets are modularly designed so that they can be used as standalone tools. If this is your first time working with these tools, you can access a more in-depth guide here.

1. Preprocessing (optional but recommended)

QuantPunc uses wavelet denoising and adaptive histogram equalization to enhance edge information and contrast in your image. If you feel that your image has sufficient contrast and minimal noise, feel free to skip this step.

2. Automated labeling

There are two automated labeling methods. One of them uses skimage’s blob detection algorithms and the other uses a random forest classifier with features inspired by ilastik. You also have the option to only segment puncta within ROIs. You can provide your own ROIs or create them using a labels layer in Napari.

Random forest classifier (RFC)

You can use Napari to create annotations or provide your own. After annotating your puncta and specifying your integer labels, you can then train the RFC. Click on Label puncta to segment your puncta.

Skimage blob detection

Select your favorite blob detection algorithm from the Method dropdown menu. After parameterizing it, click on Label puncta.

3. Manual labeling

You can remove any puncta labels you don’t want from automated segmentation by using Napari’s layer control toolbar. You also have the option to do a full manual segmentation using a labels layer and quantify your annotations after.

4. Watershed segmentation (optional)

If your puncta exhibits lots of clumping, you can use the watershed tool to perform instance segmentation on your puncta labels layer. You can choose either to use a distance transform or Sobel filter to generate the elevation map.

Seed point generation

You can either provide your own seed points or generate them using skimage’s blob counting algorithms with a low min and max sigma.

5. Puncta counting

After you have a segmentation you’re happy with, select the image you want to quantify and click Count puncta. Make sure that your puncta labels layer is named after the image you’re quantifying with “_puncta” as its suffix, e.g., “your_img_puncta”.

6. Colocalization analysis (optional)

Colocalization is measured using the intersection over union (IoU), aka the Jaccard Index. Select two puncta labels layers and click on Compute IoU.

7. Displaying stats and saving

Click on any of the tabs in the table widget to view different summaries of the puncta you’ve quantified. To export the tables as a csv for the layer you’ve selected, click on Save selected data. If you want to save the data for all the images you’ve quantified click on Save all data.

Contributing

Contributions are very, very welcome. QuantPunc allows you to implement your own automated puncta labeler. Look in abstract_puncta_labeler to see what methods need to be implemented and default_puncta_labelers for examples. If you're interested in making it available to everyone else or have any other improvements, feel free to send a pull request!

License

Distributed under the terms of the BSD-3 license, QuantPunc is free and open source software

Issues

QuantPunc is still in beta, so bugs are to be expected. Please report any problems to the issues page.

About

QuantPunc is a Napari plugin for puncta analysis and quantification in 2D microscopy images. A comprehensive guide for QuantPunc is linked below.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages