Skip to content

Example Usage and Tutorials

Caterina Fuster-Barceló edited this page May 20, 2024 · 8 revisions

📚 Example Usage and Tutorials

Introduction

The DeepImageJ case studies repository contains various examples demonstrating how to use DeepImageJ for different bioimage analysis tasks. These case studies illustrate the application of deep learning models for image-to-image translation, nuclei segmentation, and integration with the BioImage Model Zoo. Each example includes scripts, macros, and detailed instructions to replicate the workflows. More details can be found in this article.

Case Study 1: Pipeline for Integrated Image-to-Image Translation and Nuclei Segmentation

Details

Step by Step Guide

Fine-Tuning Pix2Pix and StarDist

To fine-tune the models for your specific data, follow these steps:

  1. Download Datasets:

    • Obtain the two datasets required for this case study. If using Google Colab, upload these datasets to Google Drive. If fine-tuning locally, ensure the datasets are accessible on your local drive.
  2. Fine-Tune Pix2Pix:

    • Use the ZeroCostDL4Mic notebook for Pix2Pix to fine-tune the Pix2Pix model for 200 epochs with default parameters.
    • Training parameters:
      • Batch size: 1
      • Loss function: Vanilla Generative Adversarial Network (GAN)
      • Patch size: 512 × 512
      • Initial learning rate: 2e-4
      • Data augmentation: None
    • The Pix2Pix model is exported using PyTorch 2.0.1.
  3. Fine-Tune StarDist:

    • Use the ZeroCostDL4Mic notebook for StarDist to fine-tune the StarDist model for 100 epochs.
    • Training parameters:
      • Dataset: 45 paired image patches (1024 × 1024)
      • Patch size: 1024 × 1024
      • Batch size: 2
      • Initial learning rate: 3e-4
      • Data augmentation: None
    • The StarDist model is exported using TensorFlow 2.14.
  4. Export Models:

    • Ensure both fine-tuned models are exported in the BioImage Model Zoo format. Pay careful attention to the exporting and packaging requirements, including metadata.

Pix2Pix and StarDist with DeepImageJ

Once the models are exported, follow these steps to install and use them in DeepImageJ:

  1. Install Models in DeepImageJ:

    • Open Fiji and navigate to Plugins > DeepImageJ > DeepImageJ Install Model.
    • Move to the Private Model tab, select From ZIP file, and add the path to your model zip file one by one.
  2. Run the Macro:

    • Use the macro provided here.
    • Modify the paths for the input and output folders in the macro to match your directories.
    • The macro workflow includes:
      1. Running the fine-tuned Pix2Pix model through DeepImageJ to perform image translation from actin to DAPI images.
      2. Running the fine-tuned StarDist model on the synthetic DAPI images.
      3. Performing StarDist post-processing steps.
  3. Output:

    • You will obtain a folder with the masks of your input images. If using the same data, expect five masks corresponding to the five time points.

TrackMate

To conclude this use case, you can use TrackMate for tracking and data visualization:

  1. Load Time Points:

    • Load the final five masks into TrackMate.
  2. Perform Tracking:

    • Follow the default options and documentation in TrackMate to perform the tracking analysis.
    • Refer to the TrackMate documentation for detailed instructions.

By following these steps, you will successfully fine-tune and apply Pix2Pix and StarDist models using DeepImageJ, and perform tracking analysis with TrackMate.

Case Study 2: Comprehensive 3D Nuclei Segmentation with deepImageJ

Details

Step by Step

Case Study 3: Segmentation of Arabidopsis Apical Stem Cells and Integration with the BioImage Model Zoo in deepImageJ

Details

Step by Step

Clone this wiki locally