Login  Register

User selection macro

Posted by knels on Mar 31, 2017; 5:40pm
URL: http://imagej.273.s1.nabble.com/User-selection-macro-tp5018429.html

Hi

I'm pretty new to writing macros in imagej. I am trying to design a macro that would process an image in a few ways. But I want to have an option to run the macro again with all commands being the same except with a user prompt to adjust the threshold (increase or decrease at user's desecration).

Is this possible? An example of what I mean is below:

run("RGB Stack");
setSlice(1)
run("Set Scale...", "distance=197.75 known=50 pixel=1 unit=um");
run("Bandpass Filter...", "filter_large=160 filter_small=3 suppress=None tolerance=5 autoscale saturate");
setAutoThreshold();
getThreshold(min, max)
setThreshold(0, 100);
run("Convert to Mask", "method=Default background=Light calculate");


///User is given a prompt that asks to increase or decrease threshold//////

based on user's choice, the macro would run the same but with a different like setThreshold(100, 255);


Sorry if this question is confusing!

Best,
Knels