From 8c4915b4c7914bb4e0e1fd2d7bbb9fa43f3baa96 Mon Sep 17 00:00:00 2001 From: Genevieve Buckley <30920819+GenevieveBuckley@users.noreply.github.com> Date: Wed, 14 Feb 2024 17:30:22 +1100 Subject: [PATCH] npe2 conversion (napari plugin engine 2) (#11) * Result of 'npe2 convert' command * This plugin is associated with .tiff & .tif file extensions * Remove napari-plugin-engine 1 (old version) cruft --- napari_tiff/napari.yaml | 13 +++++++++++++ napari_tiff/napari_tiff_reader.py | 2 -- requirements.txt | 1 - 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 napari_tiff/napari.yaml diff --git a/napari_tiff/napari.yaml b/napari_tiff/napari.yaml new file mode 100644 index 0000000..da00da7 --- /dev/null +++ b/napari_tiff/napari.yaml @@ -0,0 +1,13 @@ +name: napari-tiff +schema_version: 0.2.0 +contributions: + commands: + - id: napari-tiff.get_reader + title: Get Reader + python_name: napari_tiff.napari_tiff_reader:napari_get_reader + readers: + - command: napari-tiff.get_reader + filename_patterns: + - '*.tiff' + - '*.tif' + accepts_directories: true diff --git a/napari_tiff/napari_tiff_reader.py b/napari_tiff/napari_tiff_reader.py index 804710b..2957816 100644 --- a/napari_tiff/napari_tiff_reader.py +++ b/napari_tiff/napari_tiff_reader.py @@ -12,7 +12,6 @@ from typing import List, Optional, Union, Any, Tuple, Dict, Callable import numpy -from napari_plugin_engine import napari_hook_implementation from tifffile import TiffFile, TiffSequence, TIFF from vispy.color import Colormap @@ -21,7 +20,6 @@ ReaderFunction = Callable[[PathLike], List[LayerData]] -@napari_hook_implementation def napari_get_reader(path: PathLike) -> Optional[ReaderFunction]: """Implements napari_get_reader hook specification. diff --git a/requirements.txt b/requirements.txt index a22ad91..4695091 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,4 @@ imagecodecs -napari-plugin-engine>=0.1.4 numpy tifffile>=2020.5.7 vispy \ No newline at end of file