User-defined functions
Posted by
Andy Weller on
Aug 02, 2006; 1:04pm
URL: http://imagej.273.s1.nabble.com/User-defined-functions-tp3701916.html
Dear all,
I have built up a rather lengthy macro and am splitting it up into
discrete user-defined functions for debugging simplicity.
I think I understand how to operate them (from:
http://rsb.info.nih.gov/ij/developer/macro/macros.html#functions); can
someone explain to me if I have the wrong idea please (regarding passing
things to/from them really)?
macro "Test" {
open();
img = getImageID();
setAutoThreshold();
run("Analyze Particles...", "size=5000-Infinity circularity=0.00-1.00
show=Masks exclude clear include");
mask = getImageID;
myfunction(img, mask); // Passes img and mask to function "myfunction"
}
function myfunction(img, mask) { // img and mask passed to "myfunction"
some measurements on img and mask
return results; // "results" returned to macro "Test"
}
Thanks, Andy