Drawing a circle based on previously measured results

as probably many people I am pretty new to fiji/imagej. I have images in which I need to detect circles. For this I am using the Hough Circle Transform Plugin. This plugin shows me X and Y values for the center of the circle, as well as its radius. What I want to do is create a macro that automatically measures these circle values and then draws the same circle on the original image based on the measured values (the original image is changed in the circle finding process). I am at a point where I get the values in the results window and the image is reverted back to the original. I just don’t know how to automatically draw the circle on the image based on the results I get.

This seems like it should be relatively easy, but I just can’t seem to get it.

Thank you.


An indication:

a macro test

if(!isOpen("test circles"))
	newImage("test circles", "8-bit black", 512, 512, 1);
{		roiManager("deselect");
roiManager("Show All");

Thanks for the reply!

Is there a way for the macro to automatically input the values from the results table and draw a circle around those coordinates without further input from my side?



getResult(“Column”, row)
Returns a measurement from the ImageJ results table or NaN if the specified column is not found. The first argument specifies a column in the table. It must be a “Results” window column label, such as “Area”, “Mean” or “Circ.”. The second argument specifies the row, where 0<= row <nResults. nResults is a predefined variable that contains the current measurement count. (Actually, it’s a built-in function with the “()” optional.) Omit the second argument and the row defaults to nResults-1 (the last row in the results table). See also: nResults, setResult, isNaN, getResultLabel.