Skip to content

Commit

Permalink
fix parametric images
Browse files Browse the repository at this point in the history
  • Loading branch information
haesleinhuepf committed May 7, 2022
1 parent 7389b43 commit fefb121
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions napari_skimage_regionprops/_parametric_images.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import numpy as np
from napari_tools_menu import register_function
import numpy

Expand All @@ -15,15 +16,16 @@ def visualize_measurement_on_labels(labels_layer:"napari.layers.Labels", column:
if "frame" in table.keys():
table = table[table['frame'] == current_timepoint]

measurements = table[column]
measurements = np.asarray(table[column]).tolist()

if isinstance(measurements, numpy.ndarray):
measurements = measurements.tolist()
import importlib
loader = importlib.find_loader("pyclesperanto_prototype")
found = loader is not None

try:
if found:
import pyclesperanto_prototype as cle
return cle.pull(cle.replace_intensities(labels, numpy.asarray([0] + measurements)))
except ModuleNotFoundError:
else:
return relabel_numpy(labels, measurements)


Expand Down

0 comments on commit fefb121

Please sign in to comment.