catindri
catindri

Reputation: 384

ROI selection in ImageJ macro

I am trying to record a macro on Fiji (ImageJ). I cannot find how to introduce the use of the mouse for a ROI rectangular selection. The macro keeps the registered position, in the example (2290, 1224 , 160, 314). I want them to be different for each image. If possible to draw the ROI rectangle with the mouse for each new image. Thanks !

setOption("BlackBackground", false);
run("Make Binary");
run("ROI Manager...");
makeRectangle(2290, 1224, 160, 314);
run("Strahler Analysis", "max.=6 output=[Color Map (CM)] protect method=[shortest branch]");
selectWindow("StrahlerMask_7502.jpg");
saveAs("Jpeg", "/home/StrahlerMask_7502.jpg");

Upvotes: 0

Views: 2914

Answers (1)

Jan Eglinger
Jan Eglinger

Reputation: 4090

Use the waitForUser(string) macro function.

E.g.:

setOption("BlackBackground", false);
run("Make Binary");
waitForUser("Please create a selection to indicate\nthe root for Strahler Analysis, then\nclick OK to proceed.");
run("Strahler Analysis", "max.=6 output=[Color Map (CM)] protect method=[shortest branch]");
selectWindow("StrahlerMask_7502.jpg");
saveAs("Jpeg", "/home/StrahlerMask_7502.jpg");

Upvotes: 2

Related Questions