Skip to content

Instantly share code, notes, and snippets.

@alisterburt
Created March 12, 2025 15:51
Show Gist options
  • Save alisterburt/5deac08b2bbbe26e5243bbe453fc0cbf to your computer and use it in GitHub Desktop.
Save alisterburt/5deac08b2bbbe26e5243bbe453fc0cbf to your computer and use it in GitHub Desktop.
how to simulate tomograms for ayse
import numpy as np
from scipy.spatial.transform import Rotation as R
from torch_fourier_slice import project_3d_to_2d, backproject_2d_to_3d
tilt_angles = np.linspace(-60, 60, 41, endpoint=True)
rotation_matrices = R.from_euler('y', angles=tilt_angles, degrees=True).as_matrix()
volume = simulate_volume()
projections = project_3d_to_2d(volume, rotation_matrices)
simulated_tomogram = backproject_2d_to_3d(projections, rotation_matrices)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment