How to change ROI during a Macro?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to change ROI during a Macro?

gargar802
Hey, I want to run a Macro to analyse 24 stacks of images, each stack contains 48 images. My problem is I need to change ROI every time a new stack is open, but I don't know how to pause the Macro to give me time to do that and start again after that. BTW, I'm using freehand to select ROI.
Reply | Threaded
Open this post in threaded view
|

Re: How to change ROI during a Macro?

Ninja Chris
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.
Reply | Threaded
Open this post in threaded view
|

Re: How to change ROI during a Macro?

Ninja Chris
In reply to this post by gargar802
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
Reply | Threaded
Open this post in threaded view
|

RE: How to change ROI during a Macro?

gargar802
In reply to this post by Ninja Chris
Thanks! I'll try this^^
 

Date: Mon, 22 Feb 2010 07:39:46 -0800
From: [hidden email]
To: [hidden email]
Subject: Re: How to change ROI during a Macro?

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.



View message @ http://n2.nabble.com/How-to-change-ROI-during-a-Macro-tp4544808p4612855.html
To unsubscribe from How to change ROI during a Macro?, click here.



Hotmail: Free, trusted and rich email service. Get it now.