Skip to content

Commit 60d1db6

Browse files
j-c-cgarrettwrong
authored andcommitted
fix sphinx cell ignore. estimate rots in Orientation Estimation block.
1 parent 990d666 commit 60d1db6

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

gallery/tutorials/pipeline_demo.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@
1414
# Ribosome, sourced from EMDB: https://www.ebi.ac.uk/emdb/EMD-2660.
1515
# This is one of several volume maps that can be downloaded with
1616
# ASPIRE's data downloading utility by using the following import.
17+
1718
# sphinx_gallery_start_ignore
1819
# flake8: noqa
1920
# sphinx_gallery_end_ignore
21+
2022
from aspire.downloader import emdb_2660
2123

2224
# Load 80s Ribosome as a ``Volume`` object.
@@ -244,6 +246,8 @@
244246
# Instantiate an ``OrientedSource``.
245247
oriented_src = OrientedSource(avgs, orient_est)
246248

249+
# Estimate Rotations.
250+
est_rotations = oriented_src.rotations
247251

248252
# %%
249253
# Mean Error of Estimated Rotations
@@ -255,7 +259,7 @@
255259
from aspire.utils import mean_aligned_angular_distance
256260

257261
# Compare with known true rotations
258-
mean_ang_dist = mean_aligned_angular_distance(oriented_src.rotations, true_rotations)
262+
mean_ang_dist = mean_aligned_angular_distance(est_rotations, true_rotations)
259263
print(f"Mean aligned angular distance: {mean_ang_dist} degrees")
260264

261265

@@ -286,7 +290,7 @@
286290
# Get the first 10 projections from the estimated volume using the
287291
# estimated orientations. Recall that ``project`` returns an
288292
# ``Image`` instance, which we can peek at with ``show``.
289-
projections_est = estimated_volume.project(oriented_src.rotations[0:10])
293+
projections_est = estimated_volume.project(est_rotations[0:10])
290294

291295
# We view the first 10 projections of the estimated volume.
292296
projections_est.show()
@@ -308,7 +312,7 @@
308312

309313
# `find_registration` returns the best aligning rotation, `Q`, as well as
310314
# a `flag` which indicates if the volume needs to be reflected.
311-
Q, flag = Rotation(oriented_src.rotations).find_registration(true_rotations)
315+
Q, flag = Rotation(est_rotations).find_registration(true_rotations)
312316
aligned_vol = estimated_volume
313317
if flag == 1:
314318
aligned_vol = aligned_vol.flip()

0 commit comments

Comments
 (0)