darsia.presets.workflows.analysis.analysis_context.prepare_analysis_context#

prepare_analysis_context(cls, path, all=False, require_color_to_mass=False, section='analysis', require_results=True, require_data=True, sub_config=None)[source]#

Prepare common analysis context.

This function initializes all shared objects needed for analysis workflows. Restoration is always built from the config (if a [restoration] section is present) so it is available to all analysis workflows. When require_color_to_mass is True, the color_to_mass_analysis pipeline is also initialized and receives the restoration object.

Parameters:
clstype[Rig]

Rig class.

pathPath or list of Path

Path(s) to config files.

allbool, optional

Use all images. Default False.

require_color_to_massbool, optional

Initialise the colour-to-mass pipeline. Default False.

section{“analysis”, “calibration”, “helper”}, optional

Config section used for validation and default image selection. When sub_config is given, section still controls the validation path but the sub-config is not taken from the section. Default "analysis".

require_resultsbool, optional

Require results paths in the config. Default True.

require_databool, optional

Require data paths in the config. Default True.

sub_configAny, optional

Config object passed to image selection directly (e.g. config.analysis, config.calibration, config.helper, config.helper.color).

Returns:
AnalysisContext

Context with all common objects initialised.