Dec 26, 2025

Public workspaceProtocol for Quantifying γH2AX Foci in Cells Using Fiji Software

  • Jianxiong Chen1
  • 1Department of Pathology, The Tenth Affiliated Hospital, Southern Medical University (Dongguan People's Hospital), Dongguan,Guangdong, 523059, China.
  • Data Analysis Protocol
Icon indicating open access to content
QR code linking to this content
Protocol CitationJianxiong Chen 2025. Protocol for Quantifying γH2AX Foci in Cells Using Fiji Software. protocols.io https://dx.doi.org/10.17504/protocols.io.81wgbo15nlpk/v1
License: This is an open access protocol distributed under the terms of the Creative Commons Attribution License,  which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited
Protocol status: Working
We use this protocol and it's working
Created: December 26, 2025
Last Modified: December 26, 2025
Protocol Integer ID: 235857
Keywords: γH2AX foci, ImageJ, automated workflow for γh2ax foci quantification, reproducible quantification of γh2ax foci, nuclear segmentation, γh2ax foci quantification, protocol for quantifying γh2ax foci, dna damage in fluorescence microscopy image, quantifying γh2ax foci, using fiji software γh2ax foci formation, nucleus foci count, fiji software γh2ax foci formation, evaluating dna damage response, detecting dna, fluorescence microscopy image, γh2ax foci, watershed separation, dna damage response, proper image acquisition, dapi image, thresholding strategy, dna damage, controlled thresholding, cell level
Abstract
γH2AX foci formation is a widely used marker for detecting DNA double-strand breaks and evaluating DNA damage responses at the single-cell level. Accurate and reproducible quantification of γH2AX foci, however, remains challenging due to variability in image quality, thresholding strategies, and subjective manual counting. Here, we present an optimized and automated workflow for γH2AX foci quantification using Fiji (ImageJ) combined with a custom macro. This protocol emphasizes proper image acquisition, nuclear segmentation, and controlled thresholding to minimize false-positive detection caused by background noise or low-intensity signals. Nuclei are segmented from DAPI images using binary processing and watershed separation, followed by manual quality control to exclude edge or improperly segmented nuclei. γH2AX foci are then automatically quantified within each nucleus using a custom macro that ensures consistent and reproducible measurement. The resulting output provides per-nucleus foci counts in a standardized csv format suitable for downstream statistical analysis. Compared with previously reported methods, this optimized workflow reduces overestimation of foci and improves robustness across experimental conditions. This protocol provides a reliable and user-friendly approach for quantitative analysis of DNA damage in fluorescence microscopy images.
Troubleshooting
Install Fiji software
First download Fiji.
Navigate to https://imagej.net/software/fiji/downloads.
Select your platform.
Download the appropriate file for your operating system.
Unzip the downloaded file and launch Fiji.
Important note before analysis
Ensure that γH2AX images are not overexposed, as saturation can lead to artificially enlarged positive regions and inaccurate foci detection. In previously published protocols (DOI: 10.21769/BioProtoc.5421), extremely low-intensity signals were sometimes misidentified as foci, leading to overestimation—even when foci were not visible by eye. The optimized protocol below minimizes this issue and provides more reliable quantification.
Automated Quantification of γH2AX Foci Using a Custom Fiji MacroUntitled section
Installation of the Custom Fiji Macro.
Open Fiji.
Navigate to Plugins → Macros → Install.
Select the macro file count.ijm.
(rename the follwing code file to count.ijm before installation).
// The current output is saved to the desktop, with the file named "result.csv". You can change to another output file path

var outputFile = getDirectory("home") + "Desktop/result.csv";

var header = "ROI,Point\n"; // Header of the CSV file

var data = ""; // String for collecting data

data = data + header;

// Set parameters for Find Maxima
noiseTolerance = 10; // Adjust noise tolerance as needed
outputType = "Point Selection"; // Choose output type: "List" or "Point Selection"
excludeEdgeMaxima = true; // Whether to exclude edge maxima
lightBackground = false; // Set true/false depending on image background; false for dark background

// 新增:强度阈值
minIntensity = 5; // 调整这个值

// Get the number of ROIs from ROI Manager
roiManager("show all");
n = roiManager("Count");

command = "noise=" + noiseTolerance + " output=[Point Selection]";

if (excludeEdgeMaxima) {
command += " exclude";
}

if (lightBackground) {
command += " light";
} else {
command += " dark";
}

// Iterate through each ROI
for (i=0; i roiManager("select", i); // Select current ROI
// 最小修改:先把ROI转换成8-bit灰度图像
run("Duplicate...", "title=temp_roi");
run("8-bit");
run("Find Maxima...", command);
getSelectionCoordinates(xPoints, yPoints);
// 强度筛选
validCount = 0;
for (p=0; p x = xPoints[p];
y = yPoints[p];
intensity = getPixel(x, y); // 现在返回单个强度值
if (intensity >= minIntensity) {
validCount++;
}
}
nMaxima = validCount; // 使用筛选后的数量
data = data + i + "," + nMaxima + "\n";
// 清理临时图像
close("temp_roi");
}

print(data);
File.saveString(data, outputFile);

Note: The following line of the code
var outputFile = getDirectory("home") + "Desktop/result.csv";
can be replaced with
var outputFile = "/Users/ludeng/Desktop/test/result.csv";.
The path /Users/ludeng/Desktop/test/ can be modified to any desired output folder on your computer, and result.csv is the file name.

Note: Successful installation will display the macro name in the Plugins list (Figure 1).

Figure 1

Preparation of Nuclear Images.
Open the DAPI channel image in Fiji.
Confirm image scale:
  • Go to Analyze → Set Scale.
  • Click “Click to Remove Scale”, then select “Global” to apply the change to all images.
  • Click OK (Figure 2).

Figure 2

Convert image to 8-bit:
  • Image → Type → 8-bit.
Nucleus Segmentation.
Thresholding:
  • Go to Image → Adjust → Threshold.
  • Adjust minimum and maximum values until nuclei are properly segmented (Figure 3).
Figure 3

  • Click Apply.
Fill holes:
  • Process → Binary → Fill Holes.
Separate touching nuclei:
  • Process → Binary → Watershed.
ROI Identification.
Open ROI Manager:
  • Analyze → Tools → ROI Manager.
Detect nuclei:
  • Analyze → Analyze Particles.
  • Set Size to exclude debris and set the parameters according to Figure 4.
  • Click OK to proceed.

Figure 4

Note: Estimate the lower bound of particle size according to the calibrated image scale to exclude debris.
Manually curate ROIs:
  • Remove incorrectly segmented nuclei.
  • Remove nuclei touching image borders.
Edge nuclei should be excluded because:
  • Their boundaries are often incomplete.
  • Intranuclear foci cannot be reliably quantified.
To delete them:
  • Click the nucleus in the image.
  • The corresponding ROI will highlight in ROI Manager.
  • Click Delete.
Quantification of γH2AX Foci.
Open the γH2AX (green) channel.
Adjust contrast:
  • Image → Adjust → Brightness/Contrast .
  • Ensure foci are clearly visible (Figure 5).

Figure 5

  • Convert to 8-bit.
Run the macro:
  • Plugins → Macros → count.
Output:
  • Results are automatically saved as result.csv on the Desktop.
Note: The particle numbering in the analyzed image starts from 1, while the result log starts from 0, leading to a one-index difference.
Protocol references
Deng L, Wang D, Wu L. Protocol for Quantifying γH2AX Foci in Irradiated Cells Using Immunofluorescence and Fiji Software. Bio Protoc. 2025 Aug 20;15(16):e5421. doi: 10.21769/BioProtoc.5421. PMID: 40873480; PMCID: PMC12378418.