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.
cryojax.simulator.AbstractPotentialIntegrator.compute_fourier_integrated_potential(potential: PotentialT, instrument_config: InstrumentConfig) -> Complex[Array, '{instrument_config.padded_y_dim} {instrument_config.padded_x_dim//2+1}']
abstractmethod
¤
Integration methods for voxel-based potentials¤
cryojax.simulator.AbstractVoxelPotentialIntegrator
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 theInstrumentConfig
pixel size. Seecryojax.image.rescale_pixel_size
for documentation.interpolation_order
: The interpolation order. This can be0
(nearest-neighbor),1
(linear), or3
(cubic). Note that this argument is ignored when using this object with aFourierVoxelGridInterpolator
.interpolation_mode
: Specify how to handle out of bounds indexing. Seecryojax.image.map_coordinates
for documentation.interpolation_cval
: Value for filling out-of-bounds indices. Used only wheninterpolation_mode = "fill"
.
cryojax.simulator.FourierSliceExtraction.compute_fourier_integrated_potential(potential: FourierVoxelGridPotential | FourierVoxelGridPotentialInterpolator, instrument_config: InstrumentConfig) -> Complex[Array, '{instrument_config.padded_y_dim} {instrument_config.padded_x_dim//2+1}']
¤
Compute the integrated scattering potential at the InstrumentConfig
settings
of a voxel-based representation in fourier-space, using fourier slice extraction.
Arguments:
potential
: The scattering potential representation.instrument_config
: The configuration of the resulting image.
Returns:
The extracted fourier voxels of the potential
, at the
instrument_config.padded_shape
and the instrument_config.pixel_size
.
cryojax.simulator.FourierSliceExtraction.extract_voxels_from_spline_coefficients(spline_coefficients: Complex[Array, 'dim+2 dim+2 dim+2'], frequency_slice_in_pixels: Float[Array, '1 dim dim 3'], voxel_size: Float[Array, ''], wavelength_in_angstroms: Float[Array, '']) -> 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_voxels_from_grid_points(fourier_voxel_grid: Complex[Array, 'dim dim dim'], frequency_slice_in_pixels: Float[Array, '1 dim dim 3'], voxel_size: Float[Array, ''], wavelength_in_angstroms: Float[Array, '']) -> 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__(*, pixel_rescaling_method: Optional[str] = None, eps: float = 1e-06)
¤
Arguments:
pixel_rescaling_method
: Method for interpolating the final image to theInstrumentConfig
pixel size. Seecryojax.image.rescale_pixel_size
for documentation.eps
: Seejax-finufft
for documentation.
cryojax.simulator.NufftProjection.compute_fourier_integrated_potential(potential: RealVoxelGridPotential | RealVoxelCloudPotential, instrument_config: InstrumentConfig) -> Complex[Array, '{instrument_config.padded_y_dim} {instrument_config.padded_x_dim//2+1}']
¤
Compute the integrated scattering potential at the InstrumentConfig
settings
of a voxel-based representation in real-space, using non-uniform FFTs.
Arguments:
potential
: The scattering potential representation.instrument_config
: The configuration of the resulting image.
Returns:
The projection integral of the potential
in fourier space, at the
instrument_config.padded_shape
and the instrument_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)
¤
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.
cryojax.simulator.GaussianMixtureProjection.compute_fourier_integrated_potential(potential: GaussianMixtureAtomicPotential | PengAtomicPotential, instrument_config: InstrumentConfig) -> Complex[Array, '{instrument_config.padded_y_dim} {instrument_config.padded_x_dim//2+1}']
¤
Compute a projection from the atomic potential and transform it to Fourier space.
Arguments:
potential
: The atomic potential to project.instrument_config
: The configuration of the imaging instrument.
Returns:
The Fourier transform of the integrated potential.