Skip to content

Commit

Permalink
correct napari version and hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
conradry committed Mar 21, 2022
1 parent d6f52e5 commit d33f85f
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 2 deletions.
6 changes: 6 additions & 0 deletions empanada_napari/_merge_split_widget.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from napari_plugin_engine import napari_hook_implementation
from qtpy.QtWidgets import QWidget, QHBoxLayout, QPushButton
from magicgui import magic_factory, magicgui
from empanada.array_utils import merge_boxes, crop_and_binarize
Expand Down Expand Up @@ -341,17 +342,22 @@ def widget(

return widget

@napari_hook_implementation(specname='napari_experimental_provide_dock_widget')
def split_by_dist():
return split_widget_distance, {'name': 'Split by Distance'}

@napari_hook_implementation(specname='napari_experimental_provide_dock_widget')
def jump_to_label_widget():
return jump_to_label, {'name': 'Jump to Label'}

@napari_hook_implementation(specname='napari_experimental_provide_dock_widget')
def merge_labels_widget():
return merge_labels, {'name': 'Merge Labels'}

@napari_hook_implementation(specname='napari_experimental_provide_dock_widget')
def split_labels_widget():
return split_function, {'name': 'Split Labels'}

@napari_hook_implementation(specname='napari_experimental_provide_dock_widget')
def delete_labels_widget():
return delete_labels, {'name': 'Delete Labels'}
2 changes: 2 additions & 0 deletions empanada_napari/_register_model.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import napari
from napari import Viewer
from napari.layers import Image, Shapes
from napari_plugin_engine import napari_hook_implementation

from magicgui import magicgui
from qtpy.QtWidgets import QWidget, QVBoxLayout, QLabel, QPlainTextEdit
Expand Down Expand Up @@ -113,5 +114,6 @@ def _process_files(*args):

return widget

@napari_hook_implementation(specname='napari_experimental_provide_dock_widget')
def register_model_dock_widget():
return register_model_widget, {'name': 'Register new model'}
2 changes: 2 additions & 0 deletions empanada_napari/_slice_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import yaml
import os
from typing import Any
from napari_plugin_engine import napari_hook_implementation

import numpy as np
from qtpy.QtWidgets import QWidget, QVBoxLayout, QLabel, QPlainTextEdit
Expand Down Expand Up @@ -199,5 +200,6 @@ def _show_test_result(*args):

return widget

@napari_hook_implementation(specname='napari_experimental_provide_dock_widget')
def slice_dock_widget():
return test_widget, {'name': '2D Inference (Parameter Testing)'}
4 changes: 3 additions & 1 deletion empanada_napari/_volume_inference.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import sys
import os
from typing import Any
from napari_plugin_engine import napari_hook_implementation

import time
import numpy as np
Expand Down Expand Up @@ -256,6 +257,7 @@ def start_consensus_worker(trackers_dict):
worker.start()

return widget


@napari_hook_implementation(specname='napari_experimental_provide_dock_widget')
def volume_dock_widget():
return volume_inference_widget, {'name': '3D Inference'}
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
napari[all]>=0.4.13
scikit-image>=0.18
empanada-dl>=0.1.2
napari-plugin-engine>=0.1.4
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ setup_requires = setuptools_scm
include_package_data = True
# add your package requirements here
install_requires =
napari[all]>=0.4.15
napari[all]>=0.4.13
napari-plugin-engine>=0.1.4
scikit-image>=0.18
empanada-dl>=0.1.2
Expand Down

0 comments on commit d33f85f

Please sign in to comment.