Code Monkey home page Code Monkey logo

pr4deepr / gutanalysistoolbox Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 3.0 388.35 MB

Analysis and characterisation of cells within the gut wall using deep learning models. The current focus is on studying enteric neurons and enteric glia.

Home Page: https://gut-analysis-toolbox.gitbook.io/docs/

License: BSD 3-Clause "New" or "Revised" License

ImageJ Macro 95.73% Groovy 4.10% Python 0.17%
cell-counting deep-learning microscopy enteric-nervous-system colon neuron glia calcium-imaging enteric neurons

gutanalysistoolbox's Introduction

Gut Analysis Toolbox

DOI:10.1101/2024.01.17.576140

To get started with using GAT, please go to the Documentation.


GAT_overview

Gut Analysis Toolbox or GAT allows the semi-automated analysis of the cells within the enteric nervous system of the gastrointestinal tract in 2D. GAT enables quantification of enteric neurons and their subtypes in gut wholemounts. It can run in FIJI or QuPath, popular image analysis softwares in microscopy and uses deep learning models to segment cells of interest.

The workflows are available as video tutorials on Youtube in two separate playlists for Fiji and QuPath.

What you can do with GAT:

  • Semi-automated analysis of number of enteric neurons: Uses pan-neuronal marker Hu or anything with similar labelling
  • Normalise counts to the number of ganglia.
  • Count number of neuronal subtypes, such as ChAT, nNOS etc..
  • Spatial analysis using number of neighboring cells.
  • Calcium imaging analysis: Alignment of images and extraction of normalised traces (Fiji)

Reporting problems

If you have any difficulties, suggestions or find any bugs, you can either:

  • Use this link to access a Google form for submitting issues or questions.

OR

OR

Installing and configuring GAT in Fiji

Click on this video to watch how to install and configure FIJI and GAT

Youtube

GAT requires the following update sites:

  • BIG-EPFL
  • CSBDeep
  • clij
  • clij2
  • DeepImageJ
  • IJBP-Plugins (MorphoLibJ)
  • StarDist
  • PT-BIOP

GAT update site: https://sites.imagej.net/GutAnalysisToolbox/


Model files for use in FIJI

The GAT models are located in Fiji.app/models folder and contains 3 separate model files:

  • Enteric neuron model: 2D_enteric_neuron_v4_1.zip

    StarDist model to segment enteric neurons labelled with Hu, a pan-neuronal marker

  • Enteric neuron subtype model: 2D_enteric_neuron_subtype_v4_1.zip

    StarDist model to segment enteric neuronal subtypes. It has been trained on images with labelling for:

    • neuronal nitric oxide synthase (nNOS)
    • Calbindin
    • Calretinin
    • Mu-opioid receptor (MOR) reporter (mCherry)
    • Delta-opioid receptor (DOR) reporter (GFP)
    • Choline acetyltransferase (ChAT)
    • Neurofilament (NFM)
  • Ganglia model folder: 2D_Ganglia_RGB_v2

    DeepImageJ-based UNet model to segment ganglia. Needs both Hu and a neuronal/glial marker labelling the ganglia

Model files for use in QuPath

Click to Download QuPath model and scripts

Check here for more detail on using QuPath models


Accessing training data

To download the training data, notebooks and associated models please go to the following Zenodo link:

DOI


Citing

Sorensen, L., A. Humenick, S. S. B. Poon, M. N. Han, N. S. Mahdavian, R. Hamnett, E. Gómez-de-Mariscal, P. H. Neckel, A. Saito, K. Mutunduwe, C. Glennan, R. Haase, R. M. McQuade, J. P. P. Foong, S. J. H. Brookes, J. A. Kaltschmidt, A. Muñoz-Barrutia, S. K. King, N. A. Veldhuis, S. E. Carbone, D. P. Poole and P. Rajasekhar (2024). "Gut Analysis Toolbox: Automating quantitative analysis of enteric neurons." bioRxiv: 2024.2001.2017.576140.

gutanalysistoolbox's People

Contributors

mattyrowey avatar pr4deepr avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gutanalysistoolbox's Issues

3D segmentation and annotations

A key feature that is requested is neuron segmentation in 3D.
It is possible, but as with any deep learning problem, generating a model requires manual annotation of data.
Challenges with 3D annotation:

  • More effort annotating in 3D
  • Variabiliity in image acquisition -> Anisotropic data ?.
  • Image Quality: Variability in signal to noise ratio among images

The good news is that there is plenty of public data available now. Two main ones are:

This could be a community driven effort.. Perhaps make data available for annotation on a website. Apeer??

Once annotation is generated, it wouldn't be too challenging to generate a 3D segmentation model.

Use rescale factor instead of pixel size

Currently the user selects the pixel size to rescale the images, so the cells to be segmented have the same size as the images used for training the model. This increases the accuracy of the segmentation.
Using the term pixel size can be confusing. Instead, we should use the term rescaling factor. Rescaling factor can be calculated by dividing the pixel size of the users image by 0.568 or whatever pixel size of the images the model has been trained on.

collate results into one file

Is your feature request related to a problem? Please describe.
After analysis, all the csv results are scattered in different folders. Ryan Hamnett suggested that it would be a good idea to automatically collate them together.

Describe the solution you'd like
A script that we could point to an analysis directory that will collect all the csv files and make a final results file thats easier to handle

example macro on imagesc:

https://forum.image.sc/t/cvs-files-in-folder-into-one-excel-sheet-macro/37638
https://forum.image.sc/t/append-all-excel-files-xls-contained-in-a-folder/33288/2

Describe alternatives you've considered
Could look at using groovy instead of ImageJ macros for this if it gets complicated.

cellpose model

Add a cellpose model based on training data from GAT.
Default cyto2 model works quite well, but it can cause cell splitting.
Training with GAT data may produce a more accurate cellpose model.

Import custom ROIs

Enable custom importing of ROIs for cells ; if using different software for prediction but want to use GAT workflow for measurements

Improved neuron subtype model

Currently, the neuron subtype model is trained on both Hu and neuronal subtype annotations, and gives a lot of false positives.
The subtype model should only be trained on neuron subtype and not on Hu.

To do:

  • Annotate new images to generate more training and test data
  • Train a new model
  • Validate the model on test data

Add workflows for QuPath, napari and ilastik

  • Add neuron subtype segmentation workflow in QuPath
  • Add neuron segmentation , subtype segmentation using StarDist and downstream analysis using pyclesperanto assistant in napari

Image already open checkbox not working

When I tick "image_already_open" in the test segmentation dialog, and I concurrently have a sample image open, the code terminates with a dialog popping up saying "'path' is required but unset." When unticked and I set the path to the image, this error does not happen. Perhaps the code is still pointing to a path, even when the image is opened already, and that checkbox is ticked? Thank you
image_already_open_error
!

model pixel size

The current pixel size used to train models is 0.568 micron per pixel.
When large images are used for analysis in GAT within FIJI, as the pixel size is quite high, they have to be resized to a higher resolution for appropriate segmentation. In essence, the image becomes larger and takes up more memory during the StarDist segmentation process. This is inefficient and should be changed in the future.
One solution is to increase the pixel size of images used for training the model..

define ganglia using Hu only

Defining a ganglia is currently based on the presence of two markers, Hu and a neuronal/glial fibre marker.
This is not always practical and it takes up a valuable channel.
Proposal is to use Hu to define ganglia by expanding labels to a predefined distance. We can use the distances from spatial analysis as a starting points -> 6.5 um expansion of cell edges
Once expanded, use connected components labelling to define the ganglia.

  • Define ganglia based on cell expansion and connected components
  • Add a Test ganglia segmentation option under Tools to try different label expansion values

[BUG] Spatial Analysis returns results neighbours incremented by 1

Describe the bug

Spatial Analysis returns neighbour count that is incremented by 1. This is because we are using the function "label overlap count map for calculating the number of neighbours after label dilation. It counts the overlapping cells and the same cell in the counts.
Currently, working on a bugfix to return the corrected values.

Will also add a feature to include spatial analysis as part of the standard workflow to minimize additional steps

Cellpose integration

PT-BIOP has a nice Fiji cellpose wrapper that calls cellpose from Fiji: https://github.com/BIOP/ijl-utilities-wrappers
Enable compatibility by allowing this as an option.
Points to consider:

  • Instructions to install cellpose;

    • links to python environment config
    • video tutorial?
  • Rescaling of image done in GAT for Stardist prediction. Determine the radius we pass to cellpose?

  • Add test macro to test different options in Cellpose??

Detecting # of nuclei per ganglia

When using the GAT feature in Fiji, it allows me to count the number of neurons in the image I upload, but it will not count the number of neurons per ganglia. After it counts the neurons, and I okay what the program has labeled as a neuron, it gives me a Macro Error saying "Stack required in line 81 (called from line 64), Stack . ( ganglia_channel ) ;". When I click the "OK" button on this error. it displays a box that says "Ganglia image not a binary image". I am not really sure what any of this means, and my knowledge on this software is pretty limited. Is this something you are able to assist me on?

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.