diff --git a/pyclesperanto/_operators.py b/pyclesperanto/_operators.py index 584b29f6..dee3202d 100644 --- a/pyclesperanto/_operators.py +++ b/pyclesperanto/_operators.py @@ -135,7 +135,7 @@ def __add__(x1, x2): else: from ._tier1 import add_images_weighted - return add_images_weighted(x1, x2, factor0=1, factor1=1) + return add_images_weighted(x1, x2, factor1=1, factor2=1) def __iadd__(x1, x2): @@ -150,7 +150,7 @@ def __iadd__(x1, x2): else: from ._tier1 import add_images_weighted - add_images_weighted(temp, x2, output_image=x1, factor0=1, factor1=1) + add_images_weighted(temp, x2, output_image=x1, factor1=1, factor2=1) return x1 @@ -163,7 +163,7 @@ def __sub__(x1, x2): else: from ._tier1 import add_images_weighted - return add_images_weighted(x1, x2, factor0=1, factor1=-1) + return add_images_weighted(x1, x2, factor1=1, factor2=-1) def __div__(x1, x2): diff --git a/tests/test_add_images_weighted.py b/tests/test_add_images_weighted.py index dc70f024..26545b20 100644 --- a/tests/test_add_images_weighted.py +++ b/tests/test_add_images_weighted.py @@ -36,7 +36,7 @@ def test_add_images_weighted_named_parameters(): input2 = np.asarray([4, 5, 6]) reference = np.asarray([9, 12, 15]) - output = cle.add_images_weighted(input1, input2, None, factor0=1, factor1=2) + output = cle.add_images_weighted(input1, input2, None, factor1=1, factor2=2) result = cle.pull(output) print(result) @@ -49,7 +49,7 @@ def test_add_images_weighted_wrong_parameter_order(): input2 = np.asarray([4, 5, 6]) reference = np.asarray([9, 12, 15]) - output = cle.add_images_weighted(input1, input2, factor0=1, factor1=2) + output = cle.add_images_weighted(input1, input2, factor1=1, factor2=2) result = cle.pull(output) print(result) @@ -62,7 +62,7 @@ def test_add_images_weighted_parameters_wrong_order_and_missing(): input2 = np.asarray([4, 5, 6]) reference = np.asarray([9, 12, 15]) - output = cle.add_images_weighted(input1, input2, factor1=2, factor0=1) + output = cle.add_images_weighted(input1, input2, factor2=2, factor1=1) result = cle.pull(output) print(result) diff --git a/tests/test_erode_labels.py b/tests/test_erode_labels.py index 5322ee01..1d921745 100644 --- a/tests/test_erode_labels.py +++ b/tests/test_erode_labels.py @@ -61,7 +61,7 @@ def test_erode_labels_2d_1(): for r in range(5): print("r", r) - gpu_reference = cle.minimum(gpu_input, radius_x=r, radius_y=r) + gpu_reference = cle.minimum_filter(gpu_input, radius_x=r, radius_y=r) gpu_output = cle.erode_labels(gpu_input, radius=r, relabel=False) print(gpu_output) diff --git a/tests/test_histogram.py b/tests/test_histogram.py index 9f368b47..558663ff 100644 --- a/tests/test_histogram.py +++ b/tests/test_histogram.py @@ -10,7 +10,9 @@ def test_histogram(): ref_histogram = [1, 2, 3, 4, 2] - my_histogram = cle.histogram(test, nbins=5, min=1, max=5) + my_histogram = cle.histogram( + test, num_bins=5, minimum_intensity=1, maximum_intensity=5 + ) print(my_histogram) @@ -23,7 +25,9 @@ def test_histogram_3d(): ref_histogram = [1, 2, 3, 4, 2] - my_histogram = cle.histogram(test, nbins=5, min=1, max=5) + my_histogram = cle.histogram( + test, num_bins=5, minimum_intensity=1, maximum_intensity=5 + ) print(my_histogram) @@ -36,7 +40,9 @@ def test_histogram_3d_2(): ref_histogram = [1, 2, 3, 4, 2] - my_histogram = cle.histogram(test, nbins=5, min=1, max=5) + my_histogram = cle.histogram( + test, num_bins=5, minimum_intensity=1, maximum_intensity=5 + ) print(my_histogram) @@ -51,6 +57,6 @@ def test_histogram_3d_2(): # hist, bc = exposure.histogram(image.ravel(), 256, source_range="image") # print(hist) # gpu_image = cle.push(image.astype(int)) -# gpu_hist = cle.histogram(gpu_image, nbins=256, min=0, max=gpu_image.max()) +# gpu_hist = cle.histogram(gpu_image, num_bins=256, minimum_intensity=0, maximum_intensity=gpu_image.max()) # print(cle.pull(gpu_hist)) # assert np.allclose(hist, cle.pull(gpu_hist)) diff --git a/tests/test_maximum_box.py b/tests/test_maximum_box.py index c6026bbd..ab97859b 100644 --- a/tests/test_maximum_box.py +++ b/tests/test_maximum_box.py @@ -31,7 +31,7 @@ def test_maximum_box(): ) result = cle.create(test1) - cle.maximum(test1, result, 1, 1, 0) + cle.maximum_filter(test1, result, 1, 1, 0) a = cle.pull(result) b = cle.pull(reference) diff --git a/tests/test_maximum_sphere.py b/tests/test_maximum_sphere.py index d805610a..1c7dbe76 100644 --- a/tests/test_maximum_sphere.py +++ b/tests/test_maximum_sphere.py @@ -9,7 +9,7 @@ def test_maximum_sphere_1(): test = cle.push(np.asarray([[1, 1, 1], [1, 2, 1], [1, 1, 1]])) test2 = cle.create(test) - cle.maximum(test, test2, 1, 1, 1, "sphere") + cle.maximum_filter(test, test2, 1, 1, 1, "sphere") a = cle.pull(test2) assert np.min(a) == 1 @@ -28,7 +28,7 @@ def test_maximum_sphere_1(): def test_maximum_sphere_2(): gpu_a = cle.push(np.asarray([[1, 1, 1], [1, 2, 1], [1, 1, 1]])) gpu_b = cle.create(gpu_a) - cle.maximum(gpu_a, gpu_b, 1, 1, 1, "sphere") + cle.maximum_filter(gpu_a, gpu_b, 1, 1, 1, "sphere") a = cle.pull(gpu_b) assert np.min(a) == 1 diff --git a/tests/test_minimum_box.py b/tests/test_minimum_box.py index cb7fbb26..71500521 100644 --- a/tests/test_minimum_box.py +++ b/tests/test_minimum_box.py @@ -31,7 +31,7 @@ def test_minimum_box(): ) result = cle.create(test1) - cle.minimum(test1, result, 1, 1, 0) + cle.minimum_filter(test1, result, 1, 1, 0) a = cle.pull(result) b = cle.pull(reference) diff --git a/tests/test_statistics_of_labelled_pixels.py b/tests/test_statistics_of_labelled_pixels.py index 5485e9fc..d020719b 100644 --- a/tests/test_statistics_of_labelled_pixels.py +++ b/tests/test_statistics_of_labelled_pixels.py @@ -31,7 +31,7 @@ def test_statistics_of_labelled_pixels(): ) ) - result = cle.statistics_of_labelled_pixels(labels, intensities) + result = cle.statistics_of_labelled_pixels(intensities, labels) print(result)