Login  Register

Rotate stack script with user input

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

Rotate stack script with user input

crystalmath
1 post
Hi all,

I've got a problem and I can't seem to solve it. I've written a script to measure crystal growth and it requires to rotate a virtual stack according to user input. This is my script:

macro "crystalgrowth"{
        IDStack=getImageID();
        selectImage(IDStack);
        setSlice(getSliceNumber());
        run("Rotate... ");
        waitForUser("Select area");
        run("Duplicate...", "title=temp");
        IDtemp=getImageID();
        run("8-bit");
        run("Threshold...");
        waitForUser("Enter threshold");
        getThreshold(lower, upper);
        selectImage(IDtemp);
        close();

for (n=1; n<= nSlices; n++) {
        setBatchMode(true);
        selectImage(IDStack);
        setSlice(n);
        run("Duplicate...", "title=temp");
        IDtemp=getImageID();
  setRGBWeights(1,0,0);
        run("8-bit");
        setThreshold(lower, upper, "black & white");
        run("Threshold...");
        run("Convert to Mask");
        run("Fill Holes");
        run("Analyze Particles...", "size=10-Infinity circularity=0.00-1.00 show=Nothing clear include summarize");
        selectImage(IDtemp);
        close(); }
}

The problem is that I cannot rotate the entire stack at once and I also cannot read out the angle I entered. How should I adapt the script to fix this?

Thanks in advance