Image filters¶
[1]:
import seaborn_image as isns
isns.set_context("notebook")
isns.set_image(cmap="inferno") # set default colormap to inferno
/home/docs/checkouts/readthedocs.org/user_builds/seaborn-image/envs/v0.4.1/lib/python3.7/site-packages/traitlets/traitlets.py:3036: FutureWarning: --rc={'figure.dpi': 96} for dict-traits is deprecated in traitlets 5.0. You can pass --rc <key=value> ... multiple times to add items to a dict.
FutureWarning,
/home/docs/checkouts/readthedocs.org/user_builds/seaborn-image/envs/v0.4.1/lib/python3.7/_collections_abc.py:841: MatplotlibDeprecationWarning:
The validate_legend_loc function was deprecated in Matplotlib 3.3 and will be removed two minor releases later.
self[key] = other[key]
[2]:
pol = isns.load_image("polymer")
[3]:
ax = isns.filterplot(pol, filt="gaussian", sigma=2.5)
[4]:
ax = isns.filterplot(pol, filt="median", size=5)
[5]:
isns.implemented_filters.keys()
[5]:
dict_keys(['sobel', 'gaussian', 'median', 'max', 'diff_of_gaussians', 'gaussian_gradient_magnitude', 'gaussian_laplace', 'laplace', 'min', 'percentile', 'prewitt', 'rank', 'uniform'])
User-defined filters or any callable filter function¶
[6]:
from skimage.filters import scharr
ax = isns.filterplot(pol, filt=scharr)
Fast-Fourier Transform¶
[7]:
ax = isns.fftplot(pol)
[8]:
ax = isns.fftplot(pol, window_type="hann")
[9]:
ax = isns.fftplot(pol, shift=False)
FilterGrid¶
Explore relationships between different parameters of a filter
[10]:
g = isns.FilterGrid(pol, "median", col="size", size=[3,4,5,7])
[11]:
g = isns.FilterGrid(pol, "median", col="size", size=[3,4,5,7], col_wrap=2)
[12]:
g = isns.FilterGrid(pol,
"percentile",
row="percentile",
col="size",
percentile=[3, 5, 7, 10],
size=[3, 5, 7, 10]
)
[13]:
g = isns.FilterGrid(pol, "median", col="size", size=[2,3,4,5], mode="reflect")
[14]:
scale = {"dx" : 15, "units" : "nm"}
g = isns.FilterGrid(pol,
"median",
col="size",
size=[2,3,4,5],
mode="reflect",
col_wrap=2,
**scale
)
[ ]: