GithubHelp home page GithubHelp logo

biofilm_meas's Introduction

Biofilm detection in metal explants using APOC pixel classifiers

This repository makes use of Accelerated Object and Pixel (semantic) APOC classifiers to segment fluorescent biofilm growing on metal explants extracted from animal models. It generalizes better across conditions when compared to a simple thresholding method.

prediction_png

Raw Data Download

  1. Contact Me to obtain a fresh working S3 bucket pre-signed link.

  2. Paste the link inside 0_data_download.ipynb notebook after presigned_url.

  3. Run the notebook to download and extract the data. The resulting data folder contains all the raw_data, training data, shapes used for manually cropping your area of interest and the resulting cropped images used in this example.

Data Pre-Processing Steps

  1. Notebook 1_raw_data_processing.ipynb takes the data/raw_data folder structure and extracts the tiled images obtained from an EVOS 2 microscope.

  2. Using the napari-crop tool that can be found in Napari Assistant under Tools > Utilities you can load a predefined shape (stored under data/biofilm_train/crop_shape.csv), load an image from data/processed and crop it manually.

  3. The manually cropped images generated for this particular analysis are stored under data/cropped.

napari_crop_png

APOC Training

  1. 0_train_APOC_on_folders.ipynb shows how to train your own Accelerated Object and Pixel (semantic) APOC classifiers to tell biofilm from background. An example of how to generate the needed sparse labelling and using Napari-Assistant can be found here.

  2. The ground truth annotations used in this particular analysis can be found under data/biofilm_train/images and data/biofilm_train/masks.

Image Analysis

  1. Run 3_biofilm_meas.ipynb to measure the plate percentage covered by biofilm from the cropped images stored under data/cropped. This will generate a .csv file with all the measurements and will open a Napari window so you can inspect the segmentation results overlaid over the cropped image. In addition it will store the predictions as .tiff files under output/predictions. The .csv file with the results can be found also inside output.

  2. Run 4_data_representation.ipynb to obtain an in-notebook representation of all the input images and predictions. This will also generate a .pdf file to share the results with colleagues.

Environment setup instructions

  1. In order to run these Jupyter notebooks and .py scripts you will need to familiarize yourself with the use of Python virtual environments using Mamba. See instructions here.

  2. Then you will need to create a virtual environment using the following command:

    mamba create -n biofilm devbio-napari python=3.9 pyqt -c conda-forge

  3. I recommend going through the Jupyter notebooks (.ipynb) files in order to familiarize yourself with Napari (image viewer) and the script functionalities.

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.