Login  Register

Re: How to change ROI during a Macro?

Posted by Ninja Chris on Feb 22, 2010; 1:27pm
URL: http://imagej.273.s1.nabble.com/How-to-change-ROI-during-a-Macro-tp3689228p3689229.html

Hi Gargar, I'm working on some iterative code to process multiple ROIs within
a single stack. The code

n = roiManager("count");
for (i=0; i<n; i++) {
     roiManager("select", i);

will allow any subsequenty function to work on each ROI in succession. Eg:

sdir = getDirectory("choose source directory ");
n = roiManager("count");
for (i=0; i<n; i++) {
     roiManager("select", i);
     bee = "bee_"+i+"_";
     ddir = sdir+bee;
     File.makeDirectory(ddir);
     run("Duplicate...", "title = ["+bee+"] duplicate range=1-3000");
     run("Image Sequence... ", "format=TIFF name=["+bee+"] start=0 digits=4
save=["+ddir+"]");
close();
  }

Hope this helps,
Chris
--
View this message in context: http://n2.nabble.com/How-to-change-ROI-during-a-Macro-tp4544808p4611998.html
Sent from the ImageJ mailing list archive at Nabble.com.