Skip to content

Commit

Permalink
Updates- Works GPU masks and CPU too
Browse files Browse the repository at this point in the history
  • Loading branch information
João Mamede committed Nov 4, 2023
1 parent bdedcdf commit 303110e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/napari_trackpy/_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def _get_choice_layer(self,_widget):
print("Layer where points are is:",j)
return index_layer

def make_labels_trackpy_links(shape,j,radius=5,_round=False,_algo="CPU"):
def make_labels_trackpy_links(shape,j,radius=5,_round=False,_algo="GPU"):
import trackpy as tp
import scipy.ndimage as ndi
from scipy.ndimage import binary_dilation
Expand Down Expand Up @@ -364,7 +364,7 @@ def make_masks(self):
mask_temp, idx_temp = make_labels_trackpy_links(
self.viewer.layers[index_layer].data[i].shape,
# self.viewer.layers[index_layer].data[i],
temp,radius=(self.diameter_input.value())/2)
temp,radius=((self.diameter_input.value())/2)-0.5)
# temp,size=5-1)
# print(mask_temp.max(),len(temp.index))
# idx.append(idx_temp)
Expand Down Expand Up @@ -449,6 +449,7 @@ def _on_click(self):

_masks = self.make_masks()
self._masks_layer = self.viewer.add_labels(_masks)
self._masks_layer.scale = self.viewer.layers[index_layer].scale

# @thread_worker
def _on_click2(self):
Expand Down

0 comments on commit 303110e

Please sign in to comment.