Login  Register

Macro batch save XY coordinates with Path Writer plugin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Macro batch save XY coordinates with Path Writer plugin

ivitagata
2 posts
Hi everyone,
I am trying to batch process outlines from JPGs in a folder. I am using the Path Writer plugin because, unlike the SaveXYCoordinates, it saves every single pixel, which is what I need. The following macro seems to run correctly, but it saves nothing. If I take the save command out, it prompts me for a 'save' click at each image, which is painful as I have 5000 images – but the results are good. I've searched around but cannot find the correct syntax that will force it to just save the text files without asking. I know this should be easy, but cannot find the answer. Any help would be greatly appreciated.

I am using Fiji on Mac OS X 10.6 and am not familiar with the macro language. Below is the code with the problem spot in boldface.

function action (input, output, filename) {
        open(input + filename);
        run("Make Binary");
        run("Outline");
        run("Flip Vertically");
        //setTool("wand");
        run("Wand Tool...", "mode=Legacy tolerance=90");
        doWand(1944, 1296);
        run("Path Writer", "save=["output + filename"]");
        close();
}
input="/Volumes/OrangeFotoVideo/Pictures/Scientific Photos/.../";
output="/Volumes/OrangeFotoVideo/Pictures/Scientific Photos/.../";

setBatchMode(true);
list = getFileList(input);
for (i = 0; i < list.length; i++)
        action(input, output, list[i]);
setBatchMode(false);

Thanks!
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Macro batch save XY coordinates with Path Writer plugin

ivitagata
2 posts
Hi everyone,

Wayne Rasband replied to me privately and solved this question. I'm posting the relevant solution here so everyone can see it:

    >Change

    >    run("Path Writer", "save=["output + filename"]");

    >to

    >   run("Path Writer", "save=["+output + filename+"]");

This works.

    >If this doesn't work try printing out the options string using something like:

    >  options = "save=["+output + filename+"]";
        print(options);