Login  Register

Re: moving average in stack

Posted by Gabriel Landini on Jul 12, 2007; 11:38pm
URL: http://imagej.273.s1.nabble.com/moving-average-in-stack-tp3698864p3698868.html

On Thursday 12 July 2007 21:52:39 Wayne Rasband wrote:
>
> This does appear to work. Here is a macro that does 3, 5 or 7 slice
> moving averages in the z direction of a stack.

Great. I just noticed: assuming that the running average is over n (odd)
slices, the first (n-1)/2 and the last (n-1)/2 slices of the resulting stack
should perhaps be discarded (i.e. deleted from the stack) as the convolving
filter would not average outside the image. (So in the result stack, the
first slice is the average of the 1st, 2nd and 3rd original slices and so
on).

Regards,

Gabriel