Skip to content

Scattering potential integration methods¤

cryojax provides different methods for integrating scattering potentials onto a plane.

cryojax.simulator.AbstractPotentialIntegrator

cryojax.simulator.AbstractPotentialIntegrator ¤

Base class for a method of integrating a potential onto the exit plane.

Integration methods for voxel-based potentials¤

cryojax.simulator.AbstractVoxelPotentialIntegrator

cryojax.simulator.AbstractVoxelPotentialIntegrator ¤

Base class for a method of integrating a voxel-based potential.

cryojax.simulator.AbstractVoxelPotentialIntegrator.pixel_rescaling_method: AbstractVar[Optional[str]] instance-attribute ¤

cryojax.simulator.FourierSliceExtraction ¤

Integrate points to the exit plane using the Fourier projection-slice theorem.

This extracts slices using interpolation methods housed in cryojax.image.map_coordinates and cryojax.image.map_coordinates_with_cubic_spline.

cryojax.simulator.FourierSliceExtraction.__init__(*, pixel_rescaling_method: Optional[str] = None, interpolation_order: int = 1, interpolation_mode: str = 'fill', interpolation_cval: complex = 0.0 + 0j) ¤

Arguments:

  • pixel_rescaling_method: Method for rescaling the final image to the InstrumentConfig pixel size. See cryojax.image.rescale_pixel_size for documentation.
  • interpolation_order: The interpolation order. This can be 0 (nearest-neighbor), 1 (linear), or 3 (cubic). Note that this argument is ignored when using this object with a FourierVoxelGridInterpolator.
  • interpolation_mode: Specify how to handle out of bounds indexing. See cryojax.image.map_coordinates for documentation.
  • interpolation_cval: Value for filling out-of-bounds indices. Used only when interpolation_mode = "fill".
cryojax.simulator.FourierSliceExtraction.extract_fourier_slice_from_spline_coefficients(spline_coefficients: Complex[Array, 'dim+2 dim+2 dim+2'], frequency_slice_in_pixels: Float[Array, '1 dim dim 3']) -> Complex[Array, 'dim dim//2+1'] ¤

Extract a fourier slice using the interpolation defined by spline_coefficients at coordinates frequency_slice_in_pixels.

Arguments:

  • spline_coefficients: Spline coefficients of the density grid in fourier space. The coefficients should be computed from a fourier_voxel_grid with the zero frequency component in the center. These are typically computed with the function cryojax.image.compute_spline_coefficients.
  • frequency_slice_in_pixels: Frequency central slice coordinate system. The zero frequency component should be in the center.
  • voxel_size: The voxel size of the fourier_voxel_grid. This argument is not used in the FourierSliceExtraction class.
  • wavelength_in_angstroms: The wavelength of the incident electron beam. This argument is not used in the FourierSliceExtraction class.

Returns:

The interpolated fourier slice at coordinates frequency_slice_in_pixels.

cryojax.simulator.FourierSliceExtraction.extract_fourier_slice_from_grid_points(fourier_voxel_grid: Complex[Array, 'dim dim dim'], frequency_slice_in_pixels: Float[Array, '1 dim dim 3']) -> Complex[Array, 'dim dim//2+1'] ¤

Extract a fourier slice of the fourier_voxel_grid at coordinates frequency_slice_in_pixels.

Arguments:

  • fourier_voxel_grid: Density grid in fourier space. The zero frequency component should be in the center.
  • frequency_slice_in_pixels: Frequency central slice coordinate system. The zero frequency component should be in the center.
  • voxel_size: The voxel size of the fourier_voxel_grid. This argument is not used in the FourierSliceExtraction class.
  • wavelength_in_angstroms: The wavelength of the incident electron beam. This argument is not used in the FourierSliceExtraction class.

Returns:

The interpolated fourier slice at coordinates frequency_slice_in_pixels.


cryojax.simulator.NufftProjection ¤

Integrate points onto the exit plane using non-uniform FFTs.

cryojax.simulator.NufftProjection.__init__(*, pixel_rescaling_method: Optional[str] = None, eps: float = 1e-06) ¤

Arguments:

  • pixel_rescaling_method: Method for interpolating the final image to the InstrumentConfig pixel size. See cryojax.image.rescale_pixel_size for documentation.
  • eps: See jax-finufft for documentation.
cryojax.simulator.NufftProjection.project_voxel_cloud_with_nufft(weights: Float[Array, ' size'], coordinate_list_in_angstroms: Float[Array, 'size 2'] | Float[Array, 'size 3'], shape: tuple[int, int]) -> Complex[Array, '{shape[0]} {shape[1]//2+1}'] ¤

Project and interpolate 3D volume point cloud onto imaging plane using a non-uniform FFT.

Arguments:

  • weights: Density point cloud.
  • coordinate_list_in_angstroms: Coordinate system of point cloud.
  • shape: Shape of the real-space imaging plane in pixels.

Returns:

The fourier-space projection of the density point cloud defined by weights and coordinate_list_in_angstroms.

Integration methods for atom-based potentials¤

cryojax.simulator.GaussianMixtureProjection ¤

cryojax.simulator.GaussianMixtureProjection.__init__(*, upsampling_factor: Optional[int] = None, use_error_functions: bool = False, n_batches: int = 1) ¤

Arguments:

  • upsampling_factor: The factor by which to upsample the computation of the images. If upsampling_factor is greater than 1, the images will be computed at a higher resolution and then downsampled to the original resolution. This can be useful for reducing aliasing artifacts in the images.
  • use_error_functions: If True, use error functions to evaluate the projected potential at a pixel to be the average value within the pixel using gaussian integrals. If False, the potential at a pixel will simply be evaluated as a gaussian.
  • n_batches: The number of batches over groups of atoms used to evaluate the projection. This is useful if GPU memory is exhausted. By default, 1, which computes a projection for all atoms at once.