forked from scikit-image/scikit-image
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request scikit-image#289 from tonysyu/qtmpl-collection-viewer
ENH: Add CollectionViewer.
- Loading branch information
Showing
4 changed files
with
118 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
try: | ||
from viewers import ImageViewer | ||
from viewers import ImageViewer, CollectionViewer | ||
except ImportError: | ||
print("Could not import PyQt4 -- ImageViewer not available.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
from .core import * | ||
from .core import ImageViewer, CollectionViewer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
""" | ||
===================== | ||
CollectionViewer demo | ||
===================== | ||
Demo of CollectionViewer for viewing collections of images. This demo uses | ||
successively darker versions of the same image to fake an image collection. | ||
You can scroll through images with the slider, or you can interact with the | ||
viewer using your keyboard: | ||
left/right arrows | ||
Previous/next image in collection. | ||
number keys, 0--9 | ||
0% to 90% of collection. For example, "5" goes to the image in the | ||
middle (i.e. 50%) of the collection. | ||
home/end keys | ||
First/last image in collection. | ||
""" | ||
import numpy as np | ||
from skimage import data | ||
from skimage.viewer import CollectionViewer | ||
|
||
img = data.lena() | ||
img_collection = [np.uint8(img * 0.9**i) for i in range(20)] | ||
|
||
view = CollectionViewer(img_collection) | ||
view.show() |