This repository contains two complementary scripts designed to analyze confocal microscopy data:
- Estimate the average size of DAPI+ cells from randomly sampled patches. - Use Single Cell Area Calculation
- Measure DAPI and Caspase-3 (clCASP3) stain coverage and intensity across
.lifimage series. - Use Stain Area Coverage Analysis - Normalize Caspase-3 intensity by DAPI cell size to get per-cell apoptotic burden.
Script: Single Cell Area Calculation.py
This script:
- Loads a
.liffile with DAPI-stained nuclei. - Extracts non-overlapping random patches from the DAPI channel.
- Segments each patch using the CellSAM deep-learning model.
- Counts objects (nuclei) and total DAPI+ area per patch.
- Saves masks and an Excel summary.
- Labeled TIFF masks per patch
- Excel file with:
- Number of DAPI+ cells per patch
- Total DAPI+ intensity per patch
Use this to compute the average area per DAPI+ nucleus:
Script: Stain Area Coverage Analysis.py
This script:
- Loads a
.liffile with DAPI and clCASP3 channels. - Computes max-intensity projections (MIPs).
- Extracts 10 random non-overlapping patches per image series.
- Applies Otsu thresholding on each channel.
- Calculates area (Β΅mΒ²) and intensity of DAPI+ and Caspase-3+ pixels.
- Saves overlays and exports a detailed Excel report.
- Binary masks for each patch
- RGB overlay images (R = Caspase-3, B = DAPI)
- Excel file with:
- DAPI and Caspase-3 area and intensity per patch
With both Excel files:
- From
estimate_dapi_cell_area.py: compute the mean DAPI+ cell area. - From
stain_area_coverage_analysis.py: use Caspase-3 total intensity per patch. - Normalize clCASP3 intensity per cell:
CellSAM is used in this code, find more here: @article{israel2023foundation, title={A Foundation Model for Cell Segmentation}, author={Israel, Uriah and Marks, Markus and Dilip, Rohit and Li, Qilin and Schwartz, Morgan and Pradhan, Elora and Pao, Edward and Li, Shenyi and Pearson-Goulart, Alexander and Perona, Pietro and others}, journal={bioRxiv}, publisher={Cold Spring Harbor Laboratory Preprints}, doi = {10.1101/2023.11.17.567630}, }