Signal conversion models (darsia.signals.models)#
Models for the transformation of signals, e.g., to physical data.
Submodules#
darsia.signals.models.basemodel module#
Module containing abstract Model. Models convert signals to data.
- class HeterogeneousModel(obj, labels, ignore_labels=None)[source]#
Bases:
Model- abstractmethod calibrate()#
Calibration routine of model.
- abstractmethod update_model_parameters(parameters, dofs=None)#
Update routine of model parameters.
- ignore_labels#
Labels to ignore for signals.
- masks#
Masks for each label in the image.
- obj#
Dictionary of models for each label.
darsia.signals.models.binarydataselector module#
Module containing several utils operating on binary signals.
- class BinaryDataSelector(criterion=None, key='', **kwargs)[source]#
Bases:
objectData selector acting on criteria, both volume and contour based.
- class CombinedCriterion(criteria)[source]#
Bases:
BaseCriterionGeneral combination of criteria, provided as list.
- class GradientModulusCriterion(threshold=None, key='', **kwargs)[source]#
Bases:
BaseCriterionCriterion checking for absolute maximal value of the gradient modulus of the signal.
- class RelativeValueCriterion(threshold)[source]#
Bases:
BaseCriterionCriterion checking for relative maximal values.
- bind(signal, unprocessed_signal)#
Binding routine, allowing to fix and prepare.
- Parameters:
signal (np.ndarray) – processed signal
unprocessed_signal (np.ndarray) – unprocessed signal
- class TransformedValueCriterion(transformation, threshold)[source]#
Bases:
BaseCriterionCriterion checking for absolute maximal values in a transformed version of the unprocessed signal.
- class ValueCriterion(threshold)[source]#
Bases:
BaseCriterionCriterion checking for absolute maximal values.
- bind(signal, unprocessed_signal)#
Binding routine, allowing to fix and prepare.
- Parameters:
signal (np.ndarray) – processed signal
unprocessed_signal (np.ndarray) – unprocessed signal
darsia.signals.models.clipmodel module#
Module containing clipping operations.
- class ClipModel(min_value=None, max_value=None, key=None, **kwargs)[source]#
Bases:
ModelModel clipping away signal at some min and max values.
- abstractmethod calibrate()#
Calibration routine of model.
darsia.signals.models.combinedmodel module#
Combination of models.
NOTE: Combining models is experimental and the responsibility lies with the user.
darsia.signals.models.dynamicthresholdmodel module#
Module containing dynamic thresholding models.
- class DynamicThresholdModel(method=None, threshold_lower=None, threshold_upper=None, labels=None, key='', **kwargs)[source]#
Bases:
StaticThresholdModelClass for dynamic thresholding.
- update_model_parameters(*args)#
- class GlobalMinTwoPeakHistogrammAnalysis[source]#
Bases:
TwoPeakHistogrammAnalysisClass defining a two peak analysis for dynamically determining a threshold parameter used on a global minimum analysis of the signal histogram.
- class OtsuTwoPeakHistogrammAnalysis[source]#
Bases:
TwoPeakHistogrammAnalysisClass defining a two peak analysis for dynamically determining a threshold parameter used on a Otsu analysis of the signal histogram.
- class StandardOtsu[source]#
Bases:
HistogrammBasedThresholdingWrapper for standard Otsu thresholding.
- class TwoPeakHistogrammAnalysis[source]#
Bases:
HistogrammBasedThresholdingClass for histogramm analysis aiming at separating two signal peaks.
darsia.signals.models.linearmodel module#
Module containing a linear (affine) conversion from signals to data.
- class HeterogeneousLinearModel(labels, key='', **kwargs)[source]#
Bases:
ModelLinear model, applying an affine conversion for signals to data.
- abstractmethod calibrate()#
Calibration routine of model.
- class LinearModel(key='', **kwargs)[source]#
Bases:
ModelLinear model, applying an affine conversion for signals to data.
- abstractmethod calibrate()#
Calibration routine of model.
darsia.signals.models.staticthresholdmodel module#
Module converting signals to binary data by applying thresholding.
A distinction between heterogeneous and homogeneous thresholding is performed automatically.
darsia.signals.models.thresholdmodel module#
Organizer of various thresholding methods.
- class ThresholdModel(labels=None, key='', **kwargs)[source]#
Bases:
objectManager of available thresholding models.
Example: options = {
“example threshold dynamic”: False, “example threshold value”: 0.2,
} static_threshold_model = darsia.ThresholdModel(key = “example “, **options) mask = static_threshold_model(img)