Skip to content

Commit

Permalink
Fix missing imports
Browse files Browse the repository at this point in the history
  • Loading branch information
rhoitink committed Nov 7, 2023
1 parent 8a20f5f commit 295d9ee
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions src/napari_trackpy/_widget.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
from time import time
from typing import TYPE_CHECKING
from typing import cast

import matplotlib.pyplot as plt
import napari
import napari.layers
import napari.viewer
import numpy as np
import trackpy as tp
from matplotlib.backends.backend_qt5agg import FigureCanvas
from napari.utils import notifications
from superqt.utils import thread_worker

if TYPE_CHECKING:
import napari
import napari.layers
import napari.viewer

from typing import cast

from magicgui.widgets import (
ComboBox,
Container,
Expand All @@ -23,6 +15,9 @@
PushButton,
create_widget,
)
from matplotlib.backends.backend_qt5agg import FigureCanvas
from napari.utils import notifications
from superqt.utils import thread_worker


class XYZWidget(Container):
Expand Down Expand Up @@ -193,9 +188,7 @@ def do_particle_tracking(self):
return (self.coords, self.pixel_sizes)

def _on_label_layer_changed(self, new_value: napari.layers.Image):
# print(self.img_layer_name, type(self.img_layer_name), type(new_value))
self.img_layer = new_value
# set your internal annotation layer here.

def _on_run_clicked(self):
if self.img_layer is None:
Expand All @@ -215,7 +208,6 @@ def _on_run_clicked(self):
self.run_btn.enabled = False
tracking_thread = self.do_particle_tracking()
tracking_thread.finished.connect(lambda: self.process_tracking())
# tracking_thread.finished.connect(lambda: )
tracking_thread.start()

def process_tracking(self):
Expand Down Expand Up @@ -257,3 +249,6 @@ def reset(self):
self.pixel_sizes = None
if self.last_added_points_layer is not None:
self.viewer.layers.remove(self.last_added_points_layer.name)
self.reset_btn.enabled = False
self.save_params_btn.enabled = False
self.save_tracking_btn.enabled = False

0 comments on commit 295d9ee

Please sign in to comment.