Setting Point ROI Properties rather messy in macro language

point-roi
bug
macro
Tags: #<Tag:0x00007fb881c0a7d8> #<Tag:0x00007fb881c0a648> #<Tag:0x00007fb881c0a4b8>

#1

Hi all,

We wanted to create multiple point selections using something like
run("Find Maxima...", "noise=10 output=[Point Selection] light");
and then go to Edit>Selection>Properties to set color, type, etc… before adding it to the roiManager.
However clicking on Properties... opens a results window called Counts_Untitled with slice number inside…
No matter the settings, the macro recorder outputs run("Properties... , "");"
The oddest thing is that this was running fine for a while, and runs fine on a colleague’s machine but not on mine (Running Win10).

So we tried using the ROI Manager’s ‘Properties…’ button, however the point type is not output on the macro recorder. Setting a point roi to anything only outputs
roiManager("Set Color", "yellow"); roiManager("Set Line Width", 0);
No matter the Type we give it.

Any idea on why this counting window appears and how to set point type within a macro? I am reinstalling Fiji to make sure something did not break but I am a bit out of ideas

Best
Oli


#2

I can reproduce this behaviour (Win 10) when the multi point tool is selected. If the (single) point tool is selected (before executing command below) I get the correct properties dialog.

Using:


#3

Hello!
Indeed this seems to work! Thank you very much!
Still is a pity that not all elements from the ROI Manager’s ‘Properties’ menu is not macro-recordable though.

Best

Oli


#4

I am having the same or similar problem. With the macro below I would expect a “circle” selection in all three images, but the results are very strange. Sometimes the selections in all three images are of the Hybrid-Type, sometimes one Hybrid and 2 cirlces, … at the moment the outcome seems to be more or less random. Seems to me like I did not really understand how the solution should work. Any hints where the error in this macro is?

run("Cell Colony (31K)");
run("Find Maxima...", "noise=120 output=[Point Selection] light");
setTool("point");
run("Point Tool...", "type=Circle color=Green size=Medium");
roiManager("Add");

run("Cell Colony (31K)");
run("Find Maxima...", "noise=120 output=[Point Selection] light");
setTool("point");
run("Point Tool...", "type=Circle color=Blue size=Large");
roiManager("Add");

run("Cell Colony (31K)");
run("Find Maxima...", "noise=120 output=[Point Selection] light");
setTool("point");
run("Point Tool...", "type=Circle color=Red size=[Extra Large]");
roiManager("Add");

#5

This test macro will work as expected if it modified to set the point properties using run(“Properties… “,”…”) calls, as in the following version. The run(“Properties… “,”…”) calls can be generated by using the Edit>Selection>Properties command with the recorder running.

run("Cell Colony (31K)");
run("Find Maxima...", "noise=120 output=[Point Selection] light");
setTool("point");
//run("Point Tool...", "type=Circle color=Green size=Medium");
run("Properties... ", "stroke=green point=Circle size=Medium");
roiManager("Add");

run("Cell Colony (31K)");
run("Find Maxima...", "noise=120 output=[Point Selection] light");
setTool("point");
//run("Point Tool...", "type=Circle color=Blue size=Large");
run("Properties... ", "stroke=blue point=Circle size=Large");
roiManager("Add");

run("Cell Colony (31K)");
run("Find Maxima...", "noise=120 output=[Point Selection] light");
setTool("point");
//run("Point Tool...", "type=Circle color=Red size=[Extra Large]");
run("Properties... ", "stroke=red point=Circle size=[Extra Large]");
roiManager("Add");

#6

Thank you Wayne. Works perfectly!


#7

The test macro will work as expected without modifications if you upgrade to the latest ImageJ daily build (1.51m18). With both the modified and unmodified test macro, the setTool(“point”) call is not needed.