Skip to main content

A repository to process organoid images

Project description

:herb: Tapenade : Thorough Analysis PipEliNe for Advanced DEep imaging

License MIT PyPI Python Version tests codecov

A fully-visual pipeline for quantitative analysis of 3D organoid images acquired with deep imaging microscopy.

If you use this plugin for your research, please cite us.


Table of contents

Overview

The Tapenade pipeline is a tool for the analysis of dense 3D tissues acquired with deep imaging microscopy. It is designed to be user-friendly and to provide a comprehensive analysis of the data. The pipeline is composed of several steps, each of which can be run independently.

The pipeline is composed of the following methods:

  1. Spectral filtering: Given a set of calibrated emission spectra, allows the unmixing of the different fluorophores present in the image.
  2. Registration & fusion: Allows for spatial fusion of two images (e.g. acquired with a dual-view microscope).
  3. Pre-processing: Provides many pre-processing functions, like rescaling, masking, correction of optical artifcats, etc.
  4. Segmentation: Detect and seperate each nuclei in the image. We provide trained weights for StarDist3D, a state-of-the-art deep learning model for nuclei segmentation.
  5. Masked smoothing: Produces smooth fields of a given dense or sparse quantity, which allows for multiscale analysis.
  6. Spatial correlation analysis: Computes a spatial correlation map between two continuous fields.
  7. Deformation tensors analysis: Computes deformation tensors (inertia, true strain, etc.) from segmented objects.

All methods are explained in details in our Jupyter notebooks, which are available in the notebooks folder.

Installation

Main library

We recommand to install the library in a specific environement (like conda). To create a new environement, you can run the following command:

conda create -n env-tapenade python=3.10

You can then activate the environement with:

conda activate env-tapenade

For here onward, it is assumed that you are running the commands from the env-tapenade conda environement.

You can install tapenade via pip:

pip install tapenade

To install the latest development version:

pip install git+https://github.com/GuignardLab/tapenade.git

To install the latest development version in editable mode:

git clone git@github.com:GuignardLab/tapenade.git
cd tapenade
pip install -e .

This will install only the main library, without the libraries for the registration/fusion and segmentation methods. To install them, please follow the instructions below.

Registration and fusion (optional)

The registration and fusion methods require the 3D-registration Python package. To install it, follow the instructions on the library's repository.

Segmentation (optional)

We provide trained weights for StarDist3D, a state-of-the-art deep learning model for nuclei segmentation. To install Stardist3D, follow the instructions on the library's repository.

If you prefer to use StarDist3D with a graphical user interface, Stardist3D is also available as a plugin in several softwares, like Napari, Fiji, and Icy (more details on the Stardist3D repository).

We highly recommend using the change_arrays_pixelsize and local_image_equalization methods (defined here) from our library to preprocess your data before running the inference with our custom StarDist3D weights.

Though not mandatory, we also recommend running the inference with StarDist3D on a GPU for faster results. If you don't have a GPU, you can use the ZeroCostDL4Mic Google Colab notebooks, which allow you to run the inference on a GPU for free. You can find the ZeroCostDL4Mic notebooks for StarDist3D here.

Usage

The methods described above are available at the following locations:

  1. Spectral filtering: Code, Notebook
  2. Registration & fusion: Code, Notebook
  3. Pre-processing: This script gathers all preprocessing functions, Notebook
  4. Segmentation: Code, Notebook
  5. Masked smoothing: Code (it is one of the preprocessing function), Notebook
  6. Spatial correlation analysis: Code, Notebook
  7. Deformation tensors analysis: Code, Notebook

All methods are explained in details in our Jupyter notebooks, which are available in the notebooks folder.

Complementary Napari plugins (for graphical user interfaces)

During the pre-processing stage, dynamical exploration and interaction led to faster tuning of the parameters by allowing direct visual feedback, and gave key biophysical insight during the analysis stage. We thus created three user-friendly Napari plugins designed around facilitating such interactions:

  1. napari-manual-registration (available here) When using our automatic registration tool to spatially register two views of the same organoid, we were sometimes faced with the issue that the tool would not converge to the true registration transformation. This happens when the initial position and orientation of the floating view are too far from their target values. We thus designed a Napari plugin to quickly find a transformation that can be used to initialize our registration tool close to the optimal transformation. From two images loaded in Napari representing two views of the same organoid, the plugin allows the user to either (i) manually define a rigid transformation by continually varying 3D rotations and translations while observing the results until a satisfying fit is found, or to (ii) annotate matching salient landmarks (e.g bright dead cells or lumen-like structures) in both the reference and floating views, from which an optimal rigid transformation can be found automatically using principal component analysis.

  2. napari-tapenade-processing (available here) From a given set of raw images, segmented object instances, and object mask, the plugin allows the user to quickly run all pre-processing functions from our main pipeline with custom parameters while being able to see and interact with the result of each step. For large datasets that are cumbersome to manipulate or cannot be loaded in Napari, the plugin provides a macro recording feature: the users can experiment and design their own pipeline on a smaller subset of the dataset, then run it on the full dataset without having to load it in Napari.

  3. napari-spatial-correlation-plotter (available here) This plugins allows the user to analyse the spatial correlations of two 3D fields loaded in Napari (e.g two fluorescent markers). The user can dynamically vary the analysis length scale, which corresponds to the standard deviation of the Gaussian kernel used for smoothing the 3D fields. If a layer of segmented nuclei instances is additionally specified, the histogram is constructed by binning values at the nuclei level (each point corresponds to an individual nucleus). Otherwise, individual voxel values are used. The user can dynamically interact with the correlation heatmap by manually selecting a region in the plot. The corresponding cells (or voxels) that contributed to the region's statistics will be displayed in 3D on an independant Napari layer for the user to interact with and gain biological insight.

How to cite

If you use this plugin for your research, please cite us using the following reference:

  • Jules Vanaret, Alice Gros, Valentin Dunsing-Eichenauer, Agathe Rostan, Philippe Roudot, Pierre-François Lenne, Léo Guignard, Sham Tlili bioRxiv 2024.08.13.607832; doi: https://doi.org/10.1101/2024.08.13.607832

This repository has been developed by (in alphabetical order):

Contributing

Contributions are very welcome. Tests can be run with tox or pytest, please ensure the coverage at least stays the same before you submit a pull request.

License

Distributed under the terms of the MIT license, "tapenade" is free and open source software

Issues

If you encounter any problems, please file an issue along with a detailed description.


This library was generated using Cookiecutter and a custom made template based on @napari's cookiecutter-napari-plugin template.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tapenade-0.0.7.tar.gz (46.0 kB view details)

Uploaded Source

Built Distribution

tapenade-0.0.7-py3-none-any.whl (47.2 kB view details)

Uploaded Python 3

File details

Details for the file tapenade-0.0.7.tar.gz.

File metadata

  • Download URL: tapenade-0.0.7.tar.gz
  • Upload date:
  • Size: 46.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for tapenade-0.0.7.tar.gz
Algorithm Hash digest
SHA256 356159e15215b160a61e3f0327c4fc01a320cf33631fff2a04e9436b8d22fd18
MD5 24043d3cfa20c50217c1d3cebb59db0c
BLAKE2b-256 f6a1489a890242b57ee2b5dc5b4d4e3c3303c7322eb25823a6a781cc13c157e4

See more details on using hashes here.

File details

Details for the file tapenade-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: tapenade-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 47.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for tapenade-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 b91a5ba5c2afb4be8e67a308499b0299acebed204ebb8b5d71421b39daadfd45
MD5 4c78b41fd51dcffdf228aa9a53a339e5
BLAKE2b-256 134230b359639ce106799c339603fe749b050af801b8cd9eb5f4933ade2f6062

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page