Skip to content

Configuring an image¤

The AbstractImageConfig is an object at the core of simulating images in cryojax. It stores a configuration for the simulated image and the electron microscope, such as the shape of the desired image and the wavelength of the incident electron beam.

cryojax.simulator.AbstractImageConfig

cryojax.simulator.AbstractImageConfig ¤

Configuration and utilities for an electron microscopy image.

__abstractclassvars__ class ¤
__abstractclassvars__

frozenset() -> empty frozenset object frozenset(iterable) -> frozenset object

Build an immutable unordered collection of unique elements.

__abstractmethods__ class ¤
__abstractmethods__

frozenset() -> empty frozenset object frozenset(iterable) -> frozenset object

Build an immutable unordered collection of unique elements.

__abstractvars__ class ¤
__abstractvars__

frozenset() -> empty frozenset object frozenset(iterable) -> frozenset object

Build an immutable unordered collection of unique elements.

__annotations__ class ¤
__annotations__

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)

__dataclass_fields__ class ¤
__dataclass_fields__

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)

__dataclass_params__ class ¤
__dataclass_params__
__doc__ class ¤
__doc__

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

__match_args__ class ¤
__match_args__

Built-in immutable sequence.

If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable's items.

If the argument is a tuple, the return value is the same object.

__module__ class ¤
__module__

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

coordinate_grid_in_angstroms cached property ¤
coordinate_grid_in_angstroms: Float[Array, '{self.y_dim} {self.x_dim} 2']

Convenience property for pixel_size * coordinate_grid_in_pixels

coordinate_grid_in_pixels cached property ¤
coordinate_grid_in_pixels: Float[Array, '{self.y_dim} {self.x_dim} 2']

A spatial coordinate system for the shape.

frequency_grid_in_angstroms cached property ¤
frequency_grid_in_angstroms: Float[Array, '{self.y_dim} {self.x_dim//2+1} 2']

Convenience property for frequency_grid_in_pixels / pixel_size

frequency_grid_in_pixels cached property ¤
frequency_grid_in_pixels: Float[Array, '{self.y_dim} {self.x_dim//2+1} 2']

A spatial frequency coordinate system for the shape, with hermitian symmetry.

full_frequency_grid_in_angstroms cached property ¤
full_frequency_grid_in_angstroms: Float[Array, '{self.y_dim} {self.x_dim} 2']

Convenience property for full_frequency_grid_in_pixels / pixel_size

full_frequency_grid_in_pixels cached property ¤
full_frequency_grid_in_pixels: Float[Array, '{self.y_dim} {self.x_dim} 2']

A spatial frequency coordinate system for the shape, without hermitian symmetry.

interaction_constant property ¤
interaction_constant

The electron interaction constant at the given voltage_in_kilovolts.

lorentz_factor property ¤
lorentz_factor

The lorenz factor at the given voltage_in_kilovolts.

n_pixels property ¤
n_pixels

Convenience property for math.prod(shape)

padded_coordinate_grid_in_angstroms cached property ¤
padded_coordinate_grid_in_angstroms: Float[Array, '{self.padded_y_dim} {self.padded_x_dim} 2']

Convenience property for pixel_size * padded_coordinate_grid_in_pixels

padded_coordinate_grid_in_pixels cached property ¤
padded_coordinate_grid_in_pixels: Float[Array, '{self.padded_y_dim} {self.padded_x_dim} 2']

A spatial coordinate system for the padded_shape.

padded_frequency_grid_in_angstroms cached property ¤
padded_frequency_grid_in_angstroms: Float[Array, '{self.padded_y_dim} {self.padded_x_dim//2+1} 2']

Convenience property for padded_frequency_grid_in_pixels / pixel_size

padded_frequency_grid_in_pixels cached property ¤
padded_frequency_grid_in_pixels: Float[Array, '{self.padded_y_dim} {self.padded_x_dim//2+1} 2']

A spatial frequency coordinate system for the padded_shape, with hermitian symmetry.

padded_full_frequency_grid_in_angstroms cached property ¤
padded_full_frequency_grid_in_angstroms: Float[Array, '{self.padded_y_dim} {self.padded_x_dim} 2']

Convenience property for padded_full_frequency_grid_in_pixels / pixel_size

padded_full_frequency_grid_in_pixels cached property ¤
padded_full_frequency_grid_in_pixels: Float[Array, '{self.padded_y_dim} {self.padded_x_dim} 2']

A spatial frequency coordinate system for the padded_shape, without hermitian symmetry.

padded_n_pixels property ¤
padded_n_pixels

Convenience property for math.prod(padded_shape)

padded_shape property ¤
padded_shape
padded_x_dim property ¤
padded_x_dim

Convenience property for padded_shape[1]

padded_y_dim property ¤
padded_y_dim

Convenience property for padded_shape[0]

wavelength_in_angstroms property ¤
wavelength_in_angstroms

The incident electron wavelength corresponding to the beam energy voltage_in_kilovolts.

x_dim property ¤
x_dim

Convenience property for shape[1]

y_dim property ¤
y_dim

Convenience property for shape[0]

__check_init__ ¤
__check_init__()
__init__ ¤
__init__()

Initialize self. See help(type(self)) for accurate signature.


cryojax.simulator.BasicImageConfig(cryojax.simulator.AbstractImageConfig) ¤

Configuration and utilities for a basic electron microscopy image.

__init__ ¤
__init__(shape: tuple[int, int], pixel_size: cryojax.jax_util.FloatLike, voltage_in_kilovolts: cryojax.jax_util.FloatLike, *, grid_helper: cryojax.simulator.GridHelper | None = None, pad_options: dict[str, Any] = {})

Arguments:

  • shape: Shape of the imaging plane in pixels.
  • pixel_size: The pixel size of the image in angstroms.
  • voltage_in_kilovolts: The incident energy of the electron beam.
  • grid_helper: The GridHelper object, which stores the coordinate grids for image shape shape. If not passed, grid are computed at run-time.
  • pad_options: Options that control image padding.
    • shape: The shape of the image after padding. By default, equal to shape.
    • grid_helper: The GridHelper object, which stores coordinate grids for the padded shape. If not passed, grid are computed at run-time. By default, equal to None.

cryojax.simulator.DoseImageConfig(cryojax.simulator.AbstractImageConfig) ¤

Configuration and utilities for an electron microscopy image, including the electron dose.

__init__ ¤
__init__(shape: tuple[int, int], pixel_size: cryojax.jax_util.FloatLike, voltage_in_kilovolts: cryojax.jax_util.FloatLike, electron_dose: cryojax.jax_util.FloatLike, *, grid_helper: cryojax.simulator.GridHelper | None = None, pad_options: dict[str, Any] = {})

Arguments:

  • shape: Shape of the imaging plane in pixels.
  • pixel_size: The pixel size of the image in angstroms.
  • voltage_in_kilovolts: The incident energy of the electron beam.
  • electron_dose: The integrated dose rate of the electron beam in \(e^-/A^2\)
  • grid_helper: The GridHelper object, which stores the coordinate grids for image shape shape. If not passed, grid are computed at run-time.
  • pad_options: Options that control image padding.
    • shape: The shape of the image after padding. By default, equal to shape.
    • grid_helper: The GridHelper object, which stores coordinate grids for the padded shape. If not passed, grid are computed at run-time. By default, equal to None.

cryojax.simulator.GridHelper ¤

GridHelper(shape: tuple[int, int], only_rfft: bool = True)

__init__ ¤
__init__(shape: tuple[int, int], only_rfft: bool = True)