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.
-
Contact Me to obtain a fresh working S3 bucket pre-signed link.
-
Paste the link inside
0_data_download.ipynb
notebook afterpresigned_url
. -
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.
-
Notebook
1_raw_data_processing.ipynb
takes thedata/raw_data
folder structure and extracts the tiled images obtained from an EVOS 2 microscope. -
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 fromdata/processed
and crop it manually. -
The manually cropped images generated for this particular analysis are stored under
data/cropped
.
-
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. -
The ground truth annotations used in this particular analysis can be found under
data/biofilm_train/images
anddata/biofilm_train/masks
.
-
Run
3_biofilm_meas.ipynb
to measure the plate percentage covered by biofilm from the cropped images stored underdata/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 underoutput/predictions
. The .csv file with the results can be found also insideoutput
. -
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.
-
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.
-
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
-
I recommend going through the Jupyter notebooks (.ipynb) files in order to familiarize yourself with Napari (image viewer) and the script functionalities.