Spot tracking Manual Roi

Scene_017.tif (3.5 MB)

Hello everyone,

I’m struggling with roiManager to iterate the rois made from a maximum intensity projection and extract the same xy coordinates with all z and the specific timeframe from the raw image. For some reason, when iterating the rois and duplicate, only the first roi it’s duplicated. I have seen similar errors in others questions but I didn’t find the answer to solve this specific one (sorry if I skipped the solution elsewhere in the forum). Thank you all.

The image example is attached.


// To run this script Roi 1-click tools is required
selectWindow("Scene_017.tif");
run("Z Project...", "projection=[Max Intensity] all");
run("ROI Manager...");

waitForUser("Click >> and Roi-1 Click Tools\n select circle double click\n tick only Add to manager");

for (m = 0; m < roiManager("count"); m++){
	selectWindow("Scene_017.tif");
    roiManager("Select", m);
    roiManager("update");
    print(Roi.getName);
//   	Stack.setPosition(1, 1, m); // ch, z, t
//   	run("Properties... ", "name="+Roi.getName+" position=1,1,"+d2s(m,0)+" stroke=none width=0 fill=none");
//    roiManager("Update");
	run("Duplicate...", "duplicate frames="+d2s(m, 0));
//	waitForUser("Click >>");
	}

selectWindow("MAX_Scene_017.tif");
run("Close");
selectWindow("Scene_017.tif");
run("Close");
run("Concatenate...", "all_open open");
run("Z Project...", "projection=[Max Intensity] all"); // Just to check that the spot is still inside the bbox extracted.

Solved it. There was a small mistake in the frame indexing (it must be m+1)

run("Duplicate...", "duplicate frames="+d2s(m+1, 0));