In ImageJ, I set the threshold and then use nucleus counter which selects most of the cells. Then I manually go through and create new ROIs for the cells that nucleus counter missed. Then I measure the average intensity (mean gray value) of all the ROIs.
The problem is that I believe “mean” includes all of the pixels in the ROI, which means it depends on the area selected. So this number will be skewed depending on whether I manually selected the cells (using the elliptical tool, which inevitably includes black space around the cell) or whether nucleus counter selected it (this tool traces around the edges of the particle so that there is no black space in the ROI).
A solution to this would be to somehow have ImageJ calculate the mean excluding all of the pixels that are below a certain value (0). Is there a way to do this?