Help writing a macro-with pictures!
Posted by
Gabrielle Van Patten on
Mar 27, 2010; 5:23pm
URL: http://imagej.273.s1.nabble.com/Help-writing-a-macro-with-pictures-tp3688441.html
Hi everyone,
I don't know much about programming, so I was wondering if someone could help me out. I need to analyze images I have of serotonin receptor clusters (obtained by immunohistochemistry staining and imaged with a confocal-see image at the end of this message). I use the "Find Maxima" function in ImageJ to identify the clusters. The way I want to analyze them is to quantify the cluster size/area and the pixel density of each cluster (to distinguish brighter clusters from dimmer clusters).
Since I couldn't find a macro that calculates cluster size and pixel density, I thought it would be easiest to write one. The idea I have for the macro is illustrated in the image below. Only two clusters are shown for clarification purposes.

The macro would start by drawing a very small circle around each cluster (determined by "Find Maxima") and calculating the pixel density (number of pixels divided by area of the circle). If the density was above a certain threshold (which would be able to be set by the user), then the program would draw a bigger circle around the same area (green circles in the image). The pixel density of the smaller circle would then be subtracted from the larger, and if this new density is still above threshold, a larger circle is drawn. This process would continue until the pixel density fell below the threshold (red circle in image). In this way, the cluster size can be determined by the area of the biggest circle that was above the pixel density threshold. The pixel density of each cluster can easily be calculated by dividing the number of pixels in the biggest green circle by its area.
Here is a typical image that I would use this macro on:

If anyone knows if this program already exists, would be able to help me to write one, or has other suggestions, that would be much appreciated. Thanks for reading my long message!
Gabrielle