Login  Register

Re: need help on data file

Posted by Wayne Rasband on Sep 29, 2008; 2:59am
URL: http://imagej.273.s1.nabble.com/need-help-on-data-file-tp3694947p3694948.html

On Sep 28, 2008, at 4:37 PM, Jim Son Chou wrote:

> Hi,
>
> We tried to create a data file that contains the intensity, in  
> terms of red,
> green and blue, along a line draw in the picture.
>
> Preferable an Excel file so we can use some of our old macro.

Here is a macro that does this:

    setRGBWeights(1, 0, 0);
    red = getProfile;
    setRGBWeights(0, 1, 0);
    green = getProfile;
    setRGBWeights(0, 0, 1);
    blue = getProfile;
    f = File.open(getDirectory("home")+"profile.xls");
    for (i=0; i<red.length; i++)
        print(f, red[i]+"\t"+green[i]+"\t"+blue[i]);

-wayne