From 30e9c09846530ec16d1d3bc0b9301b92d4d5ea0d Mon Sep 17 00:00:00 2001 From: Sarthak Jariwala Date: Thu, 15 Oct 2020 19:24:53 -0700 Subject: [PATCH 1/4] update usage; phase out quickstart --- docs/conf.py | 5 ++--- docs/index.rst | 43 +++++++++++++++++++++++++------------------ 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index f21c506a..a40085e1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -86,11 +86,10 @@ "navbar_sidebarrel": False, "bootstrap_version": "3", "navbar_links": [ - ("Quickstart", "quickstart"), - ("How-to?", "how_to"), ("Gallery", "auto_examples/index"), - ("Releases", "https://github.com/SarthakJariwala/seaborn-image/releases", True), ("Reference", "reference"), + ("How-to?", "how_to"), + ("Releases", "https://github.com/SarthakJariwala/seaborn-image/releases", True), ], } diff --git a/docs/index.rst b/docs/index.rst index 6410e792..0d8d599c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -28,12 +28,14 @@ seaborn-image: image data visualization Description =========== -Seaborn-image is a *seaborn like* Python **image** visualization and processing library -based on matplotlib, scikit-image and scipy. +Seaborn-image is a Python **image** visualization library based on matplotlib, scikit-image and scipy. -The aim of seaborn-image is to provide a high-level API to **process and plot attractive images quickly** +Seaborn-image provides a high-level API to **draw attractive and informative images quickly** **and effectively**. +It is heavily inspired by `**seaborn** `_, a high-level visualization library +for drawing attractive statistical graphics in Python. + To get started with ``seaborn_image``, check out the :doc:`quickstart page `. To view example images, check out the :doc:`gallery page `. For specific how-to questions, refer to the :doc:`how-to page `. @@ -52,9 +54,6 @@ Installation Usage ===== -Check out the :doc:`quickstart page ` for a walk through -of the sample features below. - Simple usage ************ @@ -62,26 +61,35 @@ Simple usage import seaborn_image as isns - """Set context like seaborn""" + """Global settings for images""" isns.set_context("notebook") + isns.set_image(cmap="deep", despine=True) + isns.set_scalebar(color="red") - """Plot publishable quality image in one line""" + """Plot image""" isns.imgplot(data) - """Add a scalebar""" + """Image with a scalebar""" isns.imgplot(data, dx=1, units="um") -Apply image filters (from scipy and skimage) and plot -***************************************************** + """Get basic image stats""" + isns.imgplot(data, describe=True) -.. code-block:: python +Visualize image distribution +**************************** - import seaborn_image as isns +..code-block:: python + + isns.imghist(data) - isns.filterplot(data, filter="gaussian") +Filter image and plot +********************* +.. code-block:: python -For more information on getting strated, refer to the :doc:`quickstart guide `. + isns.filterplot(data, filt="gaussian", sigma=2.5) + +For more information check out examples in :doc:`api ` and :doc:`gallery `. Contents @@ -90,13 +98,12 @@ Contents .. toctree:: :maxdepth: 1 - Quickstart - How-to? Gallery + Reference + How-to? License Authors Changelog - Reference Indices and tables From 683efda446f5f560a5ef4959a9ffc69da0cf659e Mon Sep 17 00:00:00 2001 From: Sarthak Jariwala Date: Thu, 15 Oct 2020 19:53:14 -0700 Subject: [PATCH 2/4] update examples, add new examples --- examples/plot_ImageGrid.py | 14 ++++++++++++++ examples/plot_ImageGrid_2.py | 17 +++++++++++++++++ examples/plot_fft.py | 2 +- examples/plot_filter.py | 6 +++--- examples/plot_filtergrid.py | 4 ++-- examples/plot_image.py | 3 +-- examples/plot_image_hist.py | 6 +++--- examples/plot_image_robust.py | 4 ++-- examples/plot_rgb_image.py | 14 ++++++++++++++ 9 files changed, 57 insertions(+), 13 deletions(-) create mode 100644 examples/plot_ImageGrid.py create mode 100644 examples/plot_ImageGrid_2.py create mode 100644 examples/plot_rgb_image.py diff --git a/examples/plot_ImageGrid.py b/examples/plot_ImageGrid.py new file mode 100644 index 00000000..79bc4832 --- /dev/null +++ b/examples/plot_ImageGrid.py @@ -0,0 +1,14 @@ +""" +ImageGrid: Mutiple images on a single figure +============================================ +""" + +import seaborn_image as isns + +# load images +pol = isns.load_image("polymer") +pl = isns.load_image("fluorescence") +pol_out = isns.load_image("polymer outliers") + +g = isns.ImageGrid([pol, pl, pol_out], robust=[False, False, True], perc=[None, None, (2, 99.9)]) +g = isns.ImageGrid([pol, pl]) \ No newline at end of file diff --git a/examples/plot_ImageGrid_2.py b/examples/plot_ImageGrid_2.py new file mode 100644 index 00000000..423e3269 --- /dev/null +++ b/examples/plot_ImageGrid_2.py @@ -0,0 +1,17 @@ +""" +ImageGrid: Apply changes to individual images +============================================= +""" + +import seaborn_image as isns + +# load images +pol = isns.load_image("polymer") +pl = isns.load_image("fluorescence") +pol_out = isns.load_image("polymer outliers") + +g = isns.ImageGrid( + [pol, pl, pol_out], + robust=[False, False, True], + perc=[None, None, (2, 99.9)] +) \ No newline at end of file diff --git a/examples/plot_fft.py b/examples/plot_fft.py index 9711b2e3..671f145c 100644 --- a/examples/plot_fft.py +++ b/examples/plot_fft.py @@ -7,4 +7,4 @@ img = isns.load_image("polymer") -_ = isns.fftplot(img, cmap="viridis") +ax = isns.fftplot(img, window_type="hann", cmap="viridis") diff --git a/examples/plot_filter.py b/examples/plot_filter.py index 776161cc..fd006053 100644 --- a/examples/plot_filter.py +++ b/examples/plot_filter.py @@ -1,10 +1,10 @@ """ -Image Filter -============ +Apply image filter +================== """ import seaborn_image as isns img = isns.load_image("polymer") -_ = isns.filterplot(img, "median", size=5, cmap="ice") +ax = isns.filterplot(img, "median", size=5, cmap="ice") diff --git a/examples/plot_filtergrid.py b/examples/plot_filtergrid.py index 798a86bc..826a7b5d 100644 --- a/examples/plot_filtergrid.py +++ b/examples/plot_filtergrid.py @@ -1,6 +1,6 @@ """ -FilterGrid -========== +Interplay between filter parameters using FilterGrid +==================================================== """ import seaborn_image as isns diff --git a/examples/plot_image.py b/examples/plot_image.py index e3c9a42d..f4ace9bc 100644 --- a/examples/plot_image.py +++ b/examples/plot_image.py @@ -7,6 +7,5 @@ import seaborn_image as isns img = isns.load_image("polymer") -img_scale = {"dx": 15, "units": "nm"} -_ = isns.imgplot(img, dx=15, units="nm") +ax = isns.imgplot(img, dx=15, units="nm") diff --git a/examples/plot_image_hist.py b/examples/plot_image_hist.py index 22eed118..abcb6306 100644 --- a/examples/plot_image_hist.py +++ b/examples/plot_image_hist.py @@ -1,10 +1,10 @@ """ -Image distribution -================== +Visualize image distribution +============================ """ import seaborn_image as isns img = isns.load_image("polymer") -_ = isns.imghist(img, cmap="YlGnBu_r", dx=15, units="nm") +f = isns.imghist(img, cmap="YlGnBu_r", dx=15, units="nm") diff --git a/examples/plot_image_robust.py b/examples/plot_image_robust.py index 25200532..ab8b63af 100644 --- a/examples/plot_image_robust.py +++ b/examples/plot_image_robust.py @@ -11,5 +11,5 @@ f, axes = plt.subplots(1, 2) -_ = isns.imgplot(img, ax=axes[0], cmap="inferno", despine=False) -_ = isns.imgplot(img, ax=axes[1], robust=True, perc=(2, 99.99), cmap="inferno") +ax0 = isns.imgplot(img, ax=axes[0], cmap="inferno") +ax1 = isns.imgplot(img, ax=axes[1], robust=True, perc=(2, 99.99), cmap="inferno") diff --git a/examples/plot_rgb_image.py b/examples/plot_rgb_image.py new file mode 100644 index 00000000..80af41ac --- /dev/null +++ b/examples/plot_rgb_image.py @@ -0,0 +1,14 @@ +""" +RGB channels in RGB image +========================= + +Split and plot the channels of the RGB image +""" + +import seaborn_image as isns +from skimage.data import astronaut + +# set image origin +isns.set_image(origin="upper") + +g = isns.rgbplot(astronaut()) \ No newline at end of file From 6f917ce61de6a63780242af5e906b6418dd54f36 Mon Sep 17 00:00:00 2001 From: Sarthak Jariwala Date: Thu, 15 Oct 2020 19:59:06 -0700 Subject: [PATCH 3/4] update how-to --- docs/how_to.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/how_to.rst b/docs/how_to.rst index 5dfe7f22..a0064127 100644 --- a/docs/how_to.rst +++ b/docs/how_to.rst @@ -49,10 +49,10 @@ Modify scale bar properties import seaborn_image as isns # change scalebar color - isns.set_scalebar(rc={"color": "red"}) + isns.set_scalebar(color="red") # change scalebar position - isns.set_scalebar(rc={"location": "upper right"}) + isns.set_scalebar(location="upper right") Add label to colorbar @@ -75,8 +75,8 @@ Use image filters isns.filterplot(data, filter="sobel") -Change image plot properties ----------------------------- +Globally change image plot properties +------------------------------------- .. code-block:: python From 14525bee1841bf18cc7b22653f3c19ec6f8ccf94 Mon Sep 17 00:00:00 2001 From: Sarthak Jariwala Date: Thu, 15 Oct 2020 20:02:45 -0700 Subject: [PATCH 4/4] remove all refs to quickstart --- docs/index.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 0d8d599c..c3f26eb7 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -36,8 +36,7 @@ Seaborn-image provides a high-level API to **draw attractive and informative ima It is heavily inspired by `**seaborn** `_, a high-level visualization library for drawing attractive statistical graphics in Python. -To get started with ``seaborn_image``, check out the :doc:`quickstart page `. -To view example images, check out the :doc:`gallery page `. +To view example images, check out the :doc:`gallery page ` and :doc:`reference `. For specific how-to questions, refer to the :doc:`how-to page `. Check out the source code on `github `_.