Traditional protocols for generating fibroblast/ECM functional units (see DOI: 10.1016/bs.mcb.2019.11.014 and 10.1002/cpcb.2) rely on large culture areas, which are necessary when harvesting material for downstream applications such as Western blotting or survival assays with cancer cells or fibroblasts. When the primary objective is immunofluorescence with confocal imaging, especially in studies that test multiple conditions or probe gene-specific effects using gene editing systems, a slide-based system and 96-well plate-based systems offer a convenient medium-throughput alternative. However, even if you use original approaches for generating fibroblast/ECM units and working with the extracellular matrix, the confocal image analysis pipeline remains applicable. Culturing fibroblasts in functional fibroblast/ECM units more accurately recapitulates physiological fibroblast behavior than monolayer culture. In this model, multilayered growth, as well as the quality of matrix deposition, must be evaluated. Utilizing glass slides with silicon isolators (molds) and 96-well plates, expand the number of testable conditions while minimizing the number of cells and reagents required per experiment. However, they generate large imaging datasets, making the development of automated, standardized analysis pipelines for confocal data essential.
This protocol describes the production of fibroblast/ECM units on glass slides with molds and provides a step-by-step framework for four assays:
Control of the fibroblast/ECM unit for the number of nuclei and layers.
Matrix thickness analysis, using fibronectin as the standard marker of ECM.
Fibronectin alignment as an indicator of fibroblast functional states.
Nuclear foci analysis to enable expanded phenotyping and comprehensive characterization of fibroblasts.
Together, these protocols provide a medium-throughput platform suitable for evaluating conditions and/or gene-specific effects on fibroblasts in the fibroblast/ECM model.
To generate fibroblast/ECM units, we cultured cancer-associated fibroblasts (CAFs) directly on standard glass microscopy slides fitted with commercially available silicone isolators. This setup creates 12 wells per slide (three rows and four columns). For simplicity and consistency, we typically assign one experimental condition per column, with three technical replicates per condition. As an alternative, the entire workflow can be implemented in 96-well plates, which further increases the number of testable conditions while maintaining low reagent consumption per reaction.
There are three steps to produce a fibroblast/ECM unit:
1. Surface preparation for matrix deposition
Multilayered fibroblast growth generates internal mechanical tension that can cause collapse of the fibroblast/ECM unit during matrix deposition. To overcome the problem, we culture on positively charged glass slides paired with silicone isolators. There are three steps to prepare a surface: First, the glass is coated with a gelatin solution, then crosslinked with glutaraldehyde, and washed with an ethanolamine solution to remove residual glutaraldehyde. For 96-well plate formats, pre-coat the wells with poly-D-lysine before the gelatin solution incubation step. Then, proceed with gelatin coating, glutaraldehyde crosslinking, and ethanolamine quenching.
After surface preparation, fibroblast seeds are placed onto the treated surfaces. Any fibroblastic line capable of overcoming contact inhibition at full confluence can be used. In the protocol, human fibroblastic lines derived from pancreatic ductal adenocarcinoma (PDAC) patients serve as the standard model.
After the fibroblasts have attached and reached full confluence, we switch standard media to a matrix production medium (complete growth medium supplemented with L-ascorbic acid (L-AA)). A daily medium change keeps the limited volume fresh and maintains an adequate L-AA level due to its rapid degradation. Including L-AA is critical because it serves as a cofactor for the enzymes that modify collagen; without a continuous supply, newly secreted collagen is insufficiently processed and therefore fails to assemble into the mature matrix needed for a robust fibroblast/ECM unit. Over the next several days, the confluent sheet thickens into a multilayered fibroblast/ECM unit.
For staining using glass slides with silicon molds, we treat each well as an independent micro-reaction chamber. The slide is fixed, permeabilized, and blocked using the same reagents as in conventional IF, with low reagent consumption. Primary and secondary antibodies are applied sequentially with gentle washes to prevent fibroblast-ECM units from detaching. This protocol reduces the use of antibodies per reaction and enables the imaging of twelve conditions or three technical replicates of four conditions on a single slide. In the 96-well plate format, IF is performed directly within each well, following the same sequence of steps, and similarly benefits from reduced reagent consumption per reaction and increased throughput.
The following section describes an automated analysis pipeline for confocal microscopy images of fibroblast/ECM units, which analyzes matrix layer thickness, nuclear counts, multilayering, fibronectin alignment, and nuclear foci. The scripts are compatible with confocal images (typicaly 60×-resolution) of fibroblast/ECM units generated by the 12-well slide or 96-well plate formats described above, as well as by alternative methods. Nuclear foci analysis can also be performed after re-plating cancer cells or fibroblasts onto extracted matrices to evaluate survival and proliferation, and fibronectin layer thickness and alignment analyses can be applied directly to extracted ECM (see DOI: 10.1016/bs.mcb.2019.11.014 and 10.1002/cpcb.2). Scripts work with .nd2 or .tif/.tiff files; if other formats are used, convert to TIFF (a FIJI macro described in the protocol can be used). Each file should contain Z-stacks acquired in separate channels (e.g., nuclei, fibronectin, and a nuclear-foci marker). The workflow combines standard FIJI/ImageJ operations with open-source AI tools. As input data for scripts, it works with folders of images; for practical organization, use separate folders per condition or embed condition metadata in file names within a single folder. Outputs include picture-keyed tables suitable for downstream statistics and visualization.
1. UMA-tools: fibroblast/ECM unit thickness assay based on fibrinectin staining
This Python-based script is designed to perform analysis of the thickness of the fibronectin layer in the fibroblast/ECM unit. The program analyzes confocal images (.nd2 tiff/tif) using ImageJ/FIJI without a GUI.
User-defined Inputs: Users modify a JSON file to set folders with image files.
A script prompts users to specify the type of microscopy files (.nd2 or .tiff).
Queries the user to input the total number of fluorescence channels present in the images and the fibronectin channel number.
Requests identification of the specific channel representing fibronectin for targeted analysis.
Image Processing Workflow: Specifically extracts the fibronectin channel from multichannel images.
Reslice Operation: The fibronectin layer is a 3D image object. Typically, analysis is performed in the XY projection, viewing the image from the top (or bottom). To analyze thickness, the image must be resized to allow viewing from the side, in the XZ projection.
Maximum Intensity Z-Projection: Generates a two-dimensional representation from the three-dimensional image stack to highlight regions of maximum fibronectin intensity.
Filtering and Background Subtraction: Applies a maximum intensity filter and Gaussian blur to enhance features and reduce noise. Conducts background subtraction to eliminate non-specific signal.
Thresholding and Mask Creation: Implements an Otsu-based automatic thresholding method to create binary masks clearly distinguishing fibronectin structures from the background.
Local Thickness Analysis: Utilizes the Local Thickness ImageJ plugin to measure the thickness of fibronectin layers quantitatively.
Data Extraction and Quantification: Calculates key statistical parameters of thickness values.
Output and Data Management: Saves processed mask images and thickness measurement images as separate TIFF files for visual verification and further qualitative analysis. Automatically compiles results into a CSV file summarizing the measured parameters for all processed images.
2. UMA-tools: Fibronectin fibers alignment distribution. Original protocol. Windows system only
The original fibronectin-analysis pipeline relies on the OrientationJ plugin running in FIJI’s GUI (https://bigwww.epfl.ch/demo/orientation/). Due to plugin-specific limitations, full automation using Python is only effectively possible on Windows systems. To use the original approach and calculations, perform the analysis on a Windows system. User-defined Inputs: Users modify a JSON file to set folders with image files. The user also sets the angular range within which fibers are considered aligned. For example, X% of fibers may lie within ±5°, ±10°, or ±15°.
Channel Extraction: Selectively isolates (the user defines the number of a channel in the image) the fibronectin fluorescence channel from multichannel images.
Image pre-processing: Converts 3D image stacks into 2D images using maximum intensity projections (XY projection).
Orientation Analysis (OrientationJ plugin): A script use the OrientationJ plugin to assess fibronectin fiber orientation, producing visual maps that display fiber direction and coherence. Produces data representing fiber alignment angles.
Fibronectin colors normalization: Generates HSV color-coded images to visually represent fiber orientation and directionality. Depending on the orientation of the dominant fibers in an image, their colors may differ across images. The script normalizes the color, assigning cyan to fibers that dominate in each image, making it easier to compare two images visually.
Statistical Analysis: The program calculates the percentage of fibers based on the selected angular mode (±5°, ±10°, ±15°) and assigns the status aligned or disorganized if the rate is greater than or less than 55%, respectively.
Output and Data Management: Organizes output data into folders for processed images and analysis results. Automatically compiles alignment statistics into Excel files.
3. UMA-tools: Fibronectin fibers alignment distribution by OrientationJ using python library
Similar to the program described above, this script analyzes fibronectin alignment but uses a different approach using a Python library (https://pypi.org/project/orientationpy/) instead of the OrientationJ plugin. As a result, some numerical differences may occur; however, the observed trends between comparison groups remain consistent. The main advantage of this program is its compatibility with Linux and macOS systems. You can also run the script on Windows using WSL. User-defined Inputs: same as protocol UMA-tools: Fibronectin fibers alignment distribution. Original protocol. Windows system only
Channel Selection: Identifies and extracts the specific fibronectin channel from multichannel microscopy images.
Image pre-processing: Creates maximum intensity 2D projections from 3D image stacks, simplifying the analysis of fiber orientation.
Orientation Analysis (orientationpy): Quantify fiber directionality and coherence. Produces detailed histograms and CSV files representing the distribution and frequency of fiber orientations.
Fibronectin colors normalization: Performs image generation and color normalization similar to what is described in the protocol above.
Output and Data Management: Organizes outputs into systematically labeled directories, including processed images, detailed tables, and summary reports. Calculates metrics such as the percentage of fibers aligned within specified angular thresholds and categorizes fiber alignment as 'aligned' or 'disorganized'.
4. UMA-tools: Nuclei counts and layers prediction
The main challenge in counting nuclei in confocal microscopy is the time required for manual Z-stack picture-by-picture analysis. A technical limitation of automated counting is the background signal from DAPI staining. To overcome this, an AI-based StarDist model was used, which significantly improves the efficiency of automated nuclear counting. Trained with our datasets, StarDist models for our fibroblastic cell lines were used in our pipeline; however, when applying this script to your own data, it may be necessary to train a new model. This Python script implements a comprehensive 3D nuclei analysis pipeline designed for microscopy images.
The analysis is performed by sequentially running three scripts:
Script 1: Fiji-based nuclei channel extraction and 3D pre-filtering
Prepare nuclei stacks for downstream segmentation by extracting the specified nuclei channel and applying 3D denoising/smoothing in headless Fiji/ImageJ across all images in each dataset folder.
Config-driven initialization: Loads a JSON config to find folders with images (.nd2, .tif, and .tiff files) and numeric parameters (nuclei channel index, Gaussian sigma, mean filter radius).
Channel extraction: duplicates the user-specified nuclei channel from each multichannel image into a working image.
3D filtering: applies a 3D Gaussian Blur followed by a 3D Mean to reduce noise and smooth intensity variations while preserving nuclear structures.
Batch processing and logging: The program sequentially processes each specified folder and image, saving the data to newly created folders.
Script 2: StarDist-based 3D nuclei segmentation and QC overlays
Segment nuclei in 3D using a StarDist-based model, generate label masks for downstream quantification, and produce quick visual QC overlays.
Key features include: Model loading: Uses a custom StarDist3D model trained by the user on their dataset if model_path is provided; otherwise, loads the pretrained 3D_demo model.
Label masks: Creates a 3D mask for nuclei per picture in all provided folders.
QC overlays: saves mid-z slice overlays as PNG showing raw signal and semi-transparent label map for quick verification.
Script 3: 3D nuclei quantification, QC projections, and HDBSCAN clustering.
Generates XY, XZ, and YZ projection visualizations and performs predictive analysis to estimate the number of nuclear layers/clusters in fibroblast/ECM units, assembling per-image and batch summaries for downstream analysis.
Quantification: extracts per-nucleus metrics.
QC projections: renders maximum-intensity projection images (XY, XZ, YZ).
Depth-aware clustering: builds a coordinate matrix (x, y, z) and predicts the number of nuclei layers using the Scikit-learn library.
Output and Data Management: records totals, number of XZ/YZ clusters, unclustered counts, and per-cluster sizes. Aggregates per-image stats, supports both per-folder and overall summaries.
5. FIA-tools: foci imaging assay
In addition to nuclear layer count, fibronectin thickness, and orientation, analyzing additional markers is essential for understanding changes in the biological properties of the fibroblast/ECM unit. This may include the expression intensity of specific proteins. This script provides a universal tool for analyzing nuclear foci markers (e.g., Ki-67). The program can also be used when the entire nucleus is stained. Additionally, it enables the analysis of multiple markers and their colocalization, if necessary. This program uses a 2D XY projection of nuclei and applies the standard StarDist model to identify nuclei even in the presence of high background and debris. Further analysis is performed using standard FIJI/ImageJ tools. Similar to the previous scripts, this program can process multiple folders containing multiple images each.
The program consists of several scripts:
Script 1: Image Pre-processing and Channel Extraction (Foci Analysis Pipeline) .
This initial script is essential for preparing microscopy image data for accurate downstream analysis of nuclear foci.
User-defined Inputs: Users modify a JSON file to set folders with image files.
Interactive Channel Selection: Requests user input to specify: The fluorescence channel corresponding to nuclei staining. One or multiple fluorescence channels designated for foci detection.
Image Processing Workflow: Differentiates processing based on image file formats: For ND2 ( multiple Z-stacks):
Nuclei Channel: Generates maximum intensity Z-projections.
Foci Channels: Performs standard deviation Z-projections.
For TIF/TIFF (already Z-projection 2D images - option for FIA only): Channel Splitting: Extracts specified nuclei and foci channels directly from multi-channel 2D images without additional Z-projections.
Output and Data Management: Automatically creates a structured foci_assay directory with subfolders for processed nuclei and each foci channel, writes an image_metadata.txt file with pixel size, units, and image dimensions, adds confirmations for critical actions (such as overwriting) with detailed logs, and validates inputs while handling unexpected file formats with clear user feedback.
Script 2: Nuclei Segmentation and Mask Generation
This second script segments nuclei by combining an AI tool (StarDist) and classical ImageJ methods.
Validation of Nuclei Folders: Checks for the existence of pre-processed nuclei images produced by the previous script.
Nuclei segmentation: Employs the pre-trained StarDist model (2D_versatile_fluo) tailored explicitly for fluorescent microscopy data. Automatically segments nuclei, generating binary masks of individual nuclei.
Mask Post-processing and Saving: Creates output directories to store nuclei masks.
Classical Image Processing with ImageJ: Further refines StarDist-generated masks using ImageJ’s particle analysis and watershed segmentation to separate touching nuclei. Provides control over the segmentation by setting a user-defined minimum particle size, ensuring irrelevant small-size artifacts are excluded.
Output and Data Management: Produces detailed logs at each stage, capturing warnings or errors related to data handling or segmentation. Offers interactive prompts to confirm user actions (e.g., overwriting existing results).
Script 3: Foci Detection and Mask Generation (Thresholding and Particle Analysis)
The third script generates high-quality binary masks of nuclear foci, preparing data for the subsequent and final quantitative analysis and statistical assessment steps.
Folder and File Validation: Confirms the presence of crucial directories required TIFF images created by previous scripts. Parses calibration metadata from the previously created image_metadata.txt file.
Applies pixel dimensions and units consistently to ensure precise quantitative measurements during subsequent analyses.
Interactive Subfolder Selection: Lists available foci subfolders (e.g., Foci_1_Channel_1) across all datasets, allowing the user to select a specific staining or condition for consistent processing across multiple samples.
Automated Thresholding and Particle Analysis (ImageJ): Uses a user-defined intensity threshold to isolate nuclear foci effectively. Converts thresholded images into binary masks and utilizes watershed segmentation to separate touching or overlapping foci accurately. Analyzes segmented particles to generate precise masks representing the spatial distribution of nuclear foci.
Output and Data Management: Creates subfolders for organized storage of processed masks.
Script 4: Foci quantification
Folder Structure Validation: Verifies the existence of the required foci_assay directory structure and identifies the most recent nuclei and foci mask folders. Parses metadata files (image_metadata.txt) for accurate dimensional calibration (pixel size and measurement units).
Parallelized Processing: perform computationally intensive tasks simultaneously across multiple CPU cores.
Nuclei Segmentation and Labeling: Loads pre-segmented and labeled nuclei masks. Assigns labels and computes area-related metrics (in pixels and µm²) for each nucleus. Generates and saves annotated images with labeled nuclei for quick visual validation.
Foci Counting and Area Calculations: Analyzes labeled nuclei masks against corresponding foci masks to determine the number of foci per nucleus. Calculates the total foci area within each nucleus, both in absolute terms (pixels, µm²) and relative to nucleus area (%).
Optional Colocalization Analysis: If selected by the user, the script conducts intersection (colocalization) analyses between multiple foci channels.
Intersection Mask Creation: Identifies areas of overlap (colocalization) among selected foci channels.
Generates binary intersection masks highlighting co-localized regions.
Advanced Metrics: Calculates quantitative metrics specifically for these colocalization areas, providing detailed information on multi-channel interactions.
Output and Data Management: Organizes and merges results from single-channel and colocalization analyses into a unified DataFrame. Produces a clearly structured CSV file containing quantitative data for subsequent statistical analysis.