Multi-Channel Nuclear Analysis

An ImageJ/FIJI plugin for analyzing multi-channel fluorescence images with a focus on nuclear segmentation using StarDist. If you find this plugin useful, please cite :)

Updates

December 2025: Added re-analysis capability allowing users to re-run the analysis using previously generated ROI files. This feature enables manual ROI editing and refinement without re-running the computationally intensive StarDist segmentation. See the Re-analysis Using Existing ROIs section for details.

Table of Contents

  1. Introduction
  2. Installation
  3. Requirements
  4. Compatibility Notice
  5. Usage
  6. Re-analysis Using Existing ROIs
  7. Tutorial and Example Data Analysis with Python
  8. Plugin for Merging Channels into Multi-Channel TIF Files
  9. Credits
  10. Citation

Introduction

Quantitative analysis of fluorescence microscopy images requires multiple steps, from image acquisition, followed by data extraction, visualization and statistical analysis.

Analysis Workflow

This tool allows researchers to easily extract fluorescence and shape based metrics from multi-channel fluorescence microscopy images by combining the power of the StarDist nuclear segmentation algorithm with customizable channel processing parameters. The macro automates routine tasks in image analysis workflows:

Installation

Download the file “Multi_Channel_Nuclear_Analysis.ijm” using the button at the top of the page. Copy the file into FIJI/ImageJ plugins folder or, within FIJI/ImageJ, go to plugins > install and navigate to the file location. Restart FIJI before using the script.

Requirements

To install Stardist, CSBDeep, and TensorFlow plugins in FIJI:

  1. Open FIJI
  2. Go to Help > Update...
  3. Click on Manage update sites
  4. Check the boxes for:
    • StarDist
    • CSBDeep
    • TensorFlow
  5. Click Close
  6. Click Apply Changes
  7. Restart FIJI

This will ensure that StarDist and all its dependencies (CSBDeep and TensorFlow) are properly installed.

Compatibility Notice

Important: Java Version Compatibility

This plugin requires FIJI running on Java 8 to function properly. Due to ongoing transitions in the FIJI/ImageJ ecosystem, the latest FIJI releases now use Java 21, which causes compatibility issues with TensorFlow and StarDist plugins that this tool depends on.

How to Check Your FIJI’s Java Version

  1. Open FIJI
  2. Go to Help > About ImageJ...
  3. Look for the Java version information in the about dialog
    • If it shows Java 1.8.x, your FIJI is compatible
    • If it shows Java 17.x or 21.x, you need to download the stable version

How to Get a Compatible Version

  1. Go to the FIJI download page
  2. Download the stable version (right column) for your operating system
    • Choose the JRE (Java Runtime Environment) version, not the JDK version
    • The stable versions run on Java 8 and are fully compatible with this plugin
    • Avoid the latest versions (left column) which run on Java 21

Compatibility Status

This compatibility issue is temporary and will be resolved once the TensorFlow and StarDist plugins are updated to support Java 21. We will update this documentation when full compatibility is achieved.

On macOS systems, users may encounter permission-related errors (e.g., “Can’t create an ImageOutputStream” or “Permission denied”) when the plugin attempts to save files. This is due to macOS security restrictions. To resolve this issue, users should:

  1. Ensure FIJI has permission to access the folder containing the images (avoid using system-protected locations like Desktop or Documents)
  2. Move the image files to a user-created folder with full permissions (e.g., create a new folder in your home directory)
  3. If using the Desktop or Documents folders, grant FIJI full disk access in System Preferences > Security & Privacy > Privacy > Full Disk Access

Usage

  1. Open ImageJ/FIJI
  2. Run the macro by selecting Plugins > Multi-Channel Analysis (bottom of the list)
  3. Follow the step-by-step dialog boxes to configure your analysis
  4. Choose your input directory containing images
  5. Review results in the output directory

Input Requirements

Preparation

Before running the script, it’s recommended to:

  1. Explore Your Images: Open a representative image in ImageJ/FIJI
  2. Determine Channel Count: Check how many channels your images have (1-4 supported)
  3. Choose Background Subtraction Method: For each channel, decide whether to use:
    • Standard background subtraction: Best for images with uniform background
    • Rolling ball background subtraction: Better for images with uneven background illumination
  4. Set Background Values:
    • For standard subtraction: Determine appropriate background values to subtract from each channel
    • For rolling ball method: Determine appropriate radius (in pixels) for each channel
  5. Determine Max Display Values: Find suitable brightness values for optimal visualization of PNG images
  6. Plan Channel Assignments: Decide which channel will be used for nuclear segmentation

The values you determine in this preparation stage will be used in the configuration dialog boxes when running the script.

Configuration Options

The script offers a user-friendly interface with three main configuration steps:

  1. Welcome Dialog:
    • Select number of channels in your images (1-4)
    • Open the ImageJ “Set Measurements” dialog to select which measurements to include
  2. Channel Configuration:
    • For each channel, set:
      • Background subtraction value
      • Background subtraction method:
        • Standard subtraction: Subtracts a fixed value from each pixel
        • Rolling ball method: Uses ImageJ’s rolling ball algorithm to remove uneven background (value represents radius in pixels)
      • Maximum display value in PNG images
      • Color for visualization
      • Suffix for naming output files
  3. Merge and Segmentation Configuration:
    • Select which channels to include in merged visualization
    • Choose which channel to use for nuclear segmentation

Output Files

The script generates the following outputs in an “analisis” subfolder:

Images

Data Files

Data Analysis

The CSV tables are the primary output for further quantitative analysis:

For Users Without Programming Skills

For Users With Basic Programming Skills

Tips for Best Results

Re-analysis Using Existing ROIs

After running the plugin and generating nuclear ROIs, you may want to manually edit the ROIs for specific images to improve segmentation accuracy or correct errors. The plugin provides a feature to re-run the analysis using previously generated ROI files, allowing you to refine your results without re-running the computationally intensive StarDist segmentation.

When to Use This Feature

This feature is particularly useful when:

Prerequisites

Before using this feature, ensure that:

  1. You have previously run the plugin and generated ROI files
  2. The Analysis folder exists in your input directory
  3. All ROI files ([ImageName]RoiSet.zip) are present in the Analysis folder for the images you want to re-analyze
  4. If you’ve manually edited ROIs, they have been saved with the same filename as the original ROI files

Step-by-Step Instructions

  1. Manually Edit ROIs (if needed):
    • Open ImageJ/FIJI
    • Open the image you want to edit
    • Load the ROI file: Plugins > ROI Manager > Open and navigate to Analysis/[ImageName]RoiSet.zip
    • Edit ROIs as needed using ImageJ’s ROI tools:
      • Add ROIs: Draw new selections and add them to the ROI Manager
      • Delete ROIs: Select unwanted ROIs in the ROI Manager and click “Delete”
      • Modify ROIs: Select and edit existing ROIs using the selection tools
    • Save the modified ROIs: ROI Manager > Save and save with the same filename ([ImageName]RoiSet.zip) in the Analysis folder
  2. Run the Plugin in Re-analysis Mode:
    • Open ImageJ/FIJI
    • Run the plugin: Plugins > Multi-Channel Nuclear Analysis > Run Analysis
    • Step 1 - Welcome Dialog: Configure the number of channels and measurement settings as usual
    • Step 2 - Channel Configuration: Configure all channel settings (background subtraction, display values, colors, suffixes) as you would for a new analysis
    • Step 3 - Merge and Segmentation Configuration:
      • Select which channels to include in the merged visualization
      • In the “Segmentation Channel” dropdown, select “Use existing ROIs (skip segmentation)”
      • Click “Finish”
  3. Select Input Directory:
    • When prompted, select the same input directory containing your images (not the Analysis directory)
    • The plugin will automatically:
      • Verify that the Analysis folder exists
      • Check that all ROI files are present for the images in the directory
      • Proceed with re-analysis if all files are found
  4. Processing:
    • The plugin will skip the StarDist segmentation step
    • It will load the existing (and potentially edited) ROI files
    • All channel processing, measurements, and CSV generation will proceed as normal
    • New output files will be generated, overwriting previous results

Important Notes

Troubleshooting

Workflow Example

  1. Initial analysis: Run the plugin on a set of images → generates ROIs and measurements
  2. Visual inspection: Review segmentation results and identify images needing correction
  3. Manual editing: Open problematic images, load ROIs, make corrections, save
  4. Re-analysis: Run plugin with “Use existing ROIs” option → regenerates all outputs with corrected ROIs
  5. Data analysis: Use updated CSV files for downstream analysis

This workflow allows you to iteratively refine your segmentation results while maintaining consistency in your analysis pipeline.

Full tutorial on youtube

Watch the comprehensive tutorial on how to use the Multi-Channel Nuclear Analysis plugin:

Example Data Analysis with Python

To help users get started with data analysis, I provide an example dataset with analysis code in Python. This demonstrates a typical workflow from raw data to visualization.

Example Experiment

This example is based on a real experiment involving mouse embryonic stem cells (mESCs) engineered to inducibly express a fusion protein comprising the transcription factor OCT6 linked to the mCherry fluorescent protein. Expression was induced by doxycycline treatment for 1, 2 or 3 days. An immunofluorescence was then performed against NANOG (alexa fluor 488), and nuclei were stained with DAPI. Channel

Key experimental details:

Analysis Files

Download the example data and analysis files: Download Example Dataset (ZIP)

The ZIP file contains:

Interactive Analysis in Google Colab

Explore the analysis interactively using the Google Colab notebook Open In Colab

The notebook demonstrates:

  1. Loading and exploring the CSV data from the ImageJ plugin
  2. Data cleaning and transformation
  3. Basic exploratory data analysis
  4. Creating publication-quality visualizations

This example shows how different background subtraction methods (fixed value vs. rolling ball) can be applied to different channels based on their characteristics, and how to analyze the resulting data.

Plugin for Merging Channels into Multi-Channel TIF Files

Some microscopes (such as Evos microscopes from ThermoFisher Scientific) save each channel as a separate TIF file instead of combining them into a multi-channel file. For these cases, I provide a companion plugin called Merge_multi_channel_tif.ijm that merges separate channel files into a single multi-channel TIF file before analysis.

Installation and Usage

  1. Download the Merge_multi_channel_tif.ijm file
  2. Install it in the same way as the main plugin (copy to the FIJI/ImageJ plugins folder or use Plugins > Install)
  3. Run the plugin through the Plugins menu
  4. Follow the configuration dialogs to set up the channel merging

File Naming Requirements

For the channel merging plugin to work correctly, your files must follow a consistent naming convention:

Example:

10X-Image1-DAPI.tif   // Base name: "10X-Image1", Suffix: "-DAPI"
10X-Image1-488.tif    // Base name: "10X-Image1", Suffix: "-488"
10X-Image1-594.tif    // Base name: "10X-Image1", Suffix: "-594"

The plugin will identify files with the same base name, merge them according to the channel configuration you specify, and save the result as a multi-channel TIF file that can be used with the main analysis tool.

Credits

Developed by Ariel Waisman at FLENI, Argentina

This tool utilizes the StarDist algorithm for nuclear segmentation:

Uwe Schmidt, Martin Weigert, Coleman Broaddus, and Gene Myers.
Cell Detection with Star-convex Polygons.
International Conference on Medical Image Computing and Computer-Assisted Intervention (MICCAI), Granada, Spain, September 2018.

Citation

Waisman A. 2025. Multi-Channel Nuclear Analysis: An ImageJ/FIJI Plugin for Automated Nuclear Segmentation and Multi-Channel Fluorescence Analysis. microPublication Biology. 10.17912/micropub.biology.001590.

License

MIT License Copyright (c) 2025 Ariel Waisman