Macro Help
Posted by hschn444 on Sep 02, 2013; 10:53pm
URL: http://imagej.273.s1.nabble.com/Macro-Help-tp5004625.html
Hello,
I am new to imagej. I have the outline of a macro that I created, however would like it to do a few more simple functions that I cannot figure out how to program. I have a series of images that I will import in as a stack. For each image I will use the multipoint tool to make a series of clicks on different objects manually but the macro prints the coordinates of the points in the results table. However each "group/series" of points in each image (there will be 4-5 clusters of 10+ points) will need to be labeled differently in the results table (possibly through the slice??). It also would be helpful if after all the points have been measured on the image if I could print a label on the actual image or a text box (i.e. "Measure X") as a reminder to manually measure something.
This is the macro I have created so far...
macro "Macro 2" {
getSelectionCoordinates(xCoordinates, yCoordinates);
for(i=0; i<lengthOf(xCoordinates); i++) {
setResult("X", i, xCoordinates[i]);
setResult("Y", i, yCoordinates[i]);
}
updateResults();
print("Measure X");
run("Clear Results");
run("Measure");
saveAs("Results", getDirectory("home")+"points.csv");
}
It works, except I cannot figure out how to label the different "groups/clusters" of points differently for each image and between images. I also cannot figure out how to print text on the image or how to have specific text pop up in a sequence.