Login  Register

Re: Change plot profile axis

Posted by Michael Schmid on May 18, 2007; 4:57pm
URL: http://imagej.273.s1.nabble.com/Change-plot-profile-axis-tp3699416p3699417.html

Hi Eric,

you can easily do that with a macro. Select the area of
interest before running it (can be one pixel wide for a
single point).

macro "Plot Stack Profile" {
     if (nSlices < 2) exit("Stack required");
     offset = 10;  //energy of first slice
     step = 5;     //energy step between slices
     x = newArray(nSlices);
     y = newArray(nSlices);
     for (n=1; n<=nSlices; n++) {
         setSlice(n);
         getStatistics(area, mean, min, max, std, histogram);
         x[n-1] = offset + (n-1)*step;
         y[n-1] = mean;
     }
     Plot.create("mean vs. E", "energy", "mean", x, y);
}


Michael
________________________________________________________________

On 18 May 2007, at 14:27, Eric LEROY wrote:

> Hello,
>
> Is it possible to change the values of a profile generated with the  
> plot
> profile command? My problem is that I have a stack of images  
> separated with
> an energy step and I want to plot the profile of a pixel or a  
> region versus
> the energy and not the slice number. I have a linear relationship  
> between
> the slice number and the energy.
>
> Best regards
>
> Eric