Skip to content

optics_group

Microscope optics group model for micrograph parameters.

OpticsGroup

Bases: BaseModel2DTM

Stores optics group parameters for the imaging system on a microscope.

Currently utilizes the minimal set of parameters for calculating a contrast transfer function (CTF) for a given optics group. Other parameters for future use are included but currently unused.

Attributes:

Name Type Description
label str

Unique string (among other optics groups) for the optics group.

pixel_size float

Pixel size in Angstrom.

voltage float

Voltage in kV.

spherical_aberration float

Spherical aberration in mm. Default is 2.7.

amplitude_contrast_ratio float

Amplitude contrast ratio as a unitless percentage in [0, 1]. Default is 0.07.

phase_shift float

Additional phase shift of the contrast transfer function in degrees. Default is 0.0 degrees.

defocus_u float

Defocus (underfocus) along the major axis in Angstrom.

defocus_v float

Defocus (underfocus) along the minor axis in Angstrom.

astigmatism_angle float

Angle of defocus astigmatism relative to the X-axis in degrees.

ctf_B_factor float

B-factor to apply in the contrast transfer function in A^2. Default is 0.0.

Unused Attributes:

chromatic_aberration : float Chromatic aberration in mm. Default is ???. mtf_reference : str | PathLike Path to MTF reference file. mtf_values : list[float] list of modulation transfer functions values on evenly spaced resolution grid [0.0, ..., 0.5]. beam_tilt_x : float Beam tilt X in mrad. beam_tilt_y : float Beam tilt Y in mrad. odd_zernike : list[float] list of odd Zernike moments. even_zernike : list[float] list of even Zernike moments. zernike_moments : list[float] list of Zernike moments.

Methods:

Name Description
model_dump

Returns a dictionary of the model parameters.

Source code in src/leopard_em/pydantic_models/data_structures/optics_group.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
class OpticsGroup(BaseModel2DTM):
    """Stores optics group parameters for the imaging system on a microscope.

    Currently utilizes the minimal set of parameters for calculating a
    contrast transfer function (CTF) for a given optics group. Other parameters
    for future use are included but currently unused.

    Attributes
    ----------
    label : str
        Unique string (among other optics groups) for the optics group.
    pixel_size : float
        Pixel size in Angstrom.
    voltage : float
        Voltage in kV.
    spherical_aberration : float
        Spherical aberration in mm. Default is 2.7.
    amplitude_contrast_ratio : float
        Amplitude contrast ratio as a unitless percentage in [0, 1]. Default
        is 0.07.
    phase_shift : float
        Additional phase shift of the contrast transfer function in degrees.
        Default is 0.0 degrees.
    defocus_u : float
        Defocus (underfocus) along the major axis in Angstrom.
    defocus_v : float
        Defocus (underfocus) along the minor axis in Angstrom.
    astigmatism_angle : float
        Angle of defocus astigmatism relative to the X-axis in degrees.
    ctf_B_factor : float
        B-factor to apply in the contrast transfer function in A^2. Default
        is 0.0.

    Unused Attributes:
    ------------------
    chromatic_aberration : float
        Chromatic aberration in mm. Default is ???.
    mtf_reference : str | PathLike
        Path to MTF reference file.
    mtf_values : list[float]
        list of modulation transfer functions values on evenly spaced
        resolution grid [0.0, ..., 0.5].
    beam_tilt_x : float
        Beam tilt X in mrad.
    beam_tilt_y : float
        Beam tilt Y in mrad.
    odd_zernike : list[float]
        list of odd Zernike moments.
    even_zernike : list[float]
        list of even Zernike moments.
    zernike_moments : list[float]
        list of Zernike moments.

    Methods
    -------
    model_dump()
        Returns a dictionary of the model parameters.
    """

    # Currently implemented parameters
    label: str
    pixel_size: Annotated[float, Field(ge=0.0)]
    voltage: Annotated[float, Field(ge=0.0)]
    spherical_aberration: Annotated[float, Field(ge=0.0, default=2.7)] = 2.7
    amplitude_contrast_ratio: Annotated[float, Field(ge=0.0, le=1.0, default=0.07)] = (
        0.07
    )
    phase_shift: Annotated[float, Field(default=0.0)] = 0.0
    defocus_u: float
    defocus_v: float
    astigmatism_angle: float
    ctf_B_factor: Annotated[float, Field(ge=0.0, default=0.0)] = 0.0

    chromatic_aberration: Optional[Annotated[float, Field(ge=0.0)]] = 0.0
    mtf_reference: Optional[Union[str, PathLike]] = None
    mtf_values: Optional[list[float]] = None
    beam_tilt_x: Optional[float] = None
    beam_tilt_y: Optional[float] = None
    odd_zernike: Optional[list[float]] = None
    even_zernike: Optional[list[float]] = None
    zernike_moments: Optional[list[float]] = None