Best approach to smooth array? None of my approaches are very useful

Hi Tim:

Are this two things supposed to give the same output?

a = rand(10,10,10)
b = similar(a)
for i in 1:10
       b[:,:,i] = imfilter(a[:,:,i], kernelfactors(( ones(3)/3, ones(3)/3)))
end
c = imfilter(a,kernelfactors(( ones(3)/3 , ones(3)/3) , [1.0])) )

The question is,
shouldn't b==c?
It doesn’t, but I don’t understand why.