Remove points generated makePoint from GUI

Greetings!

https://imagej.nih.gov/ij/macros/examples/MakePointDemo.txt shows a nice example on point removal from a macro.
However, how does one remove points generated makePoint function from GUI?

Thank you.

Hi @AKazak,

have you tried

run("Select None");

Cheers,
Robert

I tried, but it didn’t work.

When I execute this macro:

newImage("Untitled", "8-bit black", 200, 200, 1);

setKeyDown("shift");
makePoint(10, 40);
setKeyDown("shift");
makePoint(50, 40);

waitForUser("Please click ok");

run("Select None");

It first looks like this:

And after clicking ok:

Can you confirm that it does the same in your Fiji? If not, would you mind double-clicking on Fijis status bar so that we can have a look at Fijis version?

image

Cheers,
Robert

Dear Robert,

I confirm that your script works as expected.

However, it doesn’t clean up id I add options to makePoint:

newImage("Untitled", "8-bit black", 200, 200, 1);

setKeyDown("shift");
makePoint(10, 50, "large red hybrid add");
setKeyDown("shift");
makePoint(50, 40, "large red hybrid add");
 
waitForUser("Please click ok");
 
run("Select None");

Hey @AKazak,

I see. The “add” parameter in your script means that the points are added to the overlay. Thus, you can remove them afterwards by Image > Overlay > Remove overlay or

run("Remove Overlay");

See also:
https://imagej.nih.gov/ij/developer/macro/functions.html#makePoint

Let me know if this solves your issue :slight_smile:

Cheers,
Robet

Got it!
Thank you.

Where can I read more about Overlay object/layer?

You’re welcome.

In the user guide:
https://imagej.nih.gov/ij/docs/guide/146-11.html

Or on youtube:

:wink:

Wow — great video tutorial!

1 Like

To remove a single point, alt-click on it. To remove all the points, type shift-a (Edit>Selection>Select None). To remove all the points added to an overlay using the ‘add’ option of makePoint(), use the Image>Overlay>Remove Overlay command. There is currently no easy way to remove a single point that has been added to an overlay. An area selection, such as a rectangle, can be removed from an overlay be double clicking on it and pressing the delete key.

1 Like