Help with a Macro for cell shape

Hi, I’ve never used Macros before but I’ve got a project to do with a lot of image analysis and thought it would be easier to get a Macro to get bits of it done. The macro I’ve made so far is probably incredibly basic but it seems to close the image after running CLAHE and can’t continue. Also, I’d like to adjust the brightness/contrast and thresholds myself so is there anyway to have the macros pause while I adjust and afterwards let t continue again? I’ll post my macro below and any help would be much appreciated.

run("Subtract Background...", "rolling=50 sliding");
run("CLAHE ", "blocksize=19 histogram=256 maximum=6");
run("Exp");
//run("Brightness/Contrast...");
run("Apply LUT");
run("Close");
setOption("BlackBackground", true);
run("Make Binary");
run("Fill Holes");
run("LoG 3D");
setAutoThreshold("Default");
//run("Threshold...");
run("Convert to Mask");
run("Make Binary");
close();
run("Analyze Particles...", "size=50-Infinity circularity=0.00-0.99 show=Nothing display exclude summarize");
String.copyResults();

@Matthew.mcf

A great resource - one you should just have open whenever writing macros - is the Built In Macro Functions list. This is the best place to search for functions… Regarding

You’ll want to use the waitForUser() function… that will pause and wait for the user to click “OK”.

As far as CLAHE goes… I’ve never used this particular plugin. Perhaps others here or @axtimwalde can assist?

1 Like

This looks more as if it closes after ApplyLUT?
What happens if you remove every line that soudns like “close”?

Hi, thanks yea looks like it’s closing after the run(close) because my adjustment tab isn’t actually opening by the looks.
I’ve sorted this now but would you know how I add the ‘waitForUser()’ into the macro after run(brightness/controst)? As I’m not sure what should be in the brackets for it