Analysis managers (darsia.manager)#
The object-oriented coding style of DarSIA enables the use of workflows for the analysis of tracer and CO2 concentrations in (optical) images. For this, interface functionlity is encoded in the data analysis tools mainly targeting concentration analyses.
Submodules#
darsia.manager.analysisbase module#
Module providing structures for common analyses.
In practice, such may have to be tailored to the specific scenario. Yet, they already provide many of the most relevant functionalities. If not applicable, they also provide the approach for how to set up tailored analysis classes.
- class AnalysisBase(baseline, config, update_setup=False)[source]#
Bases:
objectStandard setup for an image analysis, in particular useful when analyzing a larger set of images in a time series.
- batch_analysis(images, **kwargs)[source]#
Standard batch analysis.
- Parameters:
images (list of Path) – paths to batch of images.
kwargs – optional keyword arguments used in single_image_analysis.
- load_and_process_image(path)[source]#
Load image for further analysis. Do all corrections and processing needed.
- Parameters:
path (str or Path) – path to image
- Returns:
processed image
- Return type:
darsia.Image
- single_image_analysis(img, **kwargs)[source]#
Standard workflow to analyze CO2 phases.
- Parameters:
image (Path or Image) – path to single image.
kwargs – optional keyword arguments
- color_correction#
Color correction based on reference colors.
- config#
Config dict from file.
- curvature_correction#
Curvature correction.
- deformation_correction#
Local deformation correction wrt. baseline image.
- drift_corrected_base#
Baseline image corrected for drift only.
- drift_correction#
Drift correction wrt. baseline image.
- height#
Physical height of image.
- origin#
Physical origin of origin voxel.
- processed_baseline_images#
List of corrected baseline images.
- translation_correction#
Translation correction based on fixed absolute translation.
- uncorrected_base#
Baseline image stored as physical image but without corrections.
- width#
Physical width of image.
darsia.manager.co2analysis module#
Structure for analyzing images of multi-component multi-phase experiments.
The goal of such analysis is to identify distinct components/phases. In practice, it may have to be tailored to the specific scenario by inheritance. For more general use, a generalized multicomponent analysis manager should be used. This module is tailored to CO2 experiments in water, strongly motivated by the International FluidFlower Benchmark study.
- class CO2Analysis(baseline, config, update_setup=False)[source]#
Bases:
ABC,ConcentrationAnalysisBaseGeneral setup for an image analysis of time series aiming at analyzing CO2 evolution. This class inherits from darsia.TracerAnalysis.
- batch_analysis(images, **kwargs)#
Standard batch analysis.
- Parameters:
images (list of Path) – paths to batch of images.
kwargs – optional keyword arguments used in single_image_analysis.
- abstractmethod define_co2_analysis()[source]#
Empty method which should define self.co2_analysis of type darsia.ConcentrationAnalysis.
- abstractmethod define_co2_gas_analysis()[source]#
Empty method which should define self.co2_gas_analysis of type darsia.ConcentrationAnalysis.
- determine_co2()[source]#
Extract CO2 from currently loaded image, based on a reference image.
- Returns:
binary image of spatial CO2 distribution.
- Return type:
darsia.Image
- determine_co2_gas()[source]#
Extract CO2(g) from currently loaded image, based on a reference image.
- Returns:
binary image of spatial CO2(g) distribution.
- Return type:
darsia.Image
- load_and_process_image(path)#
Load image for further analysis. Do all corrections and processing needed.
- Parameters:
path (str or Path) – path to image
- Returns:
processed image
- Return type:
darsia.Image
- single_image_analysis(img, **kwargs)#
Standard workflow to analyze CO2 phases.
- Parameters:
image (Path or Image) – path to single image.
kwargs – optional keyword arguments
- color_correction#
Color correction based on reference colors.
- config#
Config dict from file.
- curvature_correction#
Curvature correction.
- deformation_correction#
Local deformation correction wrt. baseline image.
- drift_corrected_base#
Baseline image corrected for drift only.
- drift_correction#
Drift correction wrt. baseline image.
- height#
Physical height of image.
- origin#
Physical origin of origin voxel.
- processed_baseline_images#
List of corrected baseline images.
- reference_date#
- translation_correction#
Translation correction based on fixed absolute translation.
- uncorrected_base#
Baseline image stored as physical image but without corrections.
- width#
Physical width of image.
darsia.manager.concentrationanalysisbase module#
Module providing structures for any general concentration analysis.
This include tracer, co2, multicomponent, etc. analyses. The resulting class is abstract and needs to be tailored to the specific situation by inheritance.
- class ConcentrationAnalysisBase(baseline, config, update_setup=False)[source]#
Bases:
AnalysisBaseBase analysis class providing general tools to perform analysis based on darsia.ConcentrationAnalysis (and children).
- batch_analysis(images, **kwargs)#
Standard batch analysis.
- Parameters:
images (list of Path) – paths to batch of images.
kwargs – optional keyword arguments used in single_image_analysis.
- load_and_process_image(path)#
Load image for further analysis. Do all corrections and processing needed.
- Parameters:
path (str or Path) – path to image
- Returns:
processed image
- Return type:
darsia.Image
- single_image_analysis(img, **kwargs)#
Standard workflow to analyze CO2 phases.
- Parameters:
image (Path or Image) – path to single image.
kwargs – optional keyword arguments
- color_correction#
Color correction based on reference colors.
- config#
Config dict from file.
- curvature_correction#
Curvature correction.
- deformation_correction#
Local deformation correction wrt. baseline image.
- drift_corrected_base#
Baseline image corrected for drift only.
- drift_correction#
Drift correction wrt. baseline image.
- height#
Physical height of image.
- origin#
Physical origin of origin voxel.
- processed_baseline_images#
List of corrected baseline images.
- reference_date#
- translation_correction#
Translation correction based on fixed absolute translation.
- uncorrected_base#
Baseline image stored as physical image but without corrections.
- width#
Physical width of image.
darsia.manager.traceranalysis module#
Module providing structures for tracer analysis.
The resulting class is abstract and needs to be tailored to the specific situation by inheritance.
- class TracerAnalysis(baseline, config, update_setup=False)[source]#
Bases:
ABC,ConcentrationAnalysisBase- batch_analysis(images, **kwargs)#
Standard batch analysis.
- Parameters:
images (list of Path) – paths to batch of images.
kwargs – optional keyword arguments used in single_image_analysis.
- abstractmethod define_tracer_analysis()[source]#
The main purpose of this routine is to define self.tracer_analysis, which lies at the heart of this class. It is supposed to determine tracers from image differences. Since the choice of a suitable color channel etc. may heavily depend on the situation, this method is abstract and has to be overwritten in each specific situation.
- determine_tracer(return_volume=False)[source]#
Extract tracer from currently loaded image, based on a reference image.
- Parameters:
return_volume (bool) – flag controlling whether the volume of the fluid in the porous geometry is returned.
- Returns:
image array of spatial concentration map float, optional: occupied volume by the fluid in porous geometry
- Return type:
darsia.Image
- load_and_process_image(path)#
Load image for further analysis. Do all corrections and processing needed.
- Parameters:
path (str or Path) – path to image
- Returns:
processed image
- Return type:
darsia.Image
- single_image_analysis(img, **kwargs)#
Standard workflow to analyze CO2 phases.
- Parameters:
image (Path or Image) – path to single image.
kwargs – optional keyword arguments
- color_correction#
Color correction based on reference colors.
- config#
Config dict from file.
- curvature_correction#
Curvature correction.
- deformation_correction#
Local deformation correction wrt. baseline image.
- drift_corrected_base#
Baseline image corrected for drift only.
- drift_correction#
Drift correction wrt. baseline image.
- height#
Physical height of image.
- origin#
Physical origin of origin voxel.
- processed_baseline_images#
List of corrected baseline images.
- reference_date#
- translation_correction#
Translation correction based on fixed absolute translation.
- uncorrected_base#
Baseline image stored as physical image but without corrections.
- width#
Physical width of image.