Get multi-point tool generated point label

Greetings, is there a way to access a point’s label (name) within an ImageJ macro? The points were created using the Multi-point tool (with the Label Points option enabled), and then added as an ROI to the ROI manager. You’d think it would be straightforward, but after scouring the macro language and extensive googling I’ve been unable to figure out how to do it. Thanks!

If you don’t get this figured out in ImageJ, you might want to consider QuPath for handling manual points.

Use the single point tool to create a point. Press “y” (Edit>Selection>Properties) to set the label. Press ‘t’ (Edit>Selection>Add to Manager) to add the labeled point to the ROI Manager. Repeat. Here is a macro example:

  roiManager("reset");
  makePoint(150, 50, "large yellow cross");
  run("Properties... ", "name=[Label One]");
  roiManager("Add");
  makePoint(200, 125, "large red cross");
  run("Properties... ", "name=[Label Two]");
  roiManager("Add");
  makePoint(125, 200, "large cyan cross");
  run("Properties... ", "name=[Label Three]");
  roiManager("Add");
  roiManager("UseNames", "true");
  roiManager("Show All with labels");
  roiManager("select",1);
  print("Label of point with index 1 is \""+Roi.getName()+"\"");

4 Likes