I'm trying to explore 3D image analysis using Python by scipy.ndimage. When I applied median filter ,scipy.ndimage.filters.median_filter
to my 3D image with size (874, 1150, 1150), it runs so slowly. The calculation speed apparently highly depends on the footprint size. Here are some codes, where a is the 3D image with size (874, 1150, 1150), and mf is the module:
scipy.ndimage.filters.median_filter:
%time a_mf = mf(a, size = 2)
CPU times: user 1min 47s, sys: 684 ms, total: 1min 48s
Wall time: 1min 48s
%time a_mf = mf(a, size = 3)
CPU times: user 6min 25s, sys: 1.79 s, total: 6min 27s
Wall time: 6min 28s
I never got the results when I set the size as 5...since I think this time consuming is unacceptable.
Do you know why is that and how I can improve it?