Created
April 20, 2019 03:20
-
-
Save sofroniewn/6b91e47ba9d59e52b06edef66f3720d3 to your computer and use it in GitHub Desktop.
Tests for qtviewer
This file contains hidden or 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
from skimage import data | |
from skimage.color import rgb2gray | |
from napari import Viewer | |
from napari.util import app_context | |
# THIS WILL NOT WORK UNTIL THERE IS SEPARATION BETWEEN MODEL AND VIEW! | |
def test_dims_and_ranges(): | |
viewer = Viewer() | |
astronaut = rgb2gray(data.astronaut()) | |
coins = rgb2gray(data.coins()) | |
viewer.add_image(astronaut) | |
#viewer.add_image(coins) | |
assert viewer.dims.num_dimensions == 2 | |
assert viewer._calc_layers_num_dims() == 2 | |
assert viewer._calc_layers_ranges() == (12,12) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment