1from __future__
import annotations
5from ids_peak_common.datatypes.interval
import Interval
14 Mode parameter for the binning algorithm.
16 The enum holding the possible modes.
18 @since ids_peak_icv 1.0
19 @ingroup ids_peak_icv_python_pipeline_types
25 The averaged pixel values of neighboring rows and/or columns are computed during binning.
27 @since ids_peak_icv 1.0
33 The pixel values of neighboring rows and/or columns are summed during binning.
35 @since ids_peak_icv 1.0
42 Binning is used to decrease the image size.
44 @supportedPixelformats{ImageTransformation}
46 This method reduces resolution by summarizing or averaging groups of pixels
47 in the horizontal (x) and/or vertical (y) directions.
48 It helps preserve image quality by minimizing aliasing artifacts.
50 @note Processes the entire image, ignoring any specified image region.
52 @note The alpha channel of the input image (if present) is also ignored.
53 This is because the alpha channel can have different interpretations
54 — such as transparency, segmentation labels, or masks —
55 each of which would require different handling during binning.
56 Consequently, the alpha channel of the output image is always set to the maximum possible pixel value.
58 @note Binning permanently reduces image resolution. The original resolution cannot be recovered
59 after binning is applied.
61 Default configuration:
64 - BinningMode.BinningAverage
66 @since ids_peak_icv 1.0
67 @ingroup ids_peak_icv_python_pipeline_features
70 def __init__(self, module: DownsamplingModule) ->
None:
73 Creates a BinningFeature for an existing downsampling module.
75 @param module: Reference to the underlying DownsamplingModule.
77 @since ids_peak_icv 1.0
85 Gets whether this feature is currently enabled.
87 @return True if enabled; otherwise False.
89 @since ids_peak_icv 1.0
97 Enables or disables the feature.
99 @param enabled: True to enable, False to disable.
101 @since ids_peak_icv 1.0
108 Resets all settings to their defaults.
110 Default configuration:
113 - mode = BinningMode.BinningAverage
115 @note The enabled state does not change when calling this function.
117 @since ids_peak_icv 1.0
125 Gets the current number of columns used for binning.
127 @return The current number of columns summarized/averaged during binning.
129 @since ids_peak_icv 1.0
134 def x(self, value: int) ->
None:
137 Sets the number of columns used for binning.
139 @param value: An integer value representing the number of columns summarized/averaged during binning.
140 Valid values are within the range returned by object.range.
141 @exception OutOfRangeException: If value is outside the valid range.
143 @since ids_peak_icv 1.0
151 Gets the current number of rows used for binning.
153 @return The current number of rows summarized/averaged during binning.
155 @since ids_peak_icv 1.0
160 def y(self, value: int) ->
None:
163 Sets the number of rows used for binning.
165 @param value: An integer value representing the number of rows summarized/averaged during binning.
166 Valid values are within the range returned by object.range.
167 @exception OutOfRangeException: If value is outside the valid range.
169 @since ids_peak_icv 1.0
177 Gets the current BinningMode.
179 @return The current BinningMode.
181 @since ids_peak_icv 1.0
186 def mode(self, value: BinningMode) ->
None:
189 Sets the BinningMode.
191 @param value: The BinningMode to set.
193 @since ids_peak_icv 1.0
201 Gets the valid range for the binning factors x and y.
203 The returned interval specifies the minimum and maximum values that can be passed to object.x or object.y.
205 @return An Interval representing the valid binning factor range.
207 @since ids_peak_icv 1.0
Mode parameter for the downsampling algorithm.
Binning is used to decrease the image size.
None reset_to_default(self)
Resets all settings to their defaults.
None __init__(self, DownsamplingModule module)
Creates a BinningFeature for an existing downsampling module.
int y(self)
Gets the current number of rows used for binning.
bool enabled(self)
Gets whether this feature is currently enabled.
int x(self)
Gets the current number of columns used for binning.
Interval range(self)
Gets the valid range for the binning factors x and y.
BinningMode mode(self)
Gets the current BinningMode.
Mode parameter for the binning algorithm.
Abstract base class for all image processing pipeline features.