imageJ: Cell Overlap with Multiple Filters

Hi all,

I’m trying to use ImageJ’s analyze particles tool to count cells in images with cells and background tissue stained in different colors (red, magenta, green, and blue).

I have got the program to count cells for each image, one at a time. However, since I’m working with different filters/colors, I have to account for overlapping cells so that cells are not counted twice. I was wondering if there is an existing tool that detects and outputs overlapping cells or if there is a feature that outputs the x and y coordinates of the counted cells. With the coordinate values, I could write a program that outputs which cells were counted more than once with the different filters.

If not, are there alternative programs that I can use other than ImageJ? Thank you in advance for your help!

Have a look at the ROIManager and ROI macro API of ImageJ:

Overlapping cells could be detected, e.g. with:

Roi.contains(x, y)
https://imagej.nih.gov/ij/developer/macro/functions.html#Roi.contains

Roi.getContainedPoints(xpoints, ypoints)
https://imagej.nih.gov/ij/developer/macro/functions.html#Roi.getContainedPoints

So you could for example add your cell selections to the ROI Manager (for each color) and then write a script to iterate over the ROI’s in the ROI Manager and detect overlapping cells.

See also:
https://imagej.nih.gov/ij/macros/ROI_Manager_Stack_Demo.txt

Another vague idea (only for counting) would be to simply apply a boolean ‘And’ operation to all ROI’s and count a created result (cells with overlap).

1 Like