How to set Display area

Hello,

I would like to display a specific region of my image and zoom in on it.
Using imageJ macro language.
There is the tool : getDisplayedArea (x,y,width,height);
also There is run(“In [+]”); to zoom in.

But I cant find anything like “Set” displayed area.
I dont want to duplicate the ROI. I want the macro to navigate across a single image. zooming in and out based on my script.

Thanks!

also there is setLocation(x, y, width, height); which could be helpful, but not exactly what I want

solution.

run(“To Selection”);

be careful with quotation marks used. copy pasting the previous code did not work.
run(“To Selection”);

Hi @dlite-x,

not sure if the following is doing what you want, but it indicates how you could jump from ROI to ROI and zoom in at those related areas in an image:

run("Embryos");
makeRectangle(710, 208, 192, 204);
roiManager("Add");
makeRectangle(948, 0, 192, 204);
roiManager("Add");
makeRectangle(670, 530, 192, 204);
roiManager("Add");
makeRectangle(310, 724, 192, 204);
roiManager("Add");
makeRectangle(0, 364, 192, 204);
roiManager("Add");
makeRectangle(358, 396, 192, 204);
roiManager("Add");
makeRectangle(1354, 726, 192, 204);
roiManager("Add");

for (i = 0; i < roiManager("count"); i++) {
	roiManager("select", i);
	run("To Selection");
	wait(1000);
}
1 Like