IDS peak ICV v1.2.0
Loading...
Searching...
No Matches
ifeature.py
Go to the documentation of this file.
1from __future__ import annotations
2
3from abc import ABC, abstractmethod
4
5
6class IFeature(ABC):
7 """!
8 @brief
9 Abstract base class for all image processing pipeline features.
10
11 IFeature defines the common interface that all pipeline features must implement.
12 Features represent configurable image processing operations that can be enabled
13 or disabled within an image processing pipeline.
14
15 Each feature provides:
16 - Enable/disable functionality through the `enabled` property
17 - Reset capability to restore default settings via `reset_to_default()`
18 - Feature-specific configuration methods (implemented in derived classes)
19
20 Features are typically used within a pipeline context where they can be
21 selectively enabled or disabled to customize the image processing workflow.
22 When a feature is disabled, it has no effect on the processed image.
23
24 Notes:
25 - All derived classes must implement the three abstract methods:
26 `enabled` (getter/setter) and `reset_to_default`.
27 - The enabled state is independent of the feature's configuration.
28 Calling `reset_to_default()` will reset the feature's parameters
29 to their default values but will not change the enabled/disabled state.
30
31 ```python
32 # Assuming we have a concrete feature implementation
33 feature = SomeConcreteFeature()
34 # Enable the feature
35 feature.enabled = True
36 # Check if enabled
37 if feature.enabled:
38 # Feature will be applied during processing
39 pass
40 # Reset to default configuration (but keep enabled state)
41 feature.reset_to_default()
42 ```
43
44 @since ids_peak_icv 1.0
45 @ingroup ids_peak_icv_python_pipeline_features
46 """
47
48 @property
49 @abstractmethod
50 def enabled(self) -> bool:
51 """!
52 @brief
53 Indicates whether the feature is currently enabled.
54
55 @return True if enabled; otherwise False.
56
57 @since ids_peak_icv 1.0
58 """
59 pass
60
61 @enabled.setter
62 @abstractmethod
63 def enabled(self, value: bool) -> None:
64 """!
65 @brief
66 Enables or disables the feature.
67 @param value: Set to True to enable the feature, or False to disable it.
68
69 @since ids_peak_icv 1.0
70 """
71 pass
72
73 @abstractmethod
74 def reset_to_default(self) -> None:
75 """!
76 @brief
77 Restores the feature's default values.
78 The enabled state does not change when calling this function.
79
80 @since ids_peak_icv 1.0
81 """
82 pass
Abstract base class for all image processing pipeline features.
Definition ifeature.py:6
None reset_to_default(self)
Restores the feature's default values.
Definition ifeature.py:74
bool enabled(self)
Indicates whether the feature is currently enabled.
Definition ifeature.py:50