Login  Register

Macro programming

Posted by karo03 on Apr 30, 2008; 7:13am
URL: http://imagej.273.s1.nabble.com/Macro-programming-tp3696370.html

Hi ImageJ gurus and Java experts,
I need some help in macro programming:

Goal: reading in a hyperstack, Z projecting it and preparing a simple  
display:

        open();
        id=getImageID();
        run("Z Project...", "projection=[Average Intensity]");
        idavg=getImageID();
        for (i=1; i<nSlices(); i++) {
                setSlice(i);
                run("Enhance Contrast", "saturated=0.5");
        }
        run("Channels...","Composite [Channel 1] [Channel 2] [Channel 3]");
        run("Stack to RGB","[Convert to RGB]");

The last two commands are not well formed. I have difficulties to  
deduce from the GUI comming up the necessary options. The macro  
recording does not wait for the add. options and gives only  
run("Channels...");

I would like to select three channels and convert them to RGB.  
"Composite" is seemingly an accepted option, but what about the  
channels. The actual peace of code delivers an RGB image with channel  
3 only.

Any help is appreciated
Regards
Karsten Rodenacker