Rich Hamm
Rich Hamm

Reputation: 31

SelectWindow in ImageJ

All,

I am new to scripting with imageJ and have run into a problem I cannot get past. I have multiple files open at once and would like the code to cycle though them, do an analysis, create a new filtered image, save that image and close it along with the file the filtered image cam from. The script below does everything except selecting the window of the original image and then closing it. I keep getting unidentified identifier errors. Any help would be appreciated.

imgs = getList("image.titles");
j=nImages();
for (i = 0; i < j; i++) {
    string=getTitle();
    run("Bandpass Filter...", "filter_large=5000 filter_small=3 suppress=Vertical tolerance=5 autoscale saturate");
    makeRectangle(150, 200, 700, 900);
    run("Copy");
    newImage("Untitled", "RGB ramp", 600, 600, 1);
    run("Paste");
    run("Bandpass Filter...", "filter_large=5000 filter_small=2 suppress=Vertical tolerance=5 autoscale");
    saveAs("Jpeg", "C:/DATA/"+imgs[i]+".jpg");
    selectWindow("Untitled");
    close();
    //SelectWindow(\string\);//
    //SelectWindow("\string\"");//
    //SelectWindow("\string"\");//
    //SelectWindow(string);//
    //SelectWindow(imgs[i]);//
    close();
}

Upvotes: 0

Views: 938

Answers (0)

Related Questions