Skip to content

_illumination_correction_utils

Utility models for the illumination_correction task.

ConstantCorrectionModel

Bases: BaseModel

Parameters for constant-based corrections.

Source code in fractal_tasks_core/_illumination_correction_utils.py
38
39
40
41
42
43
44
45
46
47
48
49
50
class ConstantCorrectionModel(BaseModel):
    """Parameters for constant-based corrections."""

    model_config = {"title": "Correction with constants"}
    model: Literal["Constant"] = "Constant"
    """
    The correction model to be applied.
    """
    constants: dict[str, int]
    """
    Dictionary where keys match the "wavelength_id" attributes of existing channels
    (e.g. "A01_C01") and values are the constant values to be used for correction.
    """

constants: dict[str, int] instance-attribute

Dictionary where keys match the "wavelength_id" attributes of existing channels (e.g. "A01_C01") and values are the constant values to be used for correction.

model: Literal['Constant'] = 'Constant' class-attribute instance-attribute

The correction model to be applied.

NoCorrectionModel

Bases: BaseModel

Select for no correction to be applied.

Source code in fractal_tasks_core/_illumination_correction_utils.py
53
54
55
56
57
58
59
60
class NoCorrectionModel(BaseModel):
    """Select for no correction to be applied."""

    model_config = {"title": "No Correction"}
    model: Literal["No Correction"] = "No Correction"
    """
    The correction model to be applied.
    """

model: Literal['No Correction'] = 'No Correction' class-attribute instance-attribute

The correction model to be applied.

ProfileCorrectionModel

Bases: BaseModel

Parameters for profile-based corrections.

Source code in fractal_tasks_core/_illumination_correction_utils.py
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
class ProfileCorrectionModel(BaseModel):
    """Parameters for profile-based corrections."""

    model_config = {"title": "Correction with Profiles"}
    model: Literal["Profile"] = "Profile"
    """
    The correction model to be applied.
    """
    folder: str
    """
    Path of folder of correction profiles.
    """
    profiles: dict[str, str]
    """
    Dictionary where keys match the "wavelength_id" attributes of existing channels
    (e.g. "A01_C01") and values are the filenames of the corresponding
    correction profiles.
    """

    def items(
        self,
    ) -> Iterator[tuple[str, str],]:
        root_path = Path(self.folder)
        for wavelength_id, profile_name in self.profiles.items():
            yield wavelength_id, (root_path / profile_name).as_posix()

folder: str instance-attribute

Path of folder of correction profiles.

model: Literal['Profile'] = 'Profile' class-attribute instance-attribute

The correction model to be applied.

profiles: dict[str, str] instance-attribute

Dictionary where keys match the "wavelength_id" attributes of existing channels (e.g. "A01_C01") and values are the filenames of the corresponding correction profiles.