Randomized points in a picture (ImageJ)

Hi,

is there a function in ImageJ that allows e.g. 20/50/100 randomized points can be placed in an image? And would it be possible to save the coordinates of the points so that I can place them in exactly the same places on further images?

Alternatively:
Can more than one point (e.g. 20/50/100) can be inserted on pictures by entering X-/Y-Coordinates, so that I can always select the same point for several pictures?

I need this for a statistical evaluation.

Greetings

Hi
@AB45

For your first question

// First question
// Select the first image
newImage("Untitled", "8-bit white", 512, 512, 1);
h=getHeight();
w=getWidth();
for (i=0; i<100; i++) { 
        x1 = random()*w; 
        y1 =random()*h; 
        makePoint(x1, y1); 

roiManager("Add");
} 
roiManager("Show All without labels");
// Select the second image
newImage("Untitled", "8-bit black", 512, 512, 1);
roiManager("Show All without labels");
// etc.

For your second question

newImage("Untitled", "8-bit ramp", 512, 512, 1);
makeSelection ("point", newArray (50,100,150,140), newArray (40,25,50,100));
 newImage("Untitled", "8-bit noise", 512, 512, 1);
makeSelection ("point", newArray (50,100,150,140), newArray (40,25,50,100));
1 Like

@AB45
Another way to keep your points:Use “save” in “more” in Roi Manager. It will give you a “RoiSet.Zip”
Look at this macro.

newImage("Untitled", "8-bit white", 512, 512, 1);
//setTool("point");
makePoint(86, 150, "large red hybrid");
roiManager("Add");
makePoint(283, 212, "large red hybrid");
roiManager("Add");
makePoint(292, 86, "large red hybrid");
roiManager("Add");
// Use "save" in "more" in Roi Manager. It will give you a "RoiSet.Zip"
roiManager("Save", "----your folder---------/RoiSet.zip");
close("Untitled");
close("ROI Manager");
newImage("Untitled", "8-bit black", 512, 512, 1);
// Open your RoiSet.Zip
open("----------your folder-----------/RoiSet.zip");
roiManager("Open", "----------your folder-------/RoiSet.zip");
roiManager("Show All");