Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 18, 2024
1 parent 936334f commit 1ae9731
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 20 deletions.
11 changes: 7 additions & 4 deletions clic/include/tier4.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ threshold_otsu_func(const Device::Pointer & device, const Array::Pointer & src,

/**
* @name mean_intensity_map
* @brief Takes an image and a corresponding label map, determines the mean
* @brief Takes an image and a corresponding label map, determines the mean
* intensity per label and replaces every label with the that number.
*
* This results in a parametric image expressing mean object intensity.
*
* This results in a parametric image expressing mean object intensity.
*
* @param device Device to perform the operation on. [const Device::Pointer &]
* @param src intensity image [const Array::Pointer &]
Expand All @@ -119,7 +119,10 @@ threshold_otsu_func(const Device::Pointer & device, const Array::Pointer & src,
* @see https://clij.github.io/clij2-docs/reference_meanIntensityMap
*/
auto
mean_intensity_map_func(const Device::Pointer & device, const Array::Pointer & src, const Array::Pointer & labels, Array::Pointer dst) -> Array::Pointer;
mean_intensity_map_func(const Device::Pointer & device,
const Array::Pointer & src,
const Array::Pointer & labels,
Array::Pointer dst) -> Array::Pointer;


/**
Expand Down
5 changes: 4 additions & 1 deletion clic/src/tier4/parametrics_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ extension_ratio_map_func(const Device::Pointer & device, const Array::Pointer &
}

auto
mean_intensity_map_func(const Device::Pointer & device, const Array::Pointer & src, const Array::Pointer & labels, Array::Pointer dst) -> Array::Pointer
mean_intensity_map_func(const Device::Pointer & device,
const Array::Pointer & src,
const Array::Pointer & labels,
Array::Pointer dst) -> Array::Pointer
{
tier0::create_like(src, dst, dType::FLOAT);
auto props = tier3::statistics_of_background_and_labelled_pixels_func(device, src, labels);
Expand Down
18 changes: 3 additions & 15 deletions tests/tier4/test_mean_intensity_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,11 @@
class TestMeanIntensityMap : public ::testing::TestWithParam<std::string>
{
protected:
std::array<float, 3 * 3 * 1> intensity = {
1, 1, 2,
4, 0, 0,
5, 3, 0
};
std::array<float, 3 * 3 * 1> intensity = { 1, 1, 2, 4, 0, 0, 5, 3, 0 };

std::array<uint32_t, 3 * 3 * 1> label = {
1, 1, 2,
1, 0, 0,
3, 3, 0
};
std::array<uint32_t, 3 * 3 * 1> label = { 1, 1, 2, 1, 0, 0, 3, 3, 0 };

std::array<float, 3 * 3 * 1> valid = {
2, 2, 2,
2, 0, 0,
4, 4, 0
};
std::array<float, 3 * 3 * 1> valid = { 2, 2, 2, 2, 0, 0, 4, 4, 0 };
};

TEST_P(TestMeanIntensityMap, execute)
Expand Down

0 comments on commit 1ae9731

Please sign in to comment.