Raw File Import in Macro

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

Raw File Import in Macro

Michael Doube-2
Hi All,

I'm trying to get a macro to work.  It's job is to go through a
directory filled with raw 8-bit SEM images of bone, finding image pairs
and making anaglyphs out of them.  The images are in pairs, named (for
example) 16LS0111.IMG and 16LS6111.IMG, the 0 and 6 indicating the tilt
angle that the image was made at.

I've got a macro that I think has the correct basic structure, but I
can't quite get the raw image opener to open the specified image.

Any ideas appreciated,

Cheers

Mike

dir = getDirectory("Choose a Directory ");
count = 1;

list = getFileList(dir);
match = getFileList(dir);

for (i=0; i<list.length; i++) {
    zero=list[i];
    specimen=substring(zero,0,4);
    site=substring(zero,5,7);
    tilt=substring(zero,4,5);
    if (tilt == 0) {
        for (j=0; j<match.length; j++){
            six=match[j];
            specimensix=substring(six,0,4);
            sitesix=substring(six,5,7);
            tiltsix=substring(six,4,5);
            if (tiltsix==6 && specimen==specimensix && site==sitesix) {
                run("Raw...", "open=dir+zero image=8-bit width=1536
height=1536 offset=128 number=1 gap=0");
                run("RGB Color");
                run("Raw...", "open=dir+six image=8-bit width=1536
height=1536 offset=128 number=1 gap=0");
                run("RGB Color");
                run("Two Shot Anaglyph");
                saveAs("Jpeg", zero+"_anaglyph.jpg");
                close();
                close();
                close();
            }
        }
    }
}