Ab-initio Pipeline Demonstration

This tutorial demonstrates some key components of an ab-initio reconstruction pipeline using synthetic data generated with ASPIRE’s Simulation class of objects.

Download an Example Volume

We begin by downloading a high resolution volume map of the 80S Ribosome, sourced from EMDB: https://www.ebi.ac.uk/emdb/EMD-2660. This is one of several volume maps that can be downloaded with ASPIRE’s data downloading utility by using the following import. sphinx_gallery_start_ignore flake8: noqa sphinx_gallery_end_ignore

from aspire.downloader import emdb_2660

# Load 80s Ribosome as a ``Volume`` object.
original_vol = emdb_2660()

# Downsample the volume
res = 41
vol = original_vol.downsample(res)

Note

A Volume can be saved using the Volume.save() method as follows:

fn = f"downsampled_80s_ribosome_size{res}.mrc"
vol.save(fn, overwrite=True)

Create a Simulation Source

ASPIRE’s Simulation class can be used to generate a synthetic dataset of projection images. A Simulation object produces random projections of a supplied Volume and applies noise and CTF filters. The resulting stack of 2D images is stored in an Image object.

CTF Filters

Let’s start by creating CTF filters. The operators package contains a collection of filter classes that can be supplied to a Simulation. We use RadialCTFFilter to generate a set of CTF filters with various defocus values.

# Create CTF filters
import numpy as np

from aspire.operators import RadialCTFFilter

# Radial CTF Filter
defocus_min = 15000  # unit is angstroms
defocus_max = 25000
defocus_ct = 7

ctf_filters = [
    RadialCTFFilter(pixel_size=5, defocus=d)
    for d in np.linspace(defocus_min, defocus_max, defocus_ct)
]

Initialize Simulation Object

We feed our Volume and filters into Simulation to generate the dataset of images. When controlled white Gaussian noise is desired, WhiteNoiseAdder.from_snr() can be used to generate a simulation data set around a specific SNR.

Alternatively, users can bring their own images using an ArrayImageSource, or define their own custom noise functions via Simulation(..., noise_adder=CustomNoiseAdder(...)). Examples can be found in tutorials/class_averaging.py and experiments/simulated_abinitio_pipeline.py.

from aspire.noise import WhiteNoiseAdder
from aspire.source import Simulation

# set parameters
n_imgs = 2500

# SNR target for white gaussian noise.
snr = 0.5

Note

Note, the SNR value was chosen based on other parameters for this quick tutorial, and can be changed to adjust the power of the additive noise.

# For this ``Simulation`` we set all 2D offset vectors to zero,
# but by default offset vectors will be randomly distributed.
src = Simulation(
    n=n_imgs,  # number of projections
    vols=vol,  # volume source
    offsets=0,  # Default: images are randomly shifted
    unique_filters=ctf_filters,
    noise_adder=WhiteNoiseAdder.from_snr(snr=snr),  # desired SNR
)
  0%|          | 0/5 [00:00<?, ?it/s]
 20%|██        | 1/5 [00:00<00:00,  4.05it/s]
 40%|████      | 2/5 [00:00<00:00,  4.18it/s]
 60%|██████    | 3/5 [00:00<00:00,  4.23it/s]
 80%|████████  | 4/5 [00:00<00:00,  4.25it/s]
100%|██████████| 5/5 [00:01<00:00,  4.43it/s]
100%|██████████| 5/5 [00:01<00:00,  4.32it/s]

Several Views of the Projection Images

We can access several views of the projection images.

# with no corruption applied
src.projections[0:10].show()
pipeline demo
# with no noise corruption
src.clean_images[0:10].show()
pipeline demo
# with noise and CTF corruption
src.images[0:10].show()
pipeline demo

CTF Correction

We apply phase_flip() to correct for CTF effects.

src = src.phase_flip()
src.images[0:10].show()
pipeline demo

Class Averaging

We use RIRClass2D object to classify the images via the rotationally invariant representation (RIR) algorithm. Class selection is customizable. The classification module also includes a set of protocols for selecting a set of images to be used for classification. Here we’re using TopClassSelector, which selects the first n_classes images from the source. In practice, the selection is done by sorting class averages based on some configurable notion of quality.

from aspire.classification import RIRClass2D

# set parameters
n_classes = 200
n_nbor = 6

# We will customize our class averaging source. Note that the
# ``fspca_components`` and ``bispectrum_components`` were selected for
# this small tutorial.
rir = RIRClass2D(
    src,
    fspca_components=40,
    bispectrum_components=30,
    n_nbor=n_nbor,
)

from aspire.denoising import DebugClassAvgSource

avgs = DebugClassAvgSource(
    src=src,
    classifier=rir,
)

# We'll continue our pipeline with the first ``n_classes`` from ``avgs``.
avgs = avgs[:n_classes]

View the Class Averages

# Show class averages
avgs.images[0:10].show()
pipeline demo
  0%|          | 0/5 [00:00<?, ?it/s]
 20%|██        | 1/5 [00:01<00:06,  1.62s/it]
 40%|████      | 2/5 [00:03<00:04,  1.64s/it]
 60%|██████    | 3/5 [00:04<00:03,  1.64s/it]
 80%|████████  | 4/5 [00:06<00:01,  1.64s/it]
100%|██████████| 5/5 [00:07<00:00,  1.57s/it]
100%|██████████| 5/5 [00:07<00:00,  1.60s/it]

  0%|          | 0/5 [00:00<?, ?it/s]
 20%|██        | 1/5 [00:00<00:01,  3.67it/s]
 40%|████      | 2/5 [00:00<00:00,  3.69it/s]
 60%|██████    | 3/5 [00:00<00:00,  3.71it/s]
 80%|████████  | 4/5 [00:01<00:00,  3.67it/s]
100%|██████████| 5/5 [00:01<00:00,  3.84it/s]
100%|██████████| 5/5 [00:01<00:00,  3.77it/s]

  0%|          | 0/10 [00:00<?, ?it/s]
 10%|█         | 1/10 [00:00<00:01,  4.50it/s]
 20%|██        | 2/10 [00:00<00:01,  6.21it/s]
 30%|███       | 3/10 [00:00<00:00,  7.02it/s]
 40%|████      | 4/10 [00:00<00:00,  7.43it/s]
 50%|█████     | 5/10 [00:00<00:00,  7.71it/s]
 60%|██████    | 6/10 [00:00<00:00,  7.82it/s]
 70%|███████   | 7/10 [00:00<00:00,  7.94it/s]
 80%|████████  | 8/10 [00:01<00:00,  8.05it/s]
 90%|█████████ | 9/10 [00:01<00:00,  8.14it/s]
100%|██████████| 10/10 [00:01<00:00,  8.23it/s]
100%|██████████| 10/10 [00:01<00:00,  7.63it/s]

  0%|          | 0/10 [00:00<?, ?it/s]
 30%|███       | 3/10 [00:00<00:00, 22.76it/s]
 60%|██████    | 6/10 [00:00<00:00, 21.74it/s]
 90%|█████████ | 9/10 [00:00<00:00, 21.66it/s]
100%|██████████| 10/10 [00:00<00:00, 21.88it/s]
# Show original images corresponding to those classes. This 1:1
# comparison is only expected to work because we used
# ``TopClassSelector`` to classify our images.
src.images[0:10].show()
pipeline demo

Orientation Estimation

We create an OrientedSource, which consumes an ImageSource object, an orientation estimator, and returns a new source which lazily estimates orientations. In this case we supply avgs for our source and a CLSyncVoting class instance for our orientation estimator. The CLSyncVoting algorithm employs a common-lines method with synchronization and voting.

from aspire.abinitio import CLSyncVoting
from aspire.source import OrientedSource

# Stash true rotations for later comparison
true_rotations = src.rotations[:n_classes]

# For this low resolution example we will customize the ``CLSyncVoting``
# instance to use fewer theta points ``n_theta`` then the default value of 360.
orient_est = CLSyncVoting(avgs, n_theta=72)

# Instantiate an ``OrientedSource``.
oriented_src = OrientedSource(avgs, orient_est)
  0%|          | 0/200 [00:00<?, ?it/s]
  0%|          | 1/200 [00:00<00:22,  8.66it/s]
  1%|          | 2/200 [00:00<00:23,  8.50it/s]
  2%|▏         | 3/200 [00:00<00:23,  8.40it/s]
  2%|▏         | 4/200 [00:00<00:23,  8.35it/s]
  2%|▎         | 5/200 [00:00<00:23,  8.32it/s]
  3%|▎         | 6/200 [00:00<00:23,  8.27it/s]
  4%|▎         | 7/200 [00:00<00:23,  8.31it/s]
  4%|▍         | 8/200 [00:00<00:23,  8.24it/s]
  4%|▍         | 9/200 [00:01<00:23,  8.29it/s]
  5%|▌         | 10/200 [00:01<00:22,  8.38it/s]
  6%|▌         | 11/200 [00:01<00:22,  8.33it/s]
  6%|▌         | 12/200 [00:01<00:22,  8.34it/s]
  6%|▋         | 13/200 [00:01<00:22,  8.36it/s]
  7%|▋         | 14/200 [00:01<00:22,  8.30it/s]
  8%|▊         | 15/200 [00:01<00:21,  8.41it/s]
  8%|▊         | 16/200 [00:01<00:22,  8.32it/s]
  8%|▊         | 17/200 [00:02<00:21,  8.32it/s]
  9%|▉         | 18/200 [00:02<00:21,  8.33it/s]
 10%|▉         | 19/200 [00:02<00:21,  8.35it/s]
 10%|█         | 20/200 [00:02<00:21,  8.36it/s]
 10%|█         | 21/200 [00:02<00:21,  8.34it/s]
 11%|█         | 22/200 [00:02<00:21,  8.30it/s]
 12%|█▏        | 23/200 [00:02<00:21,  8.26it/s]
 12%|█▏        | 24/200 [00:02<00:21,  8.34it/s]
 12%|█▎        | 25/200 [00:02<00:20,  8.36it/s]
 13%|█▎        | 26/200 [00:03<00:20,  8.35it/s]
 14%|█▎        | 27/200 [00:03<00:20,  8.34it/s]
 14%|█▍        | 28/200 [00:03<00:20,  8.37it/s]
 14%|█▍        | 29/200 [00:03<00:20,  8.36it/s]
 15%|█▌        | 30/200 [00:03<00:20,  8.39it/s]
 16%|█▌        | 31/200 [00:03<00:20,  8.38it/s]
 16%|█▌        | 32/200 [00:03<00:20,  8.28it/s]
 16%|█▋        | 33/200 [00:03<00:20,  8.21it/s]
 17%|█▋        | 34/200 [00:04<00:20,  8.23it/s]
 18%|█▊        | 35/200 [00:04<00:19,  8.28it/s]
 18%|█▊        | 36/200 [00:04<00:19,  8.31it/s]
 18%|█▊        | 37/200 [00:04<00:19,  8.28it/s]
 19%|█▉        | 38/200 [00:04<00:19,  8.28it/s]
 20%|█▉        | 39/200 [00:04<00:19,  8.28it/s]
 20%|██        | 40/200 [00:04<00:19,  8.26it/s]
 20%|██        | 41/200 [00:04<00:19,  8.24it/s]
 21%|██        | 42/200 [00:05<00:19,  8.25it/s]
 22%|██▏       | 43/200 [00:05<00:18,  8.29it/s]
 22%|██▏       | 44/200 [00:05<00:18,  8.39it/s]
 22%|██▎       | 45/200 [00:05<00:18,  8.36it/s]
 23%|██▎       | 46/200 [00:05<00:18,  8.33it/s]
 24%|██▎       | 47/200 [00:05<00:18,  8.30it/s]
 24%|██▍       | 48/200 [00:05<00:18,  8.27it/s]
 24%|██▍       | 49/200 [00:05<00:18,  8.30it/s]
 25%|██▌       | 50/200 [00:06<00:18,  8.31it/s]
 26%|██▌       | 51/200 [00:06<00:17,  8.29it/s]
 26%|██▌       | 52/200 [00:06<00:17,  8.29it/s]
 26%|██▋       | 53/200 [00:06<00:17,  8.35it/s]
 27%|██▋       | 54/200 [00:06<00:17,  8.35it/s]
 28%|██▊       | 55/200 [00:06<00:17,  8.32it/s]
 28%|██▊       | 56/200 [00:06<00:17,  8.31it/s]
 28%|██▊       | 57/200 [00:06<00:17,  8.25it/s]
 29%|██▉       | 58/200 [00:06<00:17,  8.26it/s]
 30%|██▉       | 59/200 [00:07<00:17,  8.27it/s]
 30%|███       | 60/200 [00:07<00:16,  8.26it/s]
 30%|███       | 61/200 [00:07<00:16,  8.33it/s]
 31%|███       | 62/200 [00:07<00:16,  8.34it/s]
 32%|███▏      | 63/200 [00:07<00:16,  8.32it/s]
 32%|███▏      | 64/200 [00:07<00:16,  8.37it/s]
 32%|███▎      | 65/200 [00:07<00:16,  8.37it/s]
 33%|███▎      | 66/200 [00:07<00:16,  8.37it/s]
 34%|███▎      | 67/200 [00:08<00:15,  8.36it/s]
 34%|███▍      | 68/200 [00:08<00:15,  8.35it/s]
 34%|███▍      | 69/200 [00:08<00:15,  8.34it/s]
 35%|███▌      | 70/200 [00:08<00:15,  8.30it/s]
 36%|███▌      | 71/200 [00:08<00:15,  8.30it/s]
 36%|███▌      | 72/200 [00:08<00:15,  8.28it/s]
 36%|███▋      | 73/200 [00:08<00:15,  8.16it/s]
 37%|███▋      | 74/200 [00:08<00:15,  8.20it/s]
 38%|███▊      | 75/200 [00:09<00:15,  8.33it/s]
 38%|███▊      | 76/200 [00:09<00:14,  8.35it/s]
 38%|███▊      | 77/200 [00:09<00:14,  8.25it/s]
 39%|███▉      | 78/200 [00:09<00:14,  8.23it/s]
 40%|███▉      | 79/200 [00:09<00:14,  8.22it/s]
 40%|████      | 80/200 [00:09<00:14,  8.17it/s]
 40%|████      | 81/200 [00:09<00:14,  8.16it/s]
 41%|████      | 82/200 [00:09<00:14,  8.13it/s]
 42%|████▏     | 83/200 [00:09<00:14,  8.17it/s]
 42%|████▏     | 84/200 [00:10<00:14,  8.17it/s]
 42%|████▎     | 85/200 [00:10<00:14,  8.21it/s]
 43%|████▎     | 86/200 [00:10<00:13,  8.22it/s]
 44%|████▎     | 87/200 [00:10<00:13,  8.20it/s]
 44%|████▍     | 88/200 [00:10<00:13,  8.24it/s]
 44%|████▍     | 89/200 [00:10<00:13,  8.28it/s]
 45%|████▌     | 90/200 [00:10<00:13,  8.24it/s]
 46%|████▌     | 91/200 [00:10<00:13,  8.19it/s]
 46%|████▌     | 92/200 [00:11<00:13,  8.18it/s]
 46%|████▋     | 93/200 [00:11<00:13,  8.23it/s]
 47%|████▋     | 94/200 [00:11<00:12,  8.26it/s]
 48%|████▊     | 95/200 [00:11<00:12,  8.28it/s]
 48%|████▊     | 96/200 [00:11<00:12,  8.19it/s]
 48%|████▊     | 97/200 [00:11<00:12,  8.22it/s]
 49%|████▉     | 98/200 [00:11<00:12,  8.24it/s]
 50%|████▉     | 99/200 [00:11<00:12,  8.25it/s]
 50%|█████     | 100/200 [00:12<00:12,  8.22it/s]
 50%|█████     | 101/200 [00:12<00:11,  8.28it/s]
 51%|█████     | 102/200 [00:12<00:11,  8.31it/s]
 52%|█████▏    | 103/200 [00:12<00:11,  8.31it/s]
 52%|█████▏    | 104/200 [00:12<00:11,  8.34it/s]
 52%|█████▎    | 105/200 [00:12<00:11,  8.35it/s]
 53%|█████▎    | 106/200 [00:12<00:11,  8.38it/s]
 54%|█████▎    | 107/200 [00:12<00:11,  8.38it/s]
 54%|█████▍    | 108/200 [00:13<00:10,  8.41it/s]
 55%|█████▍    | 109/200 [00:13<00:10,  8.42it/s]
 55%|█████▌    | 110/200 [00:13<00:10,  8.45it/s]
 56%|█████▌    | 111/200 [00:13<00:10,  8.37it/s]
 56%|█████▌    | 112/200 [00:13<00:10,  8.35it/s]
 56%|█████▋    | 113/200 [00:13<00:10,  8.31it/s]
 57%|█████▋    | 114/200 [00:13<00:10,  8.29it/s]
 57%|█████▊    | 115/200 [00:13<00:10,  8.31it/s]
 58%|█████▊    | 116/200 [00:13<00:10,  8.29it/s]
 58%|█████▊    | 117/200 [00:14<00:10,  8.25it/s]
 59%|█████▉    | 118/200 [00:14<00:09,  8.25it/s]
 60%|█████▉    | 119/200 [00:14<00:09,  8.22it/s]
 60%|██████    | 120/200 [00:14<00:09,  8.25it/s]
 60%|██████    | 121/200 [00:14<00:09,  8.18it/s]
 61%|██████    | 122/200 [00:14<00:09,  8.21it/s]
 62%|██████▏   | 123/200 [00:14<00:09,  8.25it/s]
 62%|██████▏   | 124/200 [00:14<00:09,  8.30it/s]
 62%|██████▎   | 125/200 [00:15<00:08,  8.36it/s]
 63%|██████▎   | 126/200 [00:15<00:08,  8.35it/s]
 64%|██████▎   | 127/200 [00:15<00:08,  8.29it/s]
 64%|██████▍   | 128/200 [00:15<00:08,  8.29it/s]
 64%|██████▍   | 129/200 [00:15<00:08,  8.29it/s]
 65%|██████▌   | 130/200 [00:15<00:08,  8.35it/s]
 66%|██████▌   | 131/200 [00:15<00:08,  8.45it/s]
 66%|██████▌   | 132/200 [00:15<00:08,  8.46it/s]
 66%|██████▋   | 133/200 [00:16<00:07,  8.39it/s]
 67%|██████▋   | 134/200 [00:16<00:07,  8.33it/s]
 68%|██████▊   | 135/200 [00:16<00:07,  8.27it/s]
 68%|██████▊   | 136/200 [00:16<00:07,  8.26it/s]
 68%|██████▊   | 137/200 [00:16<00:07,  8.23it/s]
 69%|██████▉   | 138/200 [00:16<00:07,  8.22it/s]
 70%|██████▉   | 139/200 [00:16<00:07,  8.28it/s]
 70%|███████   | 140/200 [00:16<00:07,  8.28it/s]
 70%|███████   | 141/200 [00:16<00:07,  8.23it/s]
 71%|███████   | 142/200 [00:17<00:07,  8.24it/s]
 72%|███████▏  | 143/200 [00:17<00:06,  8.21it/s]
 72%|███████▏  | 144/200 [00:17<00:06,  8.22it/s]
 72%|███████▎  | 145/200 [00:17<00:06,  8.24it/s]
 73%|███████▎  | 146/200 [00:17<00:06,  8.20it/s]
 74%|███████▎  | 147/200 [00:17<00:06,  8.27it/s]
 74%|███████▍  | 148/200 [00:17<00:06,  8.26it/s]
 74%|███████▍  | 149/200 [00:17<00:06,  8.25it/s]
 75%|███████▌  | 150/200 [00:18<00:06,  8.18it/s]
 76%|███████▌  | 151/200 [00:18<00:05,  8.19it/s]
 76%|███████▌  | 152/200 [00:18<00:05,  8.26it/s]
 76%|███████▋  | 153/200 [00:18<00:05,  8.31it/s]
 77%|███████▋  | 154/200 [00:18<00:05,  8.27it/s]
 78%|███████▊  | 155/200 [00:18<00:05,  8.29it/s]
 78%|███████▊  | 156/200 [00:18<00:05,  8.29it/s]
 78%|███████▊  | 157/200 [00:18<00:05,  8.27it/s]
 79%|███████▉  | 158/200 [00:19<00:05,  8.29it/s]
 80%|███████▉  | 159/200 [00:19<00:04,  8.31it/s]
 80%|████████  | 160/200 [00:19<00:04,  8.25it/s]
 80%|████████  | 161/200 [00:19<00:04,  8.31it/s]
 81%|████████  | 162/200 [00:19<00:04,  8.43it/s]
 82%|████████▏ | 163/200 [00:19<00:04,  8.40it/s]
 82%|████████▏ | 164/200 [00:19<00:04,  8.34it/s]
 82%|████████▎ | 165/200 [00:19<00:04,  8.26it/s]
 83%|████████▎ | 166/200 [00:20<00:04,  8.32it/s]
 84%|████████▎ | 167/200 [00:20<00:03,  8.39it/s]
 84%|████████▍ | 168/200 [00:20<00:03,  8.34it/s]
 84%|████████▍ | 169/200 [00:20<00:03,  8.29it/s]
 85%|████████▌ | 170/200 [00:20<00:03,  8.25it/s]
 86%|████████▌ | 171/200 [00:20<00:03,  8.31it/s]
 86%|████████▌ | 172/200 [00:20<00:03,  8.21it/s]
 86%|████████▋ | 173/200 [00:20<00:03,  8.27it/s]
 87%|████████▋ | 174/200 [00:20<00:03,  8.30it/s]
 88%|████████▊ | 175/200 [00:21<00:03,  8.23it/s]
 88%|████████▊ | 176/200 [00:21<00:02,  8.24it/s]
 88%|████████▊ | 177/200 [00:21<00:02,  8.20it/s]
 89%|████████▉ | 178/200 [00:21<00:02,  8.23it/s]
 90%|████████▉ | 179/200 [00:21<00:02,  8.30it/s]
 90%|█████████ | 180/200 [00:21<00:02,  8.29it/s]
 90%|█████████ | 181/200 [00:21<00:02,  8.27it/s]
 91%|█████████ | 182/200 [00:21<00:02,  8.27it/s]
 92%|█████████▏| 183/200 [00:22<00:02,  8.32it/s]
 92%|█████████▏| 184/200 [00:22<00:01,  8.33it/s]
 92%|█████████▎| 185/200 [00:22<00:01,  8.32it/s]
 93%|█████████▎| 186/200 [00:22<00:01,  8.29it/s]
 94%|█████████▎| 187/200 [00:22<00:01,  8.24it/s]
 94%|█████████▍| 188/200 [00:22<00:01,  8.30it/s]
 94%|█████████▍| 189/200 [00:22<00:01,  8.34it/s]
 95%|█████████▌| 190/200 [00:22<00:01,  8.32it/s]
 96%|█████████▌| 191/200 [00:23<00:01,  8.32it/s]
 96%|█████████▌| 192/200 [00:23<00:00,  8.37it/s]
 96%|█████████▋| 193/200 [00:23<00:00,  8.37it/s]
 97%|█████████▋| 194/200 [00:23<00:00,  8.29it/s]
 98%|█████████▊| 195/200 [00:23<00:00,  8.30it/s]
 98%|█████████▊| 196/200 [00:23<00:00,  8.28it/s]
 98%|█████████▊| 197/200 [00:23<00:00,  8.26it/s]
 99%|█████████▉| 198/200 [00:23<00:00,  8.30it/s]
100%|█████████▉| 199/200 [00:23<00:00,  8.27it/s]
100%|██████████| 200/200 [00:24<00:00,  8.27it/s]
100%|██████████| 200/200 [00:24<00:00,  8.29it/s]

  0%|          | 0/200 [00:00<?, ?it/s]
  2%|▏         | 3/200 [00:00<00:08, 22.51it/s]
  3%|▎         | 6/200 [00:00<00:08, 21.57it/s]
  4%|▍         | 9/200 [00:00<00:08, 21.61it/s]
  6%|▌         | 12/200 [00:00<00:08, 21.76it/s]
  8%|▊         | 15/200 [00:00<00:08, 21.75it/s]
  9%|▉         | 18/200 [00:00<00:08, 21.90it/s]
 10%|█         | 21/200 [00:00<00:08, 22.10it/s]
 12%|█▏        | 24/200 [00:01<00:07, 22.08it/s]
 14%|█▎        | 27/200 [00:01<00:07, 22.11it/s]
 15%|█▌        | 30/200 [00:01<00:07, 22.13it/s]
 16%|█▋        | 33/200 [00:01<00:07, 22.13it/s]
 18%|█▊        | 36/200 [00:01<00:07, 22.07it/s]
 20%|█▉        | 39/200 [00:01<00:07, 21.99it/s]
 21%|██        | 42/200 [00:01<00:07, 21.95it/s]
 22%|██▎       | 45/200 [00:02<00:07, 21.94it/s]
 24%|██▍       | 48/200 [00:02<00:06, 22.06it/s]
 26%|██▌       | 51/200 [00:02<00:06, 21.72it/s]
 27%|██▋       | 54/200 [00:02<00:06, 21.92it/s]
 28%|██▊       | 57/200 [00:02<00:06, 21.52it/s]
 30%|███       | 60/200 [00:02<00:06, 21.52it/s]
 32%|███▏      | 63/200 [00:02<00:06, 21.48it/s]
 33%|███▎      | 66/200 [00:03<00:06, 21.60it/s]
 34%|███▍      | 69/200 [00:03<00:06, 21.25it/s]
 36%|███▌      | 72/200 [00:03<00:05, 21.48it/s]
 38%|███▊      | 75/200 [00:03<00:05, 21.57it/s]
 39%|███▉      | 78/200 [00:03<00:05, 21.55it/s]
 40%|████      | 81/200 [00:03<00:05, 21.39it/s]
 42%|████▏     | 84/200 [00:03<00:05, 21.41it/s]
 44%|████▎     | 87/200 [00:03<00:05, 21.79it/s]
 45%|████▌     | 90/200 [00:04<00:05, 21.99it/s]
 46%|████▋     | 93/200 [00:04<00:04, 21.97it/s]
 48%|████▊     | 96/200 [00:04<00:04, 22.21it/s]
 50%|████▉     | 99/200 [00:04<00:04, 22.15it/s]
 51%|█████     | 102/200 [00:04<00:04, 22.24it/s]
 52%|█████▎    | 105/200 [00:04<00:04, 22.18it/s]
 54%|█████▍    | 108/200 [00:04<00:04, 21.92it/s]
 56%|█████▌    | 111/200 [00:05<00:04, 21.99it/s]
 57%|█████▋    | 114/200 [00:05<00:03, 21.92it/s]
 58%|█████▊    | 117/200 [00:05<00:03, 21.93it/s]
 60%|██████    | 120/200 [00:05<00:03, 22.04it/s]
 62%|██████▏   | 123/200 [00:05<00:03, 21.92it/s]
 63%|██████▎   | 126/200 [00:05<00:03, 22.14it/s]
 64%|██████▍   | 129/200 [00:05<00:03, 21.83it/s]
 66%|██████▌   | 132/200 [00:06<00:03, 22.08it/s]
 68%|██████▊   | 135/200 [00:06<00:02, 21.95it/s]
 69%|██████▉   | 138/200 [00:06<00:02, 21.78it/s]
 70%|███████   | 141/200 [00:06<00:02, 21.94it/s]
 72%|███████▏  | 144/200 [00:06<00:02, 21.87it/s]
 74%|███████▎  | 147/200 [00:06<00:02, 22.02it/s]
 75%|███████▌  | 150/200 [00:06<00:02, 21.81it/s]
 76%|███████▋  | 153/200 [00:06<00:02, 21.90it/s]
 78%|███████▊  | 156/200 [00:07<00:02, 21.92it/s]
 80%|███████▉  | 159/200 [00:07<00:01, 21.97it/s]
 81%|████████  | 162/200 [00:07<00:01, 21.78it/s]
 82%|████████▎ | 165/200 [00:07<00:01, 21.62it/s]
 84%|████████▍ | 168/200 [00:07<00:01, 21.85it/s]
 86%|████████▌ | 171/200 [00:07<00:01, 21.73it/s]
 87%|████████▋ | 174/200 [00:07<00:01, 21.68it/s]
 88%|████████▊ | 177/200 [00:08<00:01, 21.75it/s]
 90%|█████████ | 180/200 [00:08<00:00, 21.94it/s]
 92%|█████████▏| 183/200 [00:08<00:00, 22.08it/s]
 93%|█████████▎| 186/200 [00:08<00:00, 22.18it/s]
 94%|█████████▍| 189/200 [00:08<00:00, 22.34it/s]
 96%|█████████▌| 192/200 [00:08<00:00, 21.88it/s]
 98%|█████████▊| 195/200 [00:08<00:00, 21.66it/s]
 99%|█████████▉| 198/200 [00:09<00:00, 21.81it/s]
100%|██████████| 200/200 [00:09<00:00, 21.86it/s]

Mean Error of Estimated Rotations

ASPIRE has the built-in utility function, mean_aligned_angular_distance, which globally aligns the estimated rotations to the true rotations and computes the mean angular distance (in degrees).

from aspire.utils import mean_aligned_angular_distance

# Compare with known true rotations
mean_ang_dist = mean_aligned_angular_distance(oriented_src.rotations, true_rotations)
print(f"Mean aligned angular distance: {mean_ang_dist} degrees")
Mean aligned angular distance: 7.126775193681746 degrees

Volume Reconstruction

Now that we have our class averages and rotation estimates, we can estimate the mean volume by supplying the class averages and basis for back projection.

from aspire.reconstruction import MeanEstimator

# Setup an estimator to perform the back projection.
estimator = MeanEstimator(oriented_src)

# Perform the estimation and save the volume.
estimated_volume = estimator.estimate()
  0%|          | 0/200 [00:00<?, ?it/s]
  0%|          | 1/200 [00:00<00:23,  8.53it/s]
  1%|          | 2/200 [00:00<00:23,  8.50it/s]
  2%|▏         | 3/200 [00:00<00:23,  8.38it/s]
  2%|▏         | 4/200 [00:00<00:23,  8.28it/s]
  2%|▎         | 5/200 [00:00<00:23,  8.24it/s]
  3%|▎         | 6/200 [00:00<00:23,  8.19it/s]
  4%|▎         | 7/200 [00:00<00:23,  8.17it/s]
  4%|▍         | 8/200 [00:00<00:23,  8.17it/s]
  4%|▍         | 9/200 [00:01<00:23,  8.23it/s]
  5%|▌         | 10/200 [00:01<00:22,  8.30it/s]
  6%|▌         | 11/200 [00:01<00:22,  8.24it/s]
  6%|▌         | 12/200 [00:01<00:22,  8.27it/s]
  6%|▋         | 13/200 [00:01<00:22,  8.26it/s]
  7%|▋         | 14/200 [00:01<00:22,  8.19it/s]
  8%|▊         | 15/200 [00:01<00:22,  8.24it/s]
  8%|▊         | 16/200 [00:01<00:22,  8.25it/s]
  8%|▊         | 17/200 [00:02<00:22,  8.26it/s]
  9%|▉         | 18/200 [00:02<00:22,  8.25it/s]
 10%|▉         | 19/200 [00:02<00:21,  8.29it/s]
 10%|█         | 20/200 [00:02<00:21,  8.28it/s]
 10%|█         | 21/200 [00:02<00:21,  8.27it/s]
 11%|█         | 22/200 [00:02<00:21,  8.23it/s]
 12%|█▏        | 23/200 [00:02<00:21,  8.18it/s]
 12%|█▏        | 24/200 [00:02<00:21,  8.30it/s]
 12%|█▎        | 25/200 [00:03<00:20,  8.34it/s]
 13%|█▎        | 26/200 [00:03<00:20,  8.34it/s]
 14%|█▎        | 27/200 [00:03<00:20,  8.30it/s]
 14%|█▍        | 28/200 [00:03<00:20,  8.29it/s]
 14%|█▍        | 29/200 [00:03<00:20,  8.28it/s]
 15%|█▌        | 30/200 [00:03<00:20,  8.33it/s]
 16%|█▌        | 31/200 [00:03<00:20,  8.31it/s]
 16%|█▌        | 32/200 [00:03<00:20,  8.34it/s]
 16%|█▋        | 33/200 [00:03<00:20,  8.27it/s]
 17%|█▋        | 34/200 [00:04<00:20,  8.22it/s]
 18%|█▊        | 35/200 [00:04<00:20,  8.23it/s]
 18%|█▊        | 36/200 [00:04<00:19,  8.30it/s]
 18%|█▊        | 37/200 [00:04<00:19,  8.31it/s]
 19%|█▉        | 38/200 [00:04<00:19,  8.36it/s]
 20%|█▉        | 39/200 [00:04<00:19,  8.40it/s]
 20%|██        | 40/200 [00:04<00:19,  8.32it/s]
 20%|██        | 41/200 [00:04<00:19,  8.32it/s]
 21%|██        | 42/200 [00:05<00:18,  8.34it/s]
 22%|██▏       | 43/200 [00:05<00:18,  8.37it/s]
 22%|██▏       | 44/200 [00:05<00:18,  8.40it/s]
 22%|██▎       | 45/200 [00:05<00:18,  8.41it/s]
 23%|██▎       | 46/200 [00:05<00:18,  8.38it/s]
 24%|██▎       | 47/200 [00:05<00:18,  8.38it/s]
 24%|██▍       | 48/200 [00:05<00:18,  8.36it/s]
 24%|██▍       | 49/200 [00:05<00:18,  8.32it/s]
 25%|██▌       | 50/200 [00:06<00:18,  8.33it/s]
 26%|██▌       | 51/200 [00:06<00:17,  8.39it/s]
 26%|██▌       | 52/200 [00:06<00:17,  8.39it/s]
 26%|██▋       | 53/200 [00:06<00:17,  8.43it/s]
 27%|██▋       | 54/200 [00:06<00:17,  8.34it/s]
 28%|██▊       | 55/200 [00:06<00:17,  8.32it/s]
 28%|██▊       | 56/200 [00:06<00:17,  8.31it/s]
 28%|██▊       | 57/200 [00:06<00:17,  8.28it/s]
 29%|██▉       | 58/200 [00:06<00:17,  8.30it/s]
 30%|██▉       | 59/200 [00:07<00:17,  8.28it/s]
 30%|███       | 60/200 [00:07<00:16,  8.30it/s]
 30%|███       | 61/200 [00:07<00:16,  8.42it/s]
 31%|███       | 62/200 [00:07<00:16,  8.40it/s]
 32%|███▏      | 63/200 [00:07<00:16,  8.34it/s]
 32%|███▏      | 64/200 [00:07<00:16,  8.42it/s]
 32%|███▎      | 65/200 [00:07<00:15,  8.44it/s]
 33%|███▎      | 66/200 [00:07<00:15,  8.42it/s]
 34%|███▎      | 67/200 [00:08<00:15,  8.40it/s]
 34%|███▍      | 68/200 [00:08<00:15,  8.38it/s]
 34%|███▍      | 69/200 [00:08<00:15,  8.36it/s]
 35%|███▌      | 70/200 [00:08<00:15,  8.36it/s]
 36%|███▌      | 71/200 [00:08<00:15,  8.34it/s]
 36%|███▌      | 72/200 [00:08<00:15,  8.32it/s]
 36%|███▋      | 73/200 [00:08<00:15,  8.27it/s]
 37%|███▋      | 74/200 [00:08<00:15,  8.27it/s]
 38%|███▊      | 75/200 [00:09<00:15,  8.31it/s]
 38%|███▊      | 76/200 [00:09<00:14,  8.34it/s]
 38%|███▊      | 77/200 [00:09<00:14,  8.26it/s]
 39%|███▉      | 78/200 [00:09<00:19,  6.34it/s]
 40%|███▉      | 79/200 [00:09<00:17,  6.80it/s]
 40%|████      | 80/200 [00:09<00:16,  7.13it/s]
 40%|████      | 81/200 [00:09<00:15,  7.44it/s]
 41%|████      | 82/200 [00:09<00:15,  7.65it/s]
 42%|████▏     | 83/200 [00:10<00:14,  7.85it/s]
 42%|████▏     | 84/200 [00:10<00:14,  7.95it/s]
 42%|████▎     | 85/200 [00:10<00:14,  8.03it/s]
 43%|████▎     | 86/200 [00:10<00:14,  8.08it/s]
 44%|████▎     | 87/200 [00:10<00:13,  8.15it/s]
 44%|████▍     | 88/200 [00:10<00:13,  8.29it/s]
 44%|████▍     | 89/200 [00:10<00:13,  8.30it/s]
 45%|████▌     | 90/200 [00:10<00:13,  8.29it/s]
 46%|████▌     | 91/200 [00:11<00:13,  8.25it/s]
 46%|████▌     | 92/200 [00:11<00:13,  8.25it/s]
 46%|████▋     | 93/200 [00:11<00:12,  8.34it/s]
 47%|████▋     | 94/200 [00:11<00:12,  8.37it/s]
 48%|████▊     | 95/200 [00:11<00:12,  8.45it/s]
 48%|████▊     | 96/200 [00:11<00:12,  8.37it/s]
 48%|████▊     | 97/200 [00:11<00:12,  8.34it/s]
 49%|████▉     | 98/200 [00:11<00:12,  8.35it/s]
 50%|████▉     | 99/200 [00:12<00:12,  8.27it/s]
 50%|█████     | 100/200 [00:12<00:12,  8.24it/s]
 50%|█████     | 101/200 [00:12<00:12,  8.22it/s]
 51%|█████     | 102/200 [00:12<00:11,  8.28it/s]
 52%|█████▏    | 103/200 [00:12<00:11,  8.09it/s]
 52%|█████▏    | 104/200 [00:12<00:11,  8.22it/s]
 52%|█████▎    | 105/200 [00:12<00:11,  8.25it/s]
 53%|█████▎    | 106/200 [00:12<00:11,  8.23it/s]
 54%|█████▎    | 107/200 [00:13<00:11,  8.22it/s]
 54%|█████▍    | 108/200 [00:13<00:11,  8.27it/s]
 55%|█████▍    | 109/200 [00:13<00:11,  8.26it/s]
 55%|█████▌    | 110/200 [00:13<00:10,  8.31it/s]
 56%|█████▌    | 111/200 [00:13<00:10,  8.26it/s]
 56%|█████▌    | 112/200 [00:13<00:10,  8.24it/s]
 56%|█████▋    | 113/200 [00:13<00:10,  8.22it/s]
 57%|█████▋    | 114/200 [00:13<00:10,  8.28it/s]
 57%|█████▊    | 115/200 [00:13<00:10,  8.25it/s]
 58%|█████▊    | 116/200 [00:14<00:10,  8.25it/s]
 58%|█████▊    | 117/200 [00:14<00:10,  8.29it/s]
 59%|█████▉    | 118/200 [00:14<00:09,  8.27it/s]
 60%|█████▉    | 119/200 [00:14<00:09,  8.22it/s]
 60%|██████    | 120/200 [00:14<00:09,  8.21it/s]
 60%|██████    | 121/200 [00:14<00:09,  8.16it/s]
 61%|██████    | 122/200 [00:14<00:09,  8.17it/s]
 62%|██████▏   | 123/200 [00:14<00:09,  8.17it/s]
 62%|██████▏   | 124/200 [00:15<00:09,  8.26it/s]
 62%|██████▎   | 125/200 [00:15<00:09,  8.32it/s]
 63%|██████▎   | 126/200 [00:15<00:08,  8.31it/s]
 64%|██████▎   | 127/200 [00:15<00:08,  8.33it/s]
 64%|██████▍   | 128/200 [00:15<00:08,  8.30it/s]
 64%|██████▍   | 129/200 [00:15<00:08,  8.28it/s]
 65%|██████▌   | 130/200 [00:15<00:08,  8.33it/s]
 66%|██████▌   | 131/200 [00:15<00:08,  8.35it/s]
 66%|██████▌   | 132/200 [00:16<00:08,  8.38it/s]
 66%|██████▋   | 133/200 [00:16<00:08,  8.36it/s]
 67%|██████▋   | 134/200 [00:16<00:07,  8.32it/s]
 68%|██████▊   | 135/200 [00:16<00:07,  8.31it/s]
 68%|██████▊   | 136/200 [00:16<00:07,  8.28it/s]
 68%|██████▊   | 137/200 [00:16<00:07,  8.17it/s]
 69%|██████▉   | 138/200 [00:16<00:07,  8.20it/s]
 70%|██████▉   | 139/200 [00:16<00:07,  8.24it/s]
 70%|███████   | 140/200 [00:17<00:07,  8.24it/s]
 70%|███████   | 141/200 [00:17<00:07,  8.22it/s]
 71%|███████   | 142/200 [00:17<00:07,  8.22it/s]
 72%|███████▏  | 143/200 [00:17<00:06,  8.21it/s]
 72%|███████▏  | 144/200 [00:17<00:06,  8.19it/s]
 72%|███████▎  | 145/200 [00:17<00:06,  8.18it/s]
 73%|███████▎  | 146/200 [00:17<00:06,  8.14it/s]
 74%|███████▎  | 147/200 [00:17<00:06,  8.07it/s]
 74%|███████▍  | 148/200 [00:17<00:06,  8.12it/s]
 74%|███████▍  | 149/200 [00:18<00:06,  8.14it/s]
 75%|███████▌  | 150/200 [00:18<00:06,  8.10it/s]
 76%|███████▌  | 151/200 [00:18<00:06,  8.09it/s]
 76%|███████▌  | 152/200 [00:18<00:05,  8.18it/s]
 76%|███████▋  | 153/200 [00:18<00:05,  8.25it/s]
 77%|███████▋  | 154/200 [00:18<00:05,  8.21it/s]
 78%|███████▊  | 155/200 [00:18<00:05,  8.21it/s]
 78%|███████▊  | 156/200 [00:18<00:05,  8.25it/s]
 78%|███████▊  | 157/200 [00:19<00:05,  8.26it/s]
 79%|███████▉  | 158/200 [00:19<00:05,  8.30it/s]
 80%|███████▉  | 159/200 [00:19<00:04,  8.27it/s]
 80%|████████  | 160/200 [00:19<00:04,  8.28it/s]
 80%|████████  | 161/200 [00:19<00:04,  8.38it/s]
 81%|████████  | 162/200 [00:19<00:04,  8.36it/s]
 82%|████████▏ | 163/200 [00:19<00:04,  8.35it/s]
 82%|████████▏ | 164/200 [00:19<00:04,  8.32it/s]
 82%|████████▎ | 165/200 [00:20<00:04,  8.32it/s]
 83%|████████▎ | 166/200 [00:20<00:04,  8.30it/s]
 84%|████████▎ | 167/200 [00:20<00:03,  8.37it/s]
 84%|████████▍ | 168/200 [00:20<00:03,  8.40it/s]
 84%|████████▍ | 169/200 [00:20<00:03,  8.38it/s]
 85%|████████▌ | 170/200 [00:20<00:03,  8.34it/s]
 86%|████████▌ | 171/200 [00:20<00:03,  8.32it/s]
 86%|████████▌ | 172/200 [00:20<00:03,  8.26it/s]
 86%|████████▋ | 173/200 [00:21<00:03,  8.27it/s]
 87%|████████▋ | 174/200 [00:21<00:03,  8.27it/s]
 88%|████████▊ | 175/200 [00:21<00:03,  8.26it/s]
 88%|████████▊ | 176/200 [00:21<00:02,  8.31it/s]
 88%|████████▊ | 177/200 [00:21<00:02,  8.28it/s]
 89%|████████▉ | 178/200 [00:21<00:02,  8.34it/s]
 90%|████████▉ | 179/200 [00:21<00:02,  8.38it/s]
 90%|█████████ | 180/200 [00:21<00:02,  8.34it/s]
 90%|█████████ | 181/200 [00:21<00:02,  8.25it/s]
 91%|█████████ | 182/200 [00:22<00:02,  8.26it/s]
 92%|█████████▏| 183/200 [00:22<00:02,  8.31it/s]
 92%|█████████▏| 184/200 [00:22<00:01,  8.33it/s]
 92%|█████████▎| 185/200 [00:22<00:01,  8.36it/s]
 93%|█████████▎| 186/200 [00:22<00:01,  8.35it/s]
 94%|█████████▎| 187/200 [00:22<00:01,  8.32it/s]
 94%|█████████▍| 188/200 [00:22<00:01,  8.36it/s]
 94%|█████████▍| 189/200 [00:22<00:01,  8.40it/s]
 95%|█████████▌| 190/200 [00:23<00:01,  8.32it/s]
 96%|█████████▌| 191/200 [00:23<00:01,  8.33it/s]
 96%|█████████▌| 192/200 [00:23<00:00,  8.37it/s]
 96%|█████████▋| 193/200 [00:23<00:00,  8.35it/s]
 97%|█████████▋| 194/200 [00:23<00:00,  8.28it/s]
 98%|█████████▊| 195/200 [00:23<00:00,  8.28it/s]
 98%|█████████▊| 196/200 [00:23<00:00,  8.29it/s]
 98%|█████████▊| 197/200 [00:23<00:00,  8.29it/s]
 99%|█████████▉| 198/200 [00:24<00:00,  8.31it/s]
100%|█████████▉| 199/200 [00:24<00:00,  8.34it/s]
100%|██████████| 200/200 [00:24<00:00,  8.35it/s]
100%|██████████| 200/200 [00:24<00:00,  8.25it/s]

  0%|          | 0/200 [00:00<?, ?it/s]
  2%|▏         | 3/200 [00:00<00:08, 22.67it/s]
  3%|▎         | 6/200 [00:00<00:08, 21.90it/s]
  4%|▍         | 9/200 [00:00<00:08, 21.79it/s]
  6%|▌         | 12/200 [00:00<00:08, 21.90it/s]
  8%|▊         | 15/200 [00:00<00:08, 21.80it/s]
  9%|▉         | 18/200 [00:00<00:08, 21.65it/s]
 10%|█         | 21/200 [00:00<00:08, 21.05it/s]
 12%|█▏        | 24/200 [00:01<00:08, 21.28it/s]
 14%|█▎        | 27/200 [00:01<00:08, 21.36it/s]
 15%|█▌        | 30/200 [00:01<00:07, 21.56it/s]
 16%|█▋        | 33/200 [00:01<00:07, 21.47it/s]
 18%|█▊        | 36/200 [00:01<00:07, 21.65it/s]
 20%|█▉        | 39/200 [00:01<00:07, 21.71it/s]
 21%|██        | 42/200 [00:01<00:07, 21.80it/s]
 22%|██▎       | 45/200 [00:02<00:07, 21.97it/s]
 24%|██▍       | 48/200 [00:02<00:06, 21.90it/s]
 26%|██▌       | 51/200 [00:02<00:06, 21.55it/s]
 27%|██▋       | 54/200 [00:02<00:06, 21.61it/s]
 28%|██▊       | 57/200 [00:02<00:06, 21.55it/s]
 30%|███       | 60/200 [00:02<00:06, 21.52it/s]
 32%|███▏      | 63/200 [00:02<00:06, 21.63it/s]
 33%|███▎      | 66/200 [00:03<00:06, 21.61it/s]
 34%|███▍      | 69/200 [00:03<00:06, 21.70it/s]
 36%|███▌      | 72/200 [00:03<00:05, 21.73it/s]
 38%|███▊      | 75/200 [00:03<00:05, 21.73it/s]
 39%|███▉      | 78/200 [00:03<00:05, 21.65it/s]
 40%|████      | 81/200 [00:03<00:05, 21.59it/s]
 42%|████▏     | 84/200 [00:03<00:05, 21.71it/s]
 44%|████▎     | 87/200 [00:04<00:05, 21.90it/s]
 45%|████▌     | 90/200 [00:04<00:05, 21.97it/s]
 46%|████▋     | 93/200 [00:04<00:04, 21.83it/s]
 48%|████▊     | 96/200 [00:04<00:04, 21.79it/s]
 50%|████▉     | 99/200 [00:04<00:04, 21.66it/s]
 51%|█████     | 102/200 [00:04<00:04, 21.79it/s]
 52%|█████▎    | 105/200 [00:04<00:04, 21.86it/s]
 54%|█████▍    | 108/200 [00:04<00:04, 21.98it/s]
 56%|█████▌    | 111/200 [00:05<00:04, 21.91it/s]
 57%|█████▋    | 114/200 [00:05<00:03, 21.83it/s]
 58%|█████▊    | 117/200 [00:05<00:03, 21.76it/s]
 60%|██████    | 120/200 [00:05<00:03, 21.66it/s]
 62%|██████▏   | 123/200 [00:05<00:03, 21.16it/s]
 63%|██████▎   | 126/200 [00:05<00:03, 21.53it/s]
 64%|██████▍   | 129/200 [00:05<00:03, 21.51it/s]
 66%|██████▌   | 132/200 [00:06<00:03, 21.99it/s]
 68%|██████▊   | 135/200 [00:06<00:02, 21.95it/s]
 69%|██████▉   | 138/200 [00:06<00:02, 21.59it/s]
 70%|███████   | 141/200 [00:06<00:02, 21.47it/s]
 72%|███████▏  | 144/200 [00:06<00:02, 21.23it/s]
 74%|███████▎  | 147/200 [00:06<00:02, 21.24it/s]
 75%|███████▌  | 150/200 [00:06<00:02, 21.32it/s]
 76%|███████▋  | 153/200 [00:07<00:02, 21.56it/s]
 78%|███████▊  | 156/200 [00:07<00:02, 21.39it/s]
 80%|███████▉  | 159/200 [00:07<00:01, 21.47it/s]
 81%|████████  | 162/200 [00:07<00:01, 21.70it/s]
 82%|████████▎ | 165/200 [00:07<00:01, 21.43it/s]
 84%|████████▍ | 168/200 [00:07<00:01, 21.44it/s]
 86%|████████▌ | 171/200 [00:07<00:01, 21.43it/s]
 87%|████████▋ | 174/200 [00:08<00:01, 21.34it/s]
 88%|████████▊ | 177/200 [00:08<00:01, 21.33it/s]
 90%|█████████ | 180/200 [00:08<00:00, 21.26it/s]
 92%|█████████▏| 183/200 [00:08<00:00, 21.50it/s]
 93%|█████████▎| 186/200 [00:08<00:00, 21.47it/s]
 94%|█████████▍| 189/200 [00:08<00:00, 21.76it/s]
 96%|█████████▌| 192/200 [00:08<00:00, 21.76it/s]
 98%|█████████▊| 195/200 [00:09<00:00, 21.66it/s]
 99%|█████████▉| 198/200 [00:09<00:00, 21.77it/s]
100%|██████████| 200/200 [00:09<00:00, 21.63it/s]

Comparison of Estimated Volume with Source Volume

To get a visual confirmation that our results are sane, we rotate the estimated volume by the estimated rotations and project along the z-axis. These estimated projections should align with the original projection images.

from aspire.source import ArrayImageSource

# Get projections from the estimated volume using the estimated
# orientations.  We instantiate the projections as an
# ``ArrayImageSource`` to access the ``Image.show()`` method.
projections_est = ArrayImageSource(estimated_volume.project(oriented_src.rotations))

# We view the first 10 projections of the estimated volume.
projections_est.images[0:10].show()
pipeline demo
# For comparison, we view the first 10 source projections.
src.projections[0:10].show()
pipeline demo

Total running time of the script: (2 minutes 31.842 seconds)

Gallery generated by Sphinx-Gallery