Skip to content

Commit

Permalink
Merge pull request #357 from clEsperanto/fix-param-name
Browse files Browse the repository at this point in the history
fix min/max to minimum maximum
  • Loading branch information
StRigaud authored Oct 10, 2024
2 parents fc0ed1c + 0802b5f commit e0334ee
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 34 deletions.
16 changes: 8 additions & 8 deletions clic/include/tier5.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ reduce_labels_to_centroids_func(const Device::Pointer & device, const Array::Poi
* @param device Device to perform the operation on. [const Device::Pointer &]
* @param src Input label image. [const Array::Pointer &]
* @param dst Output label image. [Array::Pointer ( = None )]
* @param min_size Minimum size of labels to keep. [float ( = 0 )]
* @param max_size Maximum size of labels to keep. [float ( = 100 )]
* @param minimum_size Minimum size of labels to keep. [float ( = 0 )]
* @param maximum_size Maximum size of labels to keep. [float ( = 100 )]
* @return Array::Pointer
*
* @note 'label processing', 'in assistant'
Expand All @@ -124,8 +124,8 @@ auto
filter_label_by_size_func(const Device::Pointer & device,
const Array::Pointer & src,
Array::Pointer dst,
float min_size,
float max_size) -> Array::Pointer;
float minimum_size,
float maximum_size) -> Array::Pointer;

/**
* @name exclude_labels_outside_size_range
Expand All @@ -134,8 +134,8 @@ filter_label_by_size_func(const Device::Pointer & device,
* @param device Device to perform the operation on. [const Device::Pointer &]
* @param src Input label image. [const Array::Pointer &]
* @param dst Output label image. [Array::Pointer ( = None )]
* @param min_size Minimum size of labels to keep. [float ( = 0 )]
* @param max_size Maximum size of labels to keep. [float ( = 100 )]
* @param minimum_size Minimum size of labels to keep. [float ( = 0 )]
* @param maximum_size Maximum size of labels to keep. [float ( = 100 )]
* @return Array::Pointer
*
* @note 'label processing', 'in assistant'
Expand All @@ -145,8 +145,8 @@ auto
exclude_labels_outside_size_range_func(const Device::Pointer & device,
const Array::Pointer & src,
Array::Pointer dst,
float min_size,
float max_size) -> Array::Pointer;
float minimum_size,
float maximum_size) -> Array::Pointer;

} // namespace cle::tier5

Expand Down
24 changes: 14 additions & 10 deletions clic/include/tier6.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,17 @@ voronoi_labeling_func(const Device::Pointer & device, const Array::Pointer & src
* @param device Device to perform the operation on. [const Device::Pointer &]
* @param src Label image to filter. [const Array::Pointer &]
* @param dst Output label image fitlered. [Array::Pointer ( = None )]
* @param min_size Smallest size object allowed. [float ( = 100 )]
* @param minimum_size Smallest size object allowed. [float ( = 100 )]
* @return Array::Pointer
*
* @note 'label processing', 'in assistant', 'bia-bob-suggestion'
* @see https://clij.github.io/clij2-docs/reference_excludeLabelsOutsideSizeRange
*/
auto
remove_small_labels_func(const Device::Pointer & device, const Array::Pointer & src, Array::Pointer dst, float min_size)
-> Array::Pointer;
remove_small_labels_func(const Device::Pointer & device,
const Array::Pointer & src,
Array::Pointer dst,
float minimum_size) -> Array::Pointer;

/**
* @name exclude_small_labels
Expand All @@ -138,7 +140,7 @@ remove_small_labels_func(const Device::Pointer & device, const Array::Pointer &
* @param device Device to perform the operation on. [const Device::Pointer &]
* @param src Label image to filter. [const Array::Pointer &]
* @param dst Output label image fitlered. [Array::Pointer ( = None )]
* @param max_size Largest size object to exclude. [float ( = 100 )]
* @param maximum_size Largest size object to exclude. [float ( = 100 )]
* @return Array::Pointer
*
* @note 'label processing', 'in assistant'
Expand All @@ -148,7 +150,7 @@ auto
exclude_small_labels_func(const Device::Pointer & device,
const Array::Pointer & src,
Array::Pointer dst,
float max_size) -> Array::Pointer;
float maximum_size) -> Array::Pointer;

/**
* @name remove_large_labels
Expand All @@ -157,15 +159,17 @@ exclude_small_labels_func(const Device::Pointer & device,
* @param device Device to perform the operation on. [const Device::Pointer &]
* @param src Label image to filter. [const Array::Pointer &]
* @param dst Output label image fitlered. [Array::Pointer ( = None )]
* @param max_size Biggest size object allowed. [float ( = 100 )]
* @param maximum_size Biggest size object allowed. [float ( = 100 )]
* @return Array::Pointer
*
* @note 'label processing', 'in assistant', 'bia-bob-suggestion'
* @see https://clij.github.io/clij2-docs/reference_excludeLabelsOutsideSizeRange
*/
auto
remove_large_labels_func(const Device::Pointer & device, const Array::Pointer & src, Array::Pointer dst, float max_size)
-> Array::Pointer;
remove_large_labels_func(const Device::Pointer & device,
const Array::Pointer & src,
Array::Pointer dst,
float maximum_size) -> Array::Pointer;

/**
* @name exclude_large_labels
Expand All @@ -174,7 +178,7 @@ remove_large_labels_func(const Device::Pointer & device, const Array::Pointer &
* @param device Device to perform the operation on. [const Device::Pointer &]
* @param src Label image to filter. [const Array::Pointer &]
* @param dst Output label image fitlered. [Array::Pointer ( = None )]
* @param min_size Smallest size object to keep. [float ( = 100 )]
* @param minimum_size Smallest size object to keep. [float ( = 100 )]
* @return Array::Pointer
*
* @note 'label processing', 'in assistant'
Expand All @@ -184,7 +188,7 @@ auto
exclude_large_labels_func(const Device::Pointer & device,
const Array::Pointer & src,
Array::Pointer dst,
float min_size) -> Array::Pointer;
float minimum_size) -> Array::Pointer;


} // namespace cle::tier6
Expand Down
13 changes: 7 additions & 6 deletions clic/src/tier5/filter_label_by_size.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ auto
filter_label_by_size_func(const Device::Pointer & device,
const Array::Pointer & src,
Array::Pointer dst,
float min_size,
float max_size) -> Array::Pointer
float minimum_size,
float maximum_size) -> Array::Pointer
{
tier0::create_like(src, dst, dType::LABEL);
auto stats = tier3::statistics_of_background_and_labelled_pixels_func(device, src, nullptr);
Expand All @@ -25,17 +25,18 @@ filter_label_by_size_func(const Device::Pointer & device,
auto list_of_area = Array::create(nb_labels, 1, 1, 1, dType::FLOAT, mType::BUFFER, device);
list_of_area->writeFrom(stats["area"].data());

return tier4::remove_labels_with_map_values_out_of_range_func(device, src, list_of_area, dst, min_size, max_size);
return tier4::remove_labels_with_map_values_out_of_range_func(
device, src, list_of_area, dst, minimum_size, maximum_size);
}

auto
exclude_labels_outside_size_range_func(const Device::Pointer & device,
const Array::Pointer & src,
Array::Pointer dst,
float min_size,
float max_size) -> Array::Pointer
float minimum_size,
float maximum_size) -> Array::Pointer
{
return filter_label_by_size_func(device, src, dst, min_size, max_size);
return filter_label_by_size_func(device, src, dst, minimum_size, maximum_size);
}

} // namespace cle::tier5
24 changes: 14 additions & 10 deletions clic/src/tier6/remove_objects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,39 @@ namespace cle::tier6
{

auto
remove_small_labels_func(const Device::Pointer & device, const Array::Pointer & src, Array::Pointer dst, float min_size)
-> Array::Pointer
remove_small_labels_func(const Device::Pointer & device,
const Array::Pointer & src,
Array::Pointer dst,
float minimum_size) -> Array::Pointer
{
return tier5::filter_label_by_size_func(device, src, dst, min_size, std::numeric_limits<float>::max());
return tier5::filter_label_by_size_func(device, src, dst, minimum_size, std::numeric_limits<float>::max());
}

auto
remove_large_labels_func(const Device::Pointer & device, const Array::Pointer & src, Array::Pointer dst, float max_size)
-> Array::Pointer
remove_large_labels_func(const Device::Pointer & device,
const Array::Pointer & src,
Array::Pointer dst,
float maximum_size) -> Array::Pointer
{
return tier5::filter_label_by_size_func(device, src, dst, 0, max_size);
return tier5::filter_label_by_size_func(device, src, dst, 0, maximum_size);
}

auto
exclude_small_labels_func(const Device::Pointer & device,
const Array::Pointer & src,
Array::Pointer dst,
float max_size) -> Array::Pointer
float maximum_size) -> Array::Pointer
{
return remove_small_labels_func(device, src, dst, max_size);
return remove_small_labels_func(device, src, dst, maximum_size);
}

auto
exclude_large_labels_func(const Device::Pointer & device,
const Array::Pointer & src,
Array::Pointer dst,
float min_size) -> Array::Pointer
float minimum_size) -> Array::Pointer
{
return remove_large_labels_func(device, src, dst, min_size);
return remove_large_labels_func(device, src, dst, minimum_size);
}

} // namespace cle::tier6

0 comments on commit e0334ee

Please sign in to comment.