Skip to content

Commit

Permalink
Merge pull request #381 from clEsperanto/rename-function
Browse files Browse the repository at this point in the history
add `_filter` to variance and mean
  • Loading branch information
StRigaud authored Oct 18, 2024
2 parents 4e8662d + 4ed614e commit 75aac12
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 40 deletions.
32 changes: 16 additions & 16 deletions clic/include/tier1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,7 @@ mean_sphere_func(const Device::Pointer & device,
int radius_z) -> Array::Pointer;

/**
* @name mean
* @name mean_filter
* @brief Computes the local mean average of a pixels neighborhood defined as a boxshaped or a sphereshaped.
* The shape size is specified by its halfwidth, halfheight and halfdepth (radius).
*
Expand All @@ -1188,13 +1188,13 @@ mean_sphere_func(const Device::Pointer & device,
* @see https://clij.github.io/clij2-docs/reference_mean3DSphere
*/
auto
mean_func(const Device::Pointer & device,
const Array::Pointer & src,
Array::Pointer dst,
int radius_x,
int radius_y,
int radius_z,
std::string connectivity) -> Array::Pointer;
mean_filter_func(const Device::Pointer & device,
const Array::Pointer & src,
Array::Pointer dst,
int radius_x,
int radius_y,
int radius_z,
std::string connectivity) -> Array::Pointer;


/**
Expand Down Expand Up @@ -2707,7 +2707,7 @@ variance_sphere_func(const Device::Pointer & device,
int radius_z) -> Array::Pointer;

/**
* @name variance
* @name variance_filter
* @brief Computes the local variance of a pixels neighborhood (box or sphere). The neighborhood size is specified by
* its halfwidth, halfheight and halfdepth (radius). If 2D images are given, radius_z will be ignored.
*
Expand All @@ -2725,13 +2725,13 @@ variance_sphere_func(const Device::Pointer & device,
* @see https://clij.github.io/clij2-docs/reference_varianceSphere
*/
auto
variance_func(const Device::Pointer & device,
const Array::Pointer & src,
Array::Pointer dst,
int radius_x,
int radius_y,
int radius_z,
std::string connectivity) -> Array::Pointer;
variance_filter_func(const Device::Pointer & device,
const Array::Pointer & src,
Array::Pointer dst,
int radius_x,
int radius_y,
int radius_z,
std::string connectivity) -> Array::Pointer;


/**
Expand Down
14 changes: 7 additions & 7 deletions clic/src/tier1/mean.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ namespace cle::tier1
{

auto
mean_func(const Device::Pointer & device,
const Array::Pointer & src,
Array::Pointer dst,
int radius_x,
int radius_y,
int radius_z,
std::string connectivity) -> Array::Pointer
mean_filter_func(const Device::Pointer & device,
const Array::Pointer & src,
Array::Pointer dst,
int radius_x,
int radius_y,
int radius_z,
std::string connectivity) -> Array::Pointer
{
tier0::create_like(src, dst);
auto r_x = radius2kernelsize(radius_x);
Expand Down
14 changes: 7 additions & 7 deletions clic/src/tier1/variance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ namespace cle::tier1
{

auto
variance_func(const Device::Pointer & device,
const Array::Pointer & src,
Array::Pointer dst,
int radius_x,
int radius_y,
int radius_z,
std::string connectivity) -> Array::Pointer
variance_filter_func(const Device::Pointer & device,
const Array::Pointer & src,
Array::Pointer dst,
int radius_x,
int radius_y,
int radius_z,
std::string connectivity) -> Array::Pointer
{
tier0::create_like(src, dst, dType::FLOAT);
auto r_x = radius2kernelsize(radius_x);
Expand Down
2 changes: 1 addition & 1 deletion clic/src/tier2/detect_maxima.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ detect_maxima_func(const Device::Pointer & device,
std::string connectivity) -> Array::Pointer
{
tier0::create_like(src, dst, dType::BINARY);
auto temp = tier1::mean_func(device, src, nullptr, radius_x, radius_y, radius_z, connectivity);
auto temp = tier1::mean_filter_func(device, src, nullptr, radius_x, radius_y, radius_z, connectivity);
const KernelInfo kernel = { "detect_maxima", kernel::detect_maxima };
const ParameterList params = { { "src", temp }, { "dst", dst } };
const RangeArray range = { dst->width(), dst->height(), dst->depth() };
Expand Down
2 changes: 1 addition & 1 deletion clic/src/tier2/detect_maxima_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ detect_maxima_box_func(const Device::Pointer & device,
{
std::cerr << "Deprecated: this function is deprecated, use detect_maxima instead\n";
tier0::create_like(src, dst, dType::BINARY);
auto temp = tier1::mean_box_func(device, src, nullptr, radius_x, radius_y, radius_z);
auto temp = tier1::mean_filter_func(device, src, nullptr, radius_x, radius_y, radius_z, "box");
const KernelInfo kernel = { "detect_maxima", kernel::detect_maxima };
const ParameterList params = { { "src", temp }, { "dst", dst } };
const RangeArray range = { dst->width(), dst->height(), dst->depth() };
Expand Down
2 changes: 1 addition & 1 deletion clic/src/tier2/detect_minima.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ detect_minima_func(const Device::Pointer & device,
std::string connectivity) -> Array::Pointer
{
tier0::create_like(src, dst, dType::BINARY);
auto temp = tier1::mean_func(device, src, nullptr, radius_x, radius_y, radius_z, connectivity);
auto temp = tier1::mean_filter_func(device, src, nullptr, radius_x, radius_y, radius_z, connectivity);
const KernelInfo kernel = { "detect_minima", kernel::detect_minima };
const ParameterList params = { { "src", temp }, { "dst", dst } };
const RangeArray range = { dst->width(), dst->height(), dst->depth() };
Expand Down
2 changes: 1 addition & 1 deletion clic/src/tier2/detect_minima_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ detect_minima_box_func(const Device::Pointer & device,
{
std::cerr << "Deprecated: this function is deprecated, use detect_minima instead\n";
tier0::create_like(src, dst, dType::BINARY);
auto temp = tier1::mean_box_func(device, src, nullptr, radius_x, radius_y, radius_z);
auto temp = tier1::mean_filter_func(device, src, nullptr, radius_x, radius_y, radius_z, "box");
const KernelInfo kernel = { "detect_minima", kernel::detect_minima };
const ParameterList params = { { "src", temp }, { "dst", dst } };
const RangeArray range = { dst->width(), dst->height(), dst->depth() };
Expand Down
2 changes: 1 addition & 1 deletion clic/src/tier2/standard_deviation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ standard_deviation_func(const Device::Pointer & device,
int radius_z,
std::string connectivity) -> Array::Pointer
{
auto temp = tier1::variance_func(device, src, nullptr, radius_x, radius_y, radius_z, connectivity);
auto temp = tier1::variance_filter_func(device, src, nullptr, radius_x, radius_y, radius_z, connectivity);
return tier1::power_func(device, temp, dst, 0.5);
}

Expand Down
2 changes: 1 addition & 1 deletion clic/src/tier2/standard_deviation_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ standard_deviation_box_func(const Device::Pointer & device,
int radius_z) -> Array::Pointer
{
std::cerr << "Deprecated: this function is deprecated, use standard_deviation instead\n";
auto temp = tier1::variance_box_func(device, src, nullptr, radius_x, radius_y, radius_z);
auto temp = tier1::variance_filter_func(device, src, nullptr, radius_x, radius_y, radius_z, "box");
return tier1::power_func(device, temp, dst, 0.5);
}

Expand Down
4 changes: 2 additions & 2 deletions tests/tier1/test_mean.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ TEST_P(TestMean, executeBox)
auto gpu_input = cle::Array::create(5, 5, 3, 3, cle::dType::FLOAT, cle::mType::BUFFER, device);
gpu_input->writeFrom(input_box.data());

auto gpu_output = cle::tier1::mean_func(device, gpu_input, nullptr, 1, 1, 1, "box");
auto gpu_output = cle::tier1::mean_filter_func(device, gpu_input, nullptr, 1, 1, 1, "box");

gpu_output->readTo(output.data());
for (int i = 0; i < output.size(); i++)
Expand All @@ -95,7 +95,7 @@ TEST_P(TestMean, executeSphere)
auto gpu_input = cle::Array::create(5, 5, 3, 3, cle::dType::FLOAT, cle::mType::BUFFER, device);
gpu_input->writeFrom(input_sphere.data());

auto gpu_output = cle::tier1::mean_func(device, gpu_input, nullptr, 1, 1, 1, "sphere");
auto gpu_output = cle::tier1::mean_filter_func(device, gpu_input, nullptr, 1, 1, 1, "sphere");

gpu_output->readTo(output.data());
for (int i = 0; i < output.size(); i++)
Expand Down
4 changes: 2 additions & 2 deletions tests/tier1/test_variance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ TEST_P(TestVariance, executeBox)
auto gpu_input = cle::Array::create(5, 5, 1, 3, cle::dType::FLOAT, cle::mType::BUFFER, device);
gpu_input->writeFrom(input.data());

auto gpu_output = cle::tier1::variance_func(device, gpu_input, nullptr, 1, 1, 0, "box");
auto gpu_output = cle::tier1::variance_filter_func(device, gpu_input, nullptr, 1, 1, 0, "box");

gpu_output->readTo(output.data());
for (int i = 0; i < output.size(); i++)
Expand All @@ -82,7 +82,7 @@ TEST_P(TestVariance, executeSphere)
auto gpu_input = cle::Array::create(5, 5, 1, 3, cle::dType::FLOAT, cle::mType::BUFFER, device);
gpu_input->writeFrom(input.data());

auto gpu_output = cle::tier1::variance_func(device, gpu_input, nullptr, 1, 1, 0, "sphere");
auto gpu_output = cle::tier1::variance_filter_func(device, gpu_input, nullptr, 1, 1, 0, "sphere");

gpu_output->readTo(output.data());
for (int i = 0; i < output.size(); i++)
Expand Down

0 comments on commit 75aac12

Please sign in to comment.