darsia.ConcentrationAnalysis#
- class ConcentrationAnalysis(base=None, signal_reduction=None, balancing=None, restoration=None, model=None, labels=None, **kwargs)[source]#
Bases:
objectClass providing the capabilities to determine concentration/saturation profiles based on image comparison, and interpretation of intensity maps.
Set up a concentration analysis.
Each processing stage defaults to the identity when its argument is None.
- Parameters:
- base
darsia.Imageorlistofdarsia.Image,optional Baseline image(s); several images define a cleaning filter. The analysis refers to the data of the (first) baseline instead of copying them, and never modifies them; they must not be modified in place while the analysis is in use. Replacing the data of the given image (base.img = …) does not affect the analysis.
- signal_reduction
darsia.SignalReduction,optional Reduction from multi-channel to scalar data.
- balancing
darsia.Model,optional Operator balancing the signal, e.g. across facies.
- restoration
darsia.TVD,optional Regulariser applied to the scalar signal.
- model
darsia.Model,optional Conversion of the signal to a physical quantity.
- labels
darsia.Image,optional Labelled image of the domain; None means a homogeneous medium.
- **kwargs
Tuning parameters:
"diff option" "positive" | "negative" | "absolute" | "plain" (how image differences are formed) "restoration -> model" if True, restoration runs before the model conversion "verbosity" 0 (none) | 1 (final only) | 2 (all intermediate results)
- base
Methods
find_cleaning_filter([baseline_images])Determine structural noise by studying a series of baseline images.
is_plain()Whether the analysis only subtracts the baseline, applies the model and then the restoration.
Read cleaning filter from file.
update([base, mask])Update of the baseline image or parameters.
write_cleaning_filter_to_file(path_to_filter)Store cleaning filter to file.
Attributes
Baseline image.
Reduction to scalar signal.
Balancing for heterogeneous signals.
Signal to data conversion model.
Restoration model.
Indicator for heterogeneous image.
Option for defining order of routines.
Mask.
Fetch verbosity.
- find_cleaning_filter(baseline_images=None)[source]#
Determine structural noise by studying a series of baseline images. The resulting cleaning filter will be used prior to the conversion of signal to concentration. The cleaning filter should be understood as thresholding mask.
- Parameters:
- baseline_images
listofimages Series of baseline_images; default: use internally available baseline images.
- baseline_images
- is_plain()[source]#
Whether the analysis only subtracts the baseline, applies the model and then the restoration.
Compiled single-pass evaluations of an analysis (e.g. in HeterogeneousColorToMassAnalysis) rely on this and replace __call__ for a plain analysis. NOTE: Any new option which changes the result of __call__ must be excluded here.
- Returns:
- bool
True if no other step of __call__ is active (difference option “plain”, no signal reduction, cleaning filter, balancing or inspection, and the restoration after the model), for this class itself (not a subclass).
- read_cleaning_filter_from_file(path)[source]#
Read cleaning filter from file.
- Parameters:
- path
strorPath Path to cleaning filter array.
- path
- update(base=None, mask=None)[source]#
Update of the baseline image or parameters.
- Parameters:
- base
Image,optional Image array.
- mask
np.ndarray,optional Boolean mask, detecting which pixels will be considered, all other will be ignored in the analysis.
- base
- write_cleaning_filter_to_file(path_to_filter)[source]#
Store cleaning filter to file.
- Parameters:
- path_to_filter
strorPath Path for storage of the cleaning filter.
- path_to_filter
- balancing#
Balancing for heterogeneous signals.
- base#
Baseline image.
- first_restoration_then_model#
Option for defining order of routines.
- labels#
Indicator for heterogeneous image.
- mask#
Mask.
- model#
Signal to data conversion model.
- restoration#
Restoration model.
- signal_reduction#
Reduction to scalar signal.
- verbosity#
Fetch verbosity. With increasing number, more intermediate results are displayed. Useful for parameter tuning.