Scattering potential integration methods¤
cryojax
provides different methods for integrating scattering potentials onto a plane.
cryojax.simulator.AbstractDirectIntegrator
cryojax.simulator.AbstractDirectIntegrator
¤
Base class for a method of integrating a potential onto the exit plane.
cryojax.simulator.AbstractDirectIntegrator.integrate(potential: PotentialT, config: AbstractConfig, outputs_real_space: bool = False) -> Complex[Array, '{config.padded_y_dim} {config.padded_x_dim//2+1}'] | Complex[Array, '{config.padded_y_dim} {config.padded_x_dim}'] | Float[Array, '{config.padded_y_dim} {config.padded_x_dim}']
abstractmethod
¤
Integration methods for voxel-based potentials¤
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__(*, checks_pixel_size: bool = True, correction_mask: Optional[InverseSincMask] = None, out_of_bounds_mode: str = 'fill', fill_value: complex = 0.0 + 0j)
¤
Arguments:
checks_pixel_size
: IfTrue
, check at run-time if theconfig.pixel_size
matches thepotential.voxel_size
. IfFalse
, this is not checked and will return incorrect results if they do not match.correction_mask
: Acryojax.image.operators.SincCorrectionMask
for performing sinc-correction on the linear-interpolated projections. This should be computed on a coordinate grid with shape matching theFourierVoxelGridPotential.shape
.out_of_bounds_mode
: Specify how to handle out of bounds indexing. Seecryojax.image.map_coordinates
for documentation.fill_value
: Value for filling out-of-bounds indices. Used only whenout_of_bounds_mode = "fill"
.
cryojax.simulator.FourierSliceExtraction.integrate(potential: FourierVoxelGridPotential | FourierVoxelSplinePotential, config: AbstractConfig, outputs_real_space: bool = False) -> Complex[Array, '{config.padded_y_dim} {config.padded_x_dim//2+1}'] | Float[Array, '{config.padded_y_dim} {config.padded_x_dim}']
¤
Compute the integrated scattering potential at the AbstractConfig
settings
of a voxel-based representation in fourier-space, using fourier slice extraction.
Arguments:
potential
: The scattering potential representation.config
: The configuration of the resulting image.
Returns:
The extracted fourier voxels of the potential
, at the
config.padded_shape
and the config.pixel_size
.
cryojax.simulator.FourierSliceExtraction.extract_fourier_slice_from_spline_coefficients(spline_coefficients: Complex[Array, 'coeff_dim coeff_dim coeff_dim'], 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 afourier_voxel_grid
with the zero frequency component in the center. These are typically computed with the functioncryojax.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 thefourier_voxel_grid
. This argument is not used in theFourierSliceExtraction
class.wavelength_in_angstroms
: The wavelength of the incident electron beam. This argument is not used in theFourierSliceExtraction
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 thefourier_voxel_grid
. This argument is not used in theFourierSliceExtraction
class.wavelength_in_angstroms
: The wavelength of the incident electron beam. This argument is not used in theFourierSliceExtraction
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__(*, checks_pixel_size: bool = True, eps: float = 1e-06)
¤
Arguments:
checks_pixel_size
: IfTrue
, check at run-time if theconfig.pixel_size
matches thepotential.voxel_size
. IfFalse
, this is not checked and will return incorrect results if they do not match.eps
: Seejax-finufft
for documentation.
cryojax.simulator.NufftProjection.integrate(potential: RealVoxelGridPotential | RealVoxelCloudPotential, config: AbstractConfig, outputs_real_space: bool = False) -> Complex[Array, '{config.padded_y_dim} {config.padded_x_dim//2+1}'] | Float[Array, '{config.padded_y_dim} {config.padded_x_dim}']
¤
Compute the integrated scattering potential at the AbstractConfig
settings
of a voxel-based representation in real-space, using non-uniform FFTs.
Arguments:
potential
: The scattering potential representation.config
: The configuration of the resulting image.
Returns:
The projection integral of the potential
in fourier space, at the
config.padded_shape
and the config.pixel_size
.
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, shape: Optional[tuple[int, 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. Ifupsampling_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.shape
: The shape of the plane on which projections are computed before padding or cropping to theAbstractConfig.padded_shape
. This argument is particularly useful if theAbstractConfig.padded_shape
is much larger than the protein.use_error_functions
: IfTrue
, use error functions to evaluate the projected potential at a pixel to be the average value within the pixel using gaussian integrals. IfFalse
, 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.
cryojax.simulator.GaussianMixtureProjection.integrate(potential: GaussianMixtureAtomicPotential | PengAtomicPotential, config: AbstractConfig, outputs_real_space: bool = False) -> Complex[Array, '{config.padded_y_dim} {config.padded_x_dim//2+1}'] | Float[Array, '{config.padded_y_dim} {config.padded_x_dim}']
¤
Compute a projection from the atomic potential and transform it to Fourier space.
Arguments:
potential
: The atomic potential to project.config
: The configuration of the imaging instrument.
Returns:
The integrated potential in real or fourier space at the AbstractConfig.padded_shape
.