Skip to content

Commit

Permalink
WIP: transition from pyclesperanto_prototype to pyclesperanto
Browse files Browse the repository at this point in the history
  • Loading branch information
haesleinhuepf committed Sep 5, 2024
1 parent b4b9e7b commit 3afc3d2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions napari_pyclesperanto_assistant/_napari_cle_functions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pyclesperanto_prototype as cle
import pyclesperanto as cle
from napari_tools_menu import register_function
from napari_time_slicer import time_slicer

Expand All @@ -13,7 +13,7 @@ def _package_ncle(func):
@_package_ncle
def label(binary_image: "napari.types.LabelsData") -> "napari.types.LabelsData":
"""Connected component labeling using box-neighborhood (8-connected in 2D, 26-connected in 3D)"""
result = cle.connected_components_labeling_box(binary_image)
result = cle.connected_components_labeling(binary_image)
return result


Expand Down Expand Up @@ -42,14 +42,14 @@ def gauss_otsu_labeling(image:"napari.types.ImageData", outline_sigma: float = 2
@time_slicer
@_package_ncle
def top_hat_box(image:"napari.types.ImageData", radius_x: int = 10, radius_y: int = 10, radius_z: int = 0) -> "napari.types.ImageData":
return cle.top_hat_box(image, radius_x=radius_x, radius_y=radius_y, radius_z=radius_z)
return cle.top_hat(image, radius_x=radius_x, radius_y=radius_y, radius_z=radius_z)


@register_function(menu="Filtering / noise removal > Mean (box, clesperanto)")
@time_slicer
@_package_ncle
def mean_box(image:"napari.types.ImageData", radius_x: int = 10, radius_y: int = 10, radius_z: int = 0) -> "napari.types.ImageData":
return cle.mean_box(image, radius_x=radius_x, radius_y=radius_y, radius_z=radius_z)
return cle.mean(image, radius_x=radius_x, radius_y=radius_y, radius_z=radius_z)


@register_function(menu="Filtering > Difference of Gaussian (clesperanto)")
Expand All @@ -72,7 +72,7 @@ def laplacian_of_gaussian(image:"napari.types.ImageData",
) -> "napari.types.ImageData":
"""Applies a Laplace-box filter to a Gaussian-blurred image of the original.
That might be useful for edge detection"""
return cle.laplace_box(
return cle.laplace(
cle.gaussian_blur(image,
sigma_x=sigma_x, sigma_y=sigma_y, sigma_z=sigma_z,
)
Expand Down Expand Up @@ -121,14 +121,14 @@ def large_hessian_eigenvalue(image:"napari.types.ImageData") -> "napari.types.Im
@time_slicer
@_package_ncle
def standard_deviation_box(image:"napari.types.ImageData", radius_x: int = 10, radius_y: int = 10, radius_z: int = 0) -> "napari.types.ImageData":
return cle.standard_deviation_box(image, radius_x=radius_x, radius_y=radius_y, radius_z=radius_z)
return cle.standard_deviation(image, radius_x=radius_x, radius_y=radius_y, radius_z=radius_z)


@register_function(menu="Filtering / edge enhancement > Variance (box, clesperanto)")
@time_slicer
@_package_ncle
def variance_box(image:"napari.types.ImageData", radius_x: int = 10, radius_y: int = 10, radius_z: int = 0) -> "napari.types.ImageData":
return cle.variance_box(image, radius_x=radius_x, radius_y=radius_y, radius_z=radius_z)
return cle.variance(image, radius_x=radius_x, radius_y=radius_y, radius_z=radius_z)


@register_function(menu="Segmentation post-processing > Exclude large labels (clesperanto)")
Expand Down

0 comments on commit 3afc3d2

Please sign in to comment.