|
3 | 3 | import numpy as np |
4 | 4 | from scipy.linalg import eigh |
5 | 5 |
|
6 | | -from aspire.abinitio import CLOrient3D, JSync, SyncVotingMixin |
| 6 | +from aspire.abinitio import CLOrient3D, JSync |
| 7 | +from aspire.abinitio.sync_voting import _syncmatrix_ij_vote_3n |
7 | 8 | from aspire.utils import J_conjugate, Rotation, all_pairs |
8 | 9 |
|
9 | 10 | from .commonline_utils import ( |
|
15 | 16 | logger = logging.getLogger(__name__) |
16 | 17 |
|
17 | 18 |
|
18 | | -class CLSymmetryC2(CLOrient3D, SyncVotingMixin): |
| 19 | +class CLSymmetryC2(CLOrient3D): |
19 | 20 | """ |
20 | 21 | Define a class to estimate 3D orientations using common lines methods for molecules with C2 cyclic symmetry. |
21 | 22 |
|
@@ -241,7 +242,7 @@ def _estimate_relative_viewing_directions(self): |
241 | 242 | self.build_clmatrix() |
242 | 243 |
|
243 | 244 | # Step 2: Calculate relative rotations associated with both mutual common lines. |
244 | | - Rijs, Rijgs = self._estimate_all_Rijs_c2(self.clmatrix) |
| 245 | + Rijs, Rijgs = self._estimate_all_Rijs_c2() |
245 | 246 |
|
246 | 247 | # Step 3: Inner J-synchronization |
247 | 248 | Rijs, Rijgs = self._local_J_sync_c2(Rijs, Rijgs) |
@@ -338,23 +339,36 @@ def _estimate_inplane_rotations(self, vis, Rijs, Rijgs): |
338 | 339 | # Secondary Methods for computing outer product # |
339 | 340 | ################################################# |
340 | 341 |
|
341 | | - def _estimate_all_Rijs_c2(self, clmatrix): |
| 342 | + def _estimate_all_Rijs_c2(self): |
342 | 343 | """ |
343 | 344 | Estimate the two sets of relative rotations, Rijs and Rijgs, between pairs |
344 | 345 | of images using the voting method. |
345 | 346 |
|
346 | | - :param clmatrix: 2 x n_img x n_img array holding two sets of mutual common-lines |
347 | | - between pairs of images. |
348 | 347 | :return: Relative rotations, Rijs and Rijgs. |
349 | 348 | """ |
350 | 349 | k_list = np.arange(self.n_img) |
351 | | - n_theta = self.n_theta |
352 | 350 | pairs = all_pairs(self.n_img) |
353 | 351 | Rijs = np.zeros((len(pairs), 3, 3), dtype=self.dtype) |
354 | 352 | Rijgs = np.zeros((len(pairs), 3, 3), dtype=self.dtype) |
355 | 353 | for idx, (i, j) in enumerate(pairs): |
356 | | - Rijs[idx] = self._syncmatrix_ij_vote_3n(clmatrix[0], i, j, k_list, n_theta) |
357 | | - Rijgs[idx] = self._syncmatrix_ij_vote_3n(clmatrix[1], i, j, k_list, n_theta) |
| 354 | + Rijs[idx] = _syncmatrix_ij_vote_3n( |
| 355 | + self.clmatrix[0], |
| 356 | + i, |
| 357 | + j, |
| 358 | + k_list, |
| 359 | + self.n_theta, |
| 360 | + self.hist_bin_width, |
| 361 | + self.full_width, |
| 362 | + ) |
| 363 | + Rijgs[idx] = _syncmatrix_ij_vote_3n( |
| 364 | + self.clmatrix[1], |
| 365 | + i, |
| 366 | + j, |
| 367 | + k_list, |
| 368 | + self.n_theta, |
| 369 | + self.hist_bin_width, |
| 370 | + self.full_width, |
| 371 | + ) |
358 | 372 |
|
359 | 373 | return Rijs, Rijgs |
360 | 374 |
|
|
0 commit comments