application_vnd.jupyter.stderr_output_1.png
from scipy.ndimage.filters import median_filter
filter_fossil_data = median_filter(fossil_data, (3, 3, 3))
slice_idx = int(fossil_data.shape[0] / 2)
test_slice = fossil_data[slice_idx]
test_filt_slice = filter_fossil_data[slice_idx]
im_args = dict(cmap='bone', vmin=50, vmax=70)
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(10, 5))
ax1.imshow(test_slice, **im_args)
ax1.set_title('Unfiltered Slice')
_ = ax2.imshow(test_filt_slice, **im_args)
ax2.set_title('Filtered Slice')