# Imfilter for 3d array

**URL:** <https://discourse.julialang.org/t/imfilter-for-3d-array/78118>\
**Category:** General Usage\
**Created:** [March 19, 2022, 2:43am UTC](https://discourse.julialang.org/t/imfilter-for-3d-array/78118 "2022-03-19T02:43:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [March 19, 2022, 2:43am UTC](https://discourse.julialang.org/t/imfilter-for-3d-array/78118/1 "2022-03-19T02:43:25Z")

</div>

I am doing

```julia
sdata = imfilter(deepcopy(tdata), Kernel.gaussian(3), Inner())

```

where `tdata` is a 3d array. It appears that the smoothing is being done  
by considering separately 2d slices of the image. Am I missing something?  
I expected the Gaussian smoothing to be done in 3D.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [March 19, 2022, 2:55pm UTC](https://discourse.julialang.org/t/imfilter-for-3d-array/78118/2 "2022-03-19T14:55:41Z")

</div>

I’m afraid it was my wrong assumption that the size of the kernel (3)  
will be taken as a hint to expand to three dimensions. Passing explicitly  
`(3, 3, 3)` does the trick.
