Skip to content

Tools to analyze intestinal organoid imaging at the Martin-Alonso/Oudhoff lab using AI

License

Notifications You must be signed in to change notification settings

adiezsanchez/intestinal_organoid_yolov8

Repository files navigation

Instance Segmentation of Intestinal organoids and Spheroids from BrightField images using YOLOv8 (ISIS-BF-YOLO)

License Development Status

workflow

This repository contains a number of tools to speed up the interpretation of images from intestinal organoids acquired using a widefield microscope (brightfield illumination). In our case an EVOS M7000 multiwell scanner which outputs the following filenames: P1_Plate_M_p00_z00_0_A01f00d0.

  1. This tool uses the previously mentioned naming convention to extract the well_id from each image ("A01"), scan through all z-planes ("z00") and perform a minimum intensity projection.

  2. Based on said projections a previously trained YOLOv8 model predicts instances of 3 classes of intestinal organoids: differentiated organoids, spheroids and dead/overgrown organoids.

  3. It extracts counts of each object on a per class basis and morphology measurements such as area, perimeter, circularity and solidity.

  4. Finally it generates two plate views of the entire multiwell plate at high resolution for data exploration (minimum intensity projection and segmentation). Filenames must contain the well_id identifier in order for the scripts to work and plot the plate views.

Instructions

  1. In order to run these Jupyter notebooks 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 (venv) either using the following command or recreate the environment from the .yml file you can find in the envs folder:

    mamba create -n int_organoids python=3.9 devbio-napari cellpose pytorch torchvision plotly pyqt ultralytics python-kaleido -c conda-forge -c pytorch

  3. To recreate the venv from the environment.yml file stored in the envs folder (recommended) navigate into the envs folder using cd in your console and then execute:

    mamba env create -f environment.yml

  4. (optional) If you want to automatically save the resulting .png graphs install kaleido in the venv using pip:

    mamba activate int_organoids

    pip install kaleido

  5. Once your virtual environment is ready you can copy all your folders containing the images from EVOS inside the data directory using the following structure:

    intestinal_organoid_YOLOv8/ #Primary data folder for the project ├── data/ #All input data is stored here. │ ├── Plate_01/ │ │ ├── P1_Plate_M_p00_z00_0_A01f00d0.TIF │ │ ├── P1_Plate_M_p00_z01_0_A01f00d0.TIF │ │ └── ... │ ├── Plate_02/ │ │ ├── P2_Plate_M_p00_z00_0_A01f00d0.TIF │ │ ├── P2_Plate_M_p00_z01_0_A01f00d0.TIF │ │ └── ... │ └── ...
  6. The easiest way to interact with the analysis code is via Jupyter Lab. To launch a jupyter lab server run the following commands:

    mamba activate int_organoids

    jupyter lab

  7. Open 1_image_analysis.ipynb, define your username and desired resolution for the output plates and run all the cells.

  8. You will find all the results under .output/USERNAME, to explore the extracted stats run 2_image_analysis.ipynb.

About

Tools to analyze intestinal organoid imaging at the Martin-Alonso/Oudhoff lab using AI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published