Author: Veeramohan Veerapandian
Date: 5 June 2025
- macros/
merge_channels.ijm– Adjust contrast and merge multi-channel imagesquantify_nuclei.ijm– Quantify OSX/RUNX2/DAPI/SP7-like nuclear signals
- examples/ – Optional: sample input images (upload
.tiffiles) - results/ – Example outputs (merged PNGs or TIFFs and quantification CSV in
.csv) - README.md – This documentation file
Purpose:
- Adjust contrast, clean up images per channel (OSX, EMCN, CD31, DAPI)
- Merge selected channels and add a scale bar
- Save composite outputs
Workflow Highlights:
- Prompts for input and output directories
- Imports only files with
"Stitching"in the name using Bio‑Formats - Rotates, splits, enhances each channel:
- C1 (OSX) → Grayscale, sharpened
- C2 (CD31) → Green, despeckled
- C4 (EMCN) → Red, local contrast enhanced
- C3 (DAPI) → Blue
- Generates merged output channels like
OSX/EMCN/CD31andEMCN/CD31with scale bar - Saves PNGs to output folder
Purpose:
- Quantify nuclear signals (e.g., OSX, RUNX2, DAPI, SP7) from stacked image series
Workflow Highlights:
- Prompts for input and output directories
- Iterates over files with
"Stitching" - Uses Bio‑Formats to import series 0
- Crops a user-selected ROI and preprocessing:
- Background subtraction, despeckle, median + unsharp mask
- Selects the middle 25 slices, performs a maximum-Z projection
- Saves the projection TIFF
- Converts to 8-bit, enhances contrast, applies Otsu threshold, then watershed
- Detects particles, outlines them, saves outlined TIFF
- Counts objects, calculates normalized counts, and total area per slice
- Logs metrics (
fileName, seriesIndex, count, normC, totalArea) intoOSX_Fixed25norm_Results.csvin the output folder
- Open either macro in Fiji/ImageJ (Plugins → Macros → Run… or Script Editor → Run)
- Select the input directory (network or shared folder)
- Select the output directory (local)
- Let the script process images:
- merge_channels → PNG images with scale bars
- quantify_nuclei → TIFFs and a CSV summary
(Upload these once you have sample data)
-
merge_channelsresults:OSXgry_EMCNr_CD31grn_filename.pngEMCNr_CD31grn_filename.png
-
quantify_nucleiresults:- TIFF projection:
_proj25.tif - Outlined TIFF:
_proj25_outlined.tif - CSV summary:
OSX_Fixed25norm_Results.csv
- TIFF projection:
- Fiji (ImageJ) with Bio-Formats Macro Extensions plugin installed
- Customize channel selection logic (
selectWindow("C1-…"), etc.) and thresholds as needed - Adjust
'Stitching'filename filter if your naming convention differs - For
quantify_nuclei, modify ROI size and slice-window parameters based on your data
- Before running in batch, run on one image to validate results
- Adjust
rolling,median, andunsharpvalues to match your image quality - For
quantify_nuclei, examine the overlay to ensure nuclei are correctly detected before saving
This work is shared for academic and research use only. Please credit the author if used or modified in published work.
Veeramohan Veerapandian
Social: www.linkedin.com/in/dr-veeramohan-veerapandian-388b3217 | https://bsky.app/profile/veeramp.bsky.social | https://x.com/VeeramohanV