Help with Macro

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

Help with Macro

Matthew Dunlap
Hello,


I am trying to create a macro that will subdivide an image into a number of
rectangles, running and saving a particle analysis for each rectangle as
they are created. I am running into two problems/questions:

1) Is there a way to get the dummy index, i, into the file names somehow?

2) Is there a convenient way to, after the first row is finished, move the
area being swept down to the next row and then sweep across again?


The macro I have so far can be found at the end of this message.


Thanks for any help,

Matt


---

open("FILEPATH\\FILE_1.*");
//run("Threshold...");
run("Close");
run("Analyze Particles...", "size=0-Infinity circularity=0.00-1.00
show=Nothing display clear summarize");
saveAs("Text", "FILEPATH\\Summary_FILE_1.xls"
>
> );
> saveAs("Results", "FILEPATH\\Results_FILE_1.xls");
>
for (i=0; i<10; i++) {

> makeRectangle(0, 50*i, 200, 50*i);
>
> run("Duplicate...", "title=[DUPLICATE_R1_C1.png]");
> run("Save", "save=[FILEPATH\\DUPLICATE_R1_C1.png.tif]");
> run("Color Threshold...");
> run("Close");
> run("Analyze Particles...", "size=0-Infinity circularity=0.00-1.00
> show=Nothing display clear summarize");
> saveAs("Text", "FILEPATH\\Summary_DUPLICATE_R1_C1.xls");
> saveAs("Results", "FILEPATH\\Results_DUPLICATE_R1_C1.xls");
> selectWindow("FILE_1.*");
>
}

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html