Skip to content

Commit

Permalink
Merge pull request #376 from clEsperanto/rename_parameters
Browse files Browse the repository at this point in the history
rename parameters in add_images_weighted
  • Loading branch information
StRigaud authored Oct 17, 2024
2 parents d61a5a0 + 1750e2d commit a599c24
Show file tree
Hide file tree
Showing 15 changed files with 134 additions and 109 deletions.
88 changes: 47 additions & 41 deletions clic/include/tier1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ absolute_func(const Device::Pointer & device, const Array::Pointer & src, Array:
* @param src0 The first input image to added. [const Array::Pointer &]
* @param src1 The second image to be added. [const Array::Pointer &]
* @param dst The output image where results are written into. [Array::Pointer ( = None )]
* @param factor0 Multiplication factor of each pixel of src0 before adding it. [float ( = 1 )]
* @param factor1 Multiplication factor of each pixel of src1 before adding it. [float ( = 1 )]
* @param factor1 Multiplication factor of each pixel of src0 before adding it. [float ( = 1 )]
* @param factor2 Multiplication factor of each pixel of src1 before adding it. [float ( = 1 )]
* @return Array::Pointer
*
* @note 'combine', 'in assistant'
Expand All @@ -47,8 +47,8 @@ add_images_weighted_func(const Device::Pointer & device,
const Array::Pointer & src0,
const Array::Pointer & src1,
Array::Pointer dst,
float factor0,
float factor1) -> Array::Pointer;
float factor1,
float factor2) -> Array::Pointer;


/**
Expand Down Expand Up @@ -282,58 +282,62 @@ copy_func(const Device::Pointer & device, const Array::Pointer & src, Array::Poi

/**
* @name copy_slice
* @brief This method has two purposes: It copies a 2D image to a given slice z position in a 3D image stack or It
* copies a given slice at position z in an image stack to a 2D image. The first case is only available via ImageJ
* @brief This method has two purposes: It copies a 2D image to a given slice_index z position in a 3D image stack or It
* copies a given slice_index at position z in an image stack to a 2D image. The first case is only available via ImageJ
* macro. If you are using it, it is recommended that the target 3D image already preexists in GPU memory before calling
* this method. Otherwise, CLIJ create the image stack with z planes.
*
* @param device Device to perform the operation on. [const Device::Pointer &]
* @param src Input image to copy from. [const Array::Pointer &]
* @param dst Output copy image slice. [Array::Pointer ( = None )]
* @param slice [int ( = 0 )]
* @param dst Output copy image slice_index. [Array::Pointer ( = None )]
* @param slice_index [int ( = 0 )]
* @return Array::Pointer
* @see https://clij.github.io/clij2-docs/reference_copySlice
*
*/
auto
copy_slice_func(const Device::Pointer & device, const Array::Pointer & src, Array::Pointer dst, int slice)
copy_slice_func(const Device::Pointer & device, const Array::Pointer & src, Array::Pointer dst, int slice_index)
-> Array::Pointer;


/**
* @name copy_horizontal_slice
* @brief This method has two purposes: It copies a 2D image to a given slice y position in a 3D image stack or It
* copies a given slice at position y in an image stack to a 2D image.
* @brief This method has two purposes: It copies a 2D image to a given slice_index y position in a 3D image stack or It
* copies a given slice_index at position y in an image stack to a 2D image.
*
* @param device Device to perform the operation on. [const Device::Pointer &]
* @param src Input image to copy from. [const Array::Pointer &]
* @param dst Output copy image slice. [Array::Pointer ( = None )]
* @param slice [int ( = 0 )]
* @param dst Output copy image slice_index. [Array::Pointer ( = None )]
* @param slice_index [int ( = 0 )]
* @return Array::Pointer
* @see https://clij.github.io/clij2-docs/reference_copySlice
*
*/
auto
copy_horizontal_slice_func(const Device::Pointer & device, const Array::Pointer & src, Array::Pointer dst, int slice)
-> Array::Pointer;
copy_horizontal_slice_func(const Device::Pointer & device,
const Array::Pointer & src,
Array::Pointer dst,
int slice_index) -> Array::Pointer;


/**
* @name copy_vertical_slice
* @brief This method has two purposes: It copies a 2D image to a given slice x position in a 3D image stack or It
* copies a given slice at position x in an image stack to a 2D image.
* @brief This method has two purposes: It copies a 2D image to a given slice_index x position in a 3D image stack or It
* copies a given slice_index at position x in an image stack to a 2D image.
*
* @param device Device to perform the operation on. [const Device::Pointer &]
* @param src Input image to copy from. [const Array::Pointer &]
* @param dst Output copy image slice. [Array::Pointer ( = None )]
* @param slice [int ( = 0 )]
* @param dst Output copy image slice_index. [Array::Pointer ( = None )]
* @param slice_index [int ( = 0 )]
* @return Array::Pointer
* @see https://clij.github.io/clij2-docs/reference_copySlice
*
*/
auto
copy_vertical_slice_func(const Device::Pointer & device, const Array::Pointer & src, Array::Pointer dst, int slice)
-> Array::Pointer;
copy_vertical_slice_func(const Device::Pointer & device,
const Array::Pointer & src,
Array::Pointer dst,
int slice_index) -> Array::Pointer;


/**
Expand Down Expand Up @@ -1836,9 +1840,9 @@ not_equal_constant_func(const Device::Pointer & device, const Array::Pointer & s
* @param device Device to perform the operation on. [const Device::Pointer &]
* @param src Input image to process. [const Array::Pointer &]
* @param dst Output result image. [Array::Pointer ( = None )]
* @param index_x Origin pixel coodinate in x to paste. [int ( = 0 )]
* @param index_y Origin pixel coodinate in y to paste. [int ( = 0 )]
* @param index_z Origin pixel coodinate in z to paste. [int ( = 0 )]
* @param destination_x Origin pixel coodinate in x to paste. [int ( = 0 )]
* @param destination_y Origin pixel coodinate in y to paste. [int ( = 0 )]
* @param destination_z Origin pixel coodinate in z to paste. [int ( = 0 )]
* @return Array::Pointer
*
* @note 'combine', 'in assistant'
Expand All @@ -1848,9 +1852,9 @@ auto
paste_func(const Device::Pointer & device,
const Array::Pointer & src,
Array::Pointer dst,
int index_x,
int index_y,
int index_z) -> Array::Pointer;
int destination_x,
int destination_y,
int destination_z) -> Array::Pointer;


/**
Expand Down Expand Up @@ -2031,8 +2035,8 @@ replace_values_func(const Device::Pointer & device,
* @param device Device to perform the operation on. [const Device::Pointer &]
* @param src Input image to process. [const Array::Pointer &]
* @param dst Output result image. [Array::Pointer ( = None )]
* @param scalar0 Old value. [float ( = 0 )]
* @param scalar1 New value. [float ( = 1 )]
* @param value_to_replace Old value. [float ( = 0 )]
* @param value_replacement New value. [float ( = 1 )]
* @return Array::Pointer
* @see https://clij.github.io/clij2-docs/reference_replaceIntensity
*
Expand All @@ -2041,8 +2045,8 @@ auto
replace_value_func(const Device::Pointer & device,
const Array::Pointer & src,
Array::Pointer dst,
float scalar0,
float scalar1) -> Array::Pointer;
float value_to_replace,
float value_replacement) -> Array::Pointer;

/**
* @name replace_intensity
Expand All @@ -2051,8 +2055,8 @@ replace_value_func(const Device::Pointer & device,
* @param device Device to perform the operation on. [const Device::Pointer &]
* @param src Input image to process. [const Array::Pointer &]
* @param dst Output result image. [Array::Pointer ( = None )]
* @param scalar0 Old value. [float ( = 0 )]
* @param scalar1 New value. [float ( = 1 )]
* @param value_to_replace Old value. [float ( = 0 )]
* @param value_replacement New value. [float ( = 1 )]
* @return Array::Pointer
* @see https://clij.github.io/clij2-docs/reference_replaceIntensity
* @deprecated This function is deprecated. Consider using replace_value() instead.
Expand All @@ -2061,8 +2065,8 @@ auto
replace_intensity_func(const Device::Pointer & device,
const Array::Pointer & src,
Array::Pointer dst,
float scalar0,
float scalar1) -> Array::Pointer;
float value_to_replace,
float value_replacement) -> Array::Pointer;

/**
* @name replace_intensities
Expand Down Expand Up @@ -2193,14 +2197,15 @@ set_func(const Device::Pointer & device, const Array::Pointer & src, float scala
*
* @param device Device to perform the operation on. [const Device::Pointer &]
* @param src Input image to process. [const Array::Pointer &]
* @param column Column index. [int ( = 0 )]
* @param column_index Column index. [int ( = 0 )]
* @param value Value to set. [float ( = 0 )]
* @return Array::Pointer
* @see https://clij.github.io/clij2-docs/reference_setColumn
*
*/
auto
set_column_func(const Device::Pointer & device, const Array::Pointer & src, int column, float value) -> Array::Pointer;
set_column_func(const Device::Pointer & device, const Array::Pointer & src, int column_index, float value)
-> Array::Pointer;


/**
Expand All @@ -2224,14 +2229,15 @@ set_image_borders_func(const Device::Pointer & device, const Array::Pointer & sr
*
* @param device Device to perform the operation on. [const Device::Pointer &]
* @param src Input image to process. [const Array::Pointer &]
* @param plane Plane index. [int ( = 0 )]
* @param plane_index Plane index. [int ( = 0 )]
* @param value Value to set. [float ( = 0 )]
* @return Array::Pointer
* @see https://clij.github.io/clij2-docs/reference_setPlane
*
*/
auto
set_plane_func(const Device::Pointer & device, const Array::Pointer & src, int plane, float value) -> Array::Pointer;
set_plane_func(const Device::Pointer & device, const Array::Pointer & src, int plane_index, float value)
-> Array::Pointer;


/**
Expand Down Expand Up @@ -2282,14 +2288,14 @@ set_ramp_z_func(const Device::Pointer & device, const Array::Pointer & src) -> A
*
* @param device Device to perform the operation on. [const Device::Pointer &]
* @param src Input image to process. [const Array::Pointer &]
* @param row [int ( = 0 )]
* @param row_index [int ( = 0 )]
* @param value [float ( = 0 )]
* @return Array::Pointer
* @see https://clij.github.io/clij2-docs/reference_setRow
*
*/
auto
set_row_func(const Device::Pointer & device, const Array::Pointer & src, int row, float value) -> Array::Pointer;
set_row_func(const Device::Pointer & device, const Array::Pointer & src, int row_index, float value) -> Array::Pointer;


/**
Expand Down
12 changes: 6 additions & 6 deletions clic/include/tier3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,9 @@ generate_touch_matrix_func(const Device::Pointer & device, const Array::Pointer
* @param device Device to perform the operation on. [const Device::Pointer &]
* @param src [const Array::Pointer &]
* @param dst [Array::Pointer ( = None )]
* @param nbins [int ( = 256 )]
* @param min [float ( = None )]
* @param max [float ( = None )]
* @param num_bins [int ( = 256 )]
* @param minimum_intensity [float ( = None )]
* @param maximum_intensity [float ( = None )]
* @return Array::Pointer
*
* @see https://clij.github.io/clij2-docs/reference_histogram
Expand All @@ -248,9 +248,9 @@ auto
histogram_func(const Device::Pointer & device,
const Array::Pointer & src,
Array::Pointer dst,
int nbins,
float min = NaN,
float max = NaN) -> Array::Pointer;
int num_bins,
float minimum_intensity = NaN,
float maximum_intensity = NaN) -> Array::Pointer;


/**
Expand Down
24 changes: 13 additions & 11 deletions clic/include/tier4.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,16 @@ label_pixel_count_map_func(const Device::Pointer & device, const Array::Pointer
* @param device Device to perform the operation on. [const Device::Pointer &]
* @param src Label image where the centroids will be determined from. [const Array::Pointer &]
* @param dst Output image where the centroids will be written to. [Array::Pointer ( = None )]
* @param withBG Determines if the background label should be included. [bool ( = False )]
* @param include_background Determines if the background label should be included. [bool ( = False )]
* @return Array::Pointer
*
* @see https://clij.github.io/clij2-docs/reference_centroidsOfLabels
*/
auto
centroids_of_labels_func(const Device::Pointer & device, const Array::Pointer & src, Array::Pointer dst, bool withBG)
-> Array::Pointer;
centroids_of_labels_func(const Device::Pointer & device,
const Array::Pointer & src,
Array::Pointer dst,
bool include_background) -> Array::Pointer;


/**
Expand Down Expand Up @@ -213,8 +215,8 @@ remove_labels_with_map_values_within_range_func(const Device::Pointer & device,
* @param values_map Vector of values associated with the labels. [const Array::Pointer &]
* @param label_map_input Input image where labels will be filtered. [const Array::Pointer &]
* @param dst Output image where labels will be written to. [Array::Pointer ( = None )]
* @param min_value_range Minimum value to keep. [float ( = 0 )]
* @param max_value_range Maximum value to keep. [float ( = 100 )]
* @param minimum_value_range Minimum value to keep. [float ( = 0 )]
* @param maximum_value_range Maximum value to keep. [float ( = 100 )]
* @return Array::Pointer
*
* @note 'label processing', 'combine'
Expand All @@ -226,8 +228,8 @@ exclude_labels_with_map_values_out_of_range_func(const Device::Pointer & device,
const Array::Pointer & values_map,
const Array::Pointer & label_map_input,
Array::Pointer dst,
float min_value_range,
float max_value_range) -> Array::Pointer;
float minimum_value_range,
float maximum_value_range) -> Array::Pointer;

/**
* @name exclude_labels_with_map_values_within_range
Expand All @@ -238,8 +240,8 @@ exclude_labels_with_map_values_out_of_range_func(const Device::Pointer & device,
* @param values_map Vector of values associated with the labels. [const Array::Pointer &]
* @param label_map_input Input image where labels will be filtered. [const Array::Pointer &]
* @param dst Output image where labels will be written to. [Array::Pointer ( = None )]
* @param min_value_range Minimum value to keep. [float ( = 0 )]
* @param max_value_range Maximum value to keep. [float ( = 100 )]
* @param minimum_value_range Minimum value to keep. [float ( = 0 )]
* @param maximum_value_range Maximum value to keep. [float ( = 100 )]
* @return Array::Pointer
*
* @note 'label processing', 'combine'
Expand All @@ -251,8 +253,8 @@ exclude_labels_with_map_values_within_range_func(const Device::Pointer & device,
const Array::Pointer & values_map,
const Array::Pointer & label_map_input,
Array::Pointer dst,
float min_value_range,
float max_value_range) -> Array::Pointer;
float minimum_value_range,
float maximum_value_range) -> Array::Pointer;

/**
* @name extension_ratio_map
Expand Down
6 changes: 3 additions & 3 deletions clic/src/tier1/add_images_weighted.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ add_images_weighted_func(const Device::Pointer & device,
const Array::Pointer & src0,
const Array::Pointer & src1,
Array::Pointer dst,
float factor0,
float factor1) -> Array::Pointer
float factor1,
float factor2) -> Array::Pointer
{
tier0::create_like(src0, dst, dType::FLOAT);
const KernelInfo kernel = { "add_images_weighted", kernel::add_images_weighted };
const ParameterList params = {
{ "src0", src0 }, { "src1", src1 }, { "dst", dst }, { "scalar0", factor0 }, { "scalar1", factor1 }
{ "src0", src0 }, { "src1", src1 }, { "dst", dst }, { "scalar0", factor1 }, { "scalar1", factor2 }
};
const RangeArray range = { dst->width(), dst->height(), dst->depth() };
execute(device, kernel, params, range);
Expand Down
8 changes: 5 additions & 3 deletions clic/src/tier1/copy_horizontal_slice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ namespace cle::tier1
{

auto
copy_horizontal_slice_func(const Device::Pointer & device, const Array::Pointer & src, Array::Pointer dst, int slice)
-> Array::Pointer
copy_horizontal_slice_func(const Device::Pointer & device,
const Array::Pointer & src,
Array::Pointer dst,
int slice_index) -> Array::Pointer
{
tier0::create_like(src, dst);
const ParameterList params = { { "src", src }, { "dst", dst }, { "index", slice } };
const ParameterList params = { { "src", src }, { "dst", dst }, { "index", slice_index } };
KernelInfo kernel;
RangeArray range;
if (dst->depth() > 1)
Expand Down
4 changes: 2 additions & 2 deletions clic/src/tier1/copy_slice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ namespace cle::tier1
{

auto
copy_slice_func(const Device::Pointer & device, const Array::Pointer & src, Array::Pointer dst, int slice)
copy_slice_func(const Device::Pointer & device, const Array::Pointer & src, Array::Pointer dst, int slice_index)
-> Array::Pointer
{
tier0::create_like(src, dst);
const ParameterList params = { { "src", src }, { "dst", dst }, { "index", slice } };
const ParameterList params = { { "src", src }, { "dst", dst }, { "index", slice_index } };
KernelInfo kernel;
RangeArray range;
if (dst->depth() > 1)
Expand Down
8 changes: 5 additions & 3 deletions clic/src/tier1/copy_vertical_slice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ namespace cle::tier1
{

auto
copy_vertical_slice_func(const Device::Pointer & device, const Array::Pointer & src, Array::Pointer dst, int slice)
-> Array::Pointer
copy_vertical_slice_func(const Device::Pointer & device,
const Array::Pointer & src,
Array::Pointer dst,
int slice_index) -> Array::Pointer
{
tier0::create_like(src, dst);
const ParameterList params = { { "src", src }, { "dst", dst }, { "index", slice } };
const ParameterList params = { { "src", src }, { "dst", dst }, { "index", slice_index } };
KernelInfo kernel;
RangeArray range;
if (dst->depth() > 1)
Expand Down
Loading

0 comments on commit a599c24

Please sign in to comment.