Skip to content

Commit 68aca49

Browse files
authored
Merge pull request #86 from joshmoore/extract-napari
Extract napari to napari-ome-zarr
2 parents 715f44d + 47ee959 commit 68aca49

File tree

7 files changed

+3
-297
lines changed

7 files changed

+3
-297
lines changed

README.rst

+2-27
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Experimental support for multi-resolution images stored in Zarr filesets, accord
88
Features
99
--------
1010

11-
- Use as a image reader plugin for `napari`_. The `napari`_ plugin was generated with `Cookiecutter`_ along with `@napari`_'s `cookiecutter-napari-plugin`_ template.
11+
- Use as a image reader plugin for `napari`_. See `napari-ome-zarr`_.
1212
- Simple command-line to read and download conforming Zarr filesets.
1313
- Helper methods for parsing related metadata.
1414

@@ -61,30 +61,6 @@ To download all the resolutions and metadata for an image::
6161
# Specify output directory
6262
$ ome_zarr download https://s3.embassy.ebi.ac.uk/idr/zarr/v0.1/6001240.zarr/ --output image_dir
6363

64-
napari plugin
65-
=============
66-
67-
Napari will use `ome-zarr` to open images that the plugin recognises as ome-zarr.
68-
The image metadata from OMERO will be used to set channel names and rendering settings
69-
in napari::
70-
71-
$ napari 'https://s3.embassy.ebi.ac.uk/idr/zarr/v0.1/6001240.zarr/'
72-
73-
# Also works with local files
74-
$ napari 6001240.zarr
75-
76-
OR in python::
77-
78-
import napari
79-
with napari.gui_qt():
80-
viewer = napari.Viewer()
81-
viewer.open('https://s3.embassy.ebi.ac.uk/idr/zarr/v0.1/6001240.zarr/')
82-
83-
If single zarray is passed to the plugin, it will be opened without the use of
84-
the metadata::
85-
86-
$ napari '/tmp/6001240.zarr/0'
87-
8864
csv to labels
8965
=============
9066

@@ -146,11 +122,10 @@ Distributed under the terms of the `BSD`_ license,
146122
"ome-zarr-py" is free and open source software
147123

148124
.. _`OME zarr spec`: https://github.com/ome/omero-ms-zarr/blob/master/spec.md
149-
.. _`Cookiecutter`: https://github.com/audreyr/cookiecutter
150125
.. _`@napari`: https://github.com/napari
151126
.. _`BSD`: https://opensource.org/licenses/BSD-2-Clause
152127
.. _`Apache Software License 2.0`: http://www.apache.org/licenses/LICENSE-2.0
153128
.. _`Mozilla Public License 2.0`: https://www.mozilla.org/media/MPL/2.0/index.txt
154-
.. _`cookiecutter-napari-plugin`: https://github.com/napari/cookiecutter-napari-plugin
155129
.. _`napari`: https://github.com/napari/napari
130+
.. _`napari-ome-zarr`: https://github.com/ome/napari-ome-zarr
156131
.. _`ome-zarr`: https://pypi.org/project/ome-zarr/

environment.yml

-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ channels:
44
- conda-forge
55
- defaults
66
dependencies:
7-
- pyqt
87
- flake8
98
- ipython
109
- mypy
@@ -20,8 +19,6 @@ dependencies:
2019
- xarray
2120
- zarr >= 2.4.0
2221
- pip:
23-
- napari
2422
- pre-commit
25-
- pytest-qt
2623
# python.app -- only install on OSX:
2724
# sys_platform environment marker doesn't work in environment.yml

ome_zarr/napari.py

-153
This file was deleted.

setup.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,9 @@ def read(fname):
4848
"Programming Language :: Python :: 3",
4949
"Operating System :: OS Independent",
5050
"License :: OSI Approved :: BSD License",
51-
"Framework :: napari",
5251
],
5352
entry_points={
5453
"console_scripts": ["ome_zarr = ome_zarr.cli:main"],
55-
"napari.plugin": ["ome_zarr = ome_zarr.napari"],
5654
},
57-
extras_require={
58-
"napari:python_version>='3.7'": ["napari"],
59-
"napari:python_version<'3.7'": ["napari<0.4.0"],
60-
},
61-
tests_require=["pytest", "napari"],
55+
tests_require=["pytest"],
6256
)

tests/test_napari.py

-79
This file was deleted.

tests/test_ome_zarr.py

-26
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import pytest
55

66
from ome_zarr.data import astronaut, create_zarr
7-
from ome_zarr.napari import napari_get_reader
87
from ome_zarr.utils import download, info
98

109

@@ -21,31 +20,6 @@ def initdir(self, tmpdir):
2120
self.path = tmpdir.mkdir("data")
2221
create_zarr(str(self.path), method=astronaut)
2322

24-
def test_get_reader_hit(self):
25-
reader = napari_get_reader(str(self.path))
26-
assert reader is not None
27-
assert callable(reader)
28-
29-
def test_reader(self):
30-
reader = napari_get_reader(str(self.path))
31-
results = reader(str(self.path))
32-
assert len(results) == 2
33-
image, label = results
34-
assert isinstance(image[0], list)
35-
assert isinstance(image[1], dict)
36-
assert image[1]["channel_axis"] == 1
37-
assert image[1]["name"] == ["Red", "Green", "Blue"]
38-
39-
def test_get_reader_with_list(self):
40-
# a better test here would use real data
41-
reader = napari_get_reader([str(self.path)])
42-
assert reader is not None
43-
assert callable(reader)
44-
45-
def test_get_reader_pass(self):
46-
reader = napari_get_reader("fake.file")
47-
assert reader is None
48-
4923
def check_info_stdout(self, out):
5024
for log in log_strings(0, 1, 3, 1, 1024, 1024, 1, 1, 1, 256, 256, "float64"):
5125
assert log in out

tox.ini

-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ deps =
1515
PyQt5: PyQt5!=5.15.0
1616
PySide2: PySide2!=5.15.0
1717

18-
extras = napari
19-
2018
commands =
2119
pytest {posargs:tests -s}
2220

0 commit comments

Comments
 (0)