Average/Std of All open stacks

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Average/Std of All open stacks

Alex Vaughan
Hi All,

I'd like to make a macro that will generate two stacks: the average of
all open stacks, and the stdev of all open stacks.  Stacks will be the
same size, type, etc.
The math is simple, but I'm having trouble figuring out how to act on
all open stacks - can anyone point me in the right direction?

Many Thanks,
Alex

--
Alex Vaughan
Integrative and Organismal Biology
Department of Biosciences, Stanford University
Email :: [hidden email]
Phone :: 510 717 6010

If the shortest path
is a straight line,
I will be late. -  Nancy Boutilier
--
Reply | Threaded
Open this post in threaded view
|

Re: Average/Std of All open stacks

Michael Schmid
Hi Alex,

see the macro documentation - you can loop simply through the
images.

For example:

for (i=1; i<=nImages(); i++)  {
   selectImage(i);
   if (nSlices>1) {
     print(getTitle()+" is a stack"); // or do whatever you like
   }
}


Michael
________________________________________________________________

On 16 Dec 2007, at 22:47, Alex Vaughan wrote:

> Hi All,
>
> I'd like to make a macro that will generate two stacks: the average of
> all open stacks, and the stdev of all open stacks.  Stacks will be the
> same size, type, etc.
> The math is simple, but I'm having trouble figuring out how to act on
> all open stacks - can anyone point me in the right direction?
>
> Many Thanks,
> Alex
>
> --
> Alex Vaughan
> Integrative and Organismal Biology
> Department of Biosciences, Stanford University
> Email :: [hidden email]
> Phone :: 510 717 6010
>
> If the shortest path
> is a straight line,
> I will be late. -  Nancy Boutilier
> --