Skip to content

illumination correction utils

Utility models for the illumination_correction task.

CLASS DESCRIPTION
ConstantCorrectionModel

Parameters for constant-based corrections.

NoCorrectionModel

Select for no correction to be applied.

ProfileCorrectionModel

Parameters for profile-based corrections.

Classes

ConstantCorrectionModel pydantic-model

Bases: BaseModel

Parameters for constant-based corrections.

Config:

  • default: {'title': 'Correction with constants'}

Fields:

Source code in fractal_tasks_core/_illumination_correction_utils.py
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.
    """

Attributes

constants pydantic-field

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 = 'Constant' pydantic-field

The correction model to be applied.

NoCorrectionModel pydantic-model

Bases: BaseModel

Select for no correction to be applied.

Config:

  • default: {'title': 'No Correction'}

Fields:

Source code in fractal_tasks_core/_illumination_correction_utils.py
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.
    """

Attributes

model = 'No Correction' pydantic-field

The correction model to be applied.

ProfileCorrectionModel pydantic-model

Bases: BaseModel

Parameters for profile-based corrections.

Config:

  • default: {'title': 'Correction with Profiles'}

Fields:

Source code in fractal_tasks_core/_illumination_correction_utils.py
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()

Attributes

folder pydantic-field

Path of folder of correction profiles.

model = 'Profile' pydantic-field

The correction model to be applied.

profiles pydantic-field

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.