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 ¤

Configuration and utilities for an electron microscopy image.

wavelength_in_angstroms property ¤

The incident electron wavelength corresponding to the beam energy voltage_in_kilovolts.

wavenumber_in_inverse_angstroms property ¤

The incident electron wavenumber corresponding to the beam energy voltage_in_kilovolts.

lorentz_factor property ¤

The lorenz factor at the given voltage_in_kilovolts.

interaction_constant property ¤

The electron interaction constant at the given voltage_in_kilovolts.

n_pixels property ¤

Convenience property for math.prod(shape)

y_dim property ¤

Convenience property for shape[0]

x_dim property ¤

Convenience property for shape[1]

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

A spatial coordinate system for the shape.

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

Convenience property for pixel_size * coordinate_grid_in_pixels

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

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

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

Convenience property for frequency_grid_in_pixels / pixel_size

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

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

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

Convenience property for full_frequency_grid_in_pixels / pixel_size

padded_n_pixels property ¤

Convenience property for math.prod(padded_shape)

padded_y_dim property ¤

Convenience property for padded_shape[0]

padded_x_dim property ¤

Convenience property for padded_shape[1]

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

A spatial coordinate system for the padded_shape.

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

Convenience property for pixel_size * padded_coordinate_grid_in_pixels

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

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

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

Convenience property for padded_frequency_grid_in_pixels / pixel_size

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

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

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

Convenience property for padded_full_frequency_grid_in_pixels / pixel_size

__init__() ¤

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

crop_to_shape(image: Inexact[Array, 'y_dim x_dim']) -> Inexact[Array, '{self.y_dim} {self.x_dim}'] ¤

Crop an image to shape.

pad_to_padded_shape(image: Inexact[Array, 'y_dim x_dim'], **kwargs: typing.Any) -> Inexact[Array, '{self.padded_y_dim} {self.padded_x_dim}'] ¤

Pad an image to padded_shape.

crop_or_pad_to_padded_shape(image: Inexact[Array, 'y_dim x_dim'], **kwargs: typing.Any) -> Inexact[Array, '{self.padded_y_dim} {self.padded_x_dim}'] ¤

Reshape an image to padded_shape using cropping or padding.